Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1402603
Remove Competitors perspective
fvacek May 5, 2025
71649b6
Remove unused competitors files
fvacek May 5, 2025
9e6ae2b
Fix clang-tidy warnings
fvacek May 8, 2025
0ba9dea
Add save button to competitor widget
fvacek May 8, 2025
8858cc4
Fix draw class and remove drawing buttons auto connect
fvacek May 13, 2025
f7dcd70
Select free start times doubleclicking on start time in competitor di…
fvacek May 15, 2025
185c02a
Add IOF-ID column to run table
fvacek May 19, 2025
7273ff5
Fix cannot add or remove competitor by [+] [-] buttons
fvacek May 19, 2025
b64ad87
Merge remote-tracking branch 'origin/qe3' into remove-competitors
fvacek May 19, 2025
fb1e44a
clang tidy in progress
fvacek May 20, 2025
c70c030
Merge branch 'qe3' into clang-tidy-in-progress
fvacek May 23, 2025
d94d3c8
StackTrace simplified
fvacek May 23, 2025
83d50c6
More lint fixes
fvacek May 23, 2025
37af006
fixup! More lint fixes
fvacek May 24, 2025
acd9ac6
fixup! fixup! More lint fixes
fvacek May 24, 2025
197569c
Remove dbfs
fvacek May 24, 2025
c02290b
Clang tidy: enable non-const-global-variables
fvacek May 24, 2025
3cebded
More clang-tidy errors fixup
fvacek May 24, 2025
39211d1
Remove qfdbfs
fvacek May 24, 2025
89c8a77
Next clang-tidy errors fixed
fvacek May 24, 2025
12b3cdd
fixup! Next clang-tidy errors fixed
fvacek May 24, 2025
c6f1d76
Clazy fixes
fvacek May 24, 2025
6d1994a
More clang tidy fixes
fvacek May 24, 2025
3cce503
Set github actions default arch to linux_gcc_64
fvacek May 24, 2025
bcc6504
More clazy fixes
fvacek May 24, 2025
c168597
More clazy fixes II
fvacek May 24, 2025
73edb7b
More clazy fixes
fvacek May 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Checks:
clang-analyzer-*,
misc-*,
readability-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-integer-division,
Expand All @@ -21,6 +22,7 @@ Checks:
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-explicit-virtual-functions,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
Expand Down Expand Up @@ -58,6 +60,7 @@ Checks:
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-modernize-avoid-c-arrays,
-modernize-pass-by-value,
-modernize-return-braced-init-list,
-modernize-use-default-member-init,
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ inputs:
description: "Specify Qt version to use"
required: true
qt_arch:
description: "Specify Qt version to use"
default: "gcc_64"
description: "Specify architecture to use"
default: "linux_gcc_64"
use_qt6:
description: "Specify whether we're using Qt 5 or Qt 6"
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/run-linter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
- name: Setup CMake
uses: ./.github/actions/cmake
with:
qt_version: 6.6.3
qt_version: 6.8.3
use_qt6: ON
modules: qtserialport qtmultimedia
additional_cmake_args: -DCMAKE_GLOBAL_AUTOGEN_TARGET=ON -DCMAKE_AUTOGEN_ORIGIN_DEPENDS=OFF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup CMake
uses: ./.github/actions/cmake
with:
qt_version: 6.6.3
qt_version: 6.8.3
use_qt6: ON
modules: qtserialport qtmultimedia
additional_cmake_args: -DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/install/usr'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
- name: Run clazy
uses: ./.github/actions/run-linter
with:
lint_program_with_args: clazy-standalone --checks=level1,no-fully-qualified-moc-types,no-non-pod-global-static
lint_program_with_args: clazy-standalone --checks=level1,no-fully-qualified-moc-types,no-non-pod-global-static,no-qstring-arg,no-qproperty-without-notify,no-range-loop-detach,no-lambda-unique-connection
2 changes: 1 addition & 1 deletion 3rdparty/necrolog
3 changes: 0 additions & 3 deletions libqf/libqfcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ add_library(libqfcore SHARED
src/sql/connection.cpp
src/sql/dbenum.cpp
src/sql/dbenumcache.cpp
src/sql/dbfsattrs.cpp
src/sql/dbfsdriver.cpp
src/sql/query.cpp
src/sql/querybuilder.cpp
src/sql/tablelocker.cpp
src/sql/transaction.cpp
src/utils/clioptions.cpp
src/utils/crypt.cpp
Expand Down
1 change: 0 additions & 1 deletion libqf/libqfcore/include/qf/core/sql/dbfsattrs.h

This file was deleted.

1 change: 0 additions & 1 deletion libqf/libqfcore/include/qf/core/sql/dbfsdriver.h

This file was deleted.

1 change: 0 additions & 1 deletion libqf/libqfcore/include/qf/core/sql/tablelocker.h

This file was deleted.

13 changes: 5 additions & 8 deletions libqf/libqfcore/src/core/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

#include <QStringList>

#include <stdarg.h>
#include <stdio.h>

using namespace qf::core;

#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
Expand All @@ -16,9 +13,9 @@ using namespace qf::core;
#endif

//============================================================
// Exception
// Exception
//============================================================
bool Exception::s_abortOnException = false;
bool Exception::s_abortOnException = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

namespace {

Expand All @@ -34,11 +31,11 @@ Exception::Exception(const QString &_msg, const QString &_where)
m_where = _where;
m_msg = _msg;
m_what = m_msg.toUtf8();
m_stackTrace = StackTrace::stackTrace().toString();
m_stackTrace = StackTrace::stackTrace().join('\n');
log();
}

void Exception::log()
void Exception::log() const
{
if(isLogStackTrace())
logWarning() << message() << "\n" << where() << "\n----- stack trace -----\n" << stackTrace();
Expand All @@ -53,7 +50,7 @@ QString Exception::toString() const
return ret;
}

const char* Exception::what() const throw()
const char* Exception::what() const noexcept
{
return m_what.constData();
}
Expand Down
4 changes: 2 additions & 2 deletions libqf/libqfcore/src/core/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class QFCORE_DECL_EXPORT Exception : public std::exception
QString m_stackTrace;
protected:
void init(const QString& _msg, const QString& _where);
void log();
void log() const;
public:
QString message() const {return m_msg;}
QString where() const {return m_where;}
QString stackTrace() const {return m_stackTrace;}
virtual QString toString() const;
const char* what() const throw() Q_DECL_OVERRIDE;
const char* what() const noexcept override;
operator const char *() const throw(){return what();}

// set global variables: abortOnException from command line
Expand Down
20 changes: 9 additions & 11 deletions libqf/libqfcore/src/core/logentrymap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#include <QDateTime>

namespace qf {
namespace core {
namespace qf::core {

//=========================================================
// LogEntryMap
Expand Down Expand Up @@ -114,15 +113,14 @@ LogEntryMap &LogEntryMap::setTimeStamp(const QDateTime &ts)
QString LogEntryMap::toString() const
{
QString ret = "{";
ret += "\"level\":" + QString::number((int)level()) + ", ";
ret += "\"category\":\"" + category() + "\", ";
ret += "\"message\":\"" + message() + "\", ";
ret += "\"file\":\"" + file() + "\", ";
ret += "\"line\":" + QString::number(line()) + ", ";
ret += "\"time\":\"" + timeStamp().toString(Qt::ISODate) + "\", ";
ret += "\"function\":\"" + function() + "\"}";
ret += R"("level":)" + QString::number((int)level()) + ", ";
ret += R"("category":")" + category() + "\", ";
ret += R"("message":")" + message() + "\", ";
ret += R"("file":")" + file() + "\", ";
ret += R"("line":)" + QString::number(line()) + ", ";
ret += R"("time":")" + timeStamp().toString(Qt::ISODate) + "\", ";
ret += R"("function":")" + function() + "\"}";
return ret;
}

} // namespace core
} // namespace qf
}
170 changes: 20 additions & 150 deletions libqf/libqfcore/src/core/stacktrace.cpp
Original file line number Diff line number Diff line change
@@ -1,170 +1,40 @@
#include "stacktrace.h"

#include "string.h"

#include <QStringList>

#include <sstream>
#include <stdlib.h>

#if defined Q_CC_GNU && !defined Q_CC_MINGW && !defined ANDROID
#include <execinfo.h>
#include <cstdlib>
#include <execinfo.h>
#endif

using namespace qf::core;

#if defined Q_CC_GNU && !defined Q_CC_MINGW

static QString cutName(QString &s)
{
QString ret;
int ix = 0;
while(ix < s.length() && s[ix] >= '0' && s[ix] <= '9') {
ix++;
}
if(ix < s.length()) {
int l = s.mid(0, ix).toInt();
ret = s.mid(ix, l);
s = s.mid(ix + l);
}
return ret;
}

static QString demangle_gcc(const QString &_s)
{
String s = _s;
String ret;
int first_digit_pos;
for(first_digit_pos=0; first_digit_pos<_s.length(); first_digit_pos++) {
QChar c = _s[first_digit_pos];
if(c >= '0' && c <= '9')
break;
}
if(first_digit_pos < s.length()) {
s = s.slice(first_digit_pos);
while(true) {
QString ns = cutName(s);
if(ns.isEmpty())
break;
if(ret.isEmpty())
ret = ns;
else
ret += "::" + ns;
}
ret += "(" + s + ")";
}
else
ret = s;
//qDebug() << "\t ret:" << ret;
return ret;
}

#endif

StackTrace::StackTrace(const QStringList &sl)
QStringList StackTrace::stackTrace()
{
m_trace = sl;
}

StackTrace StackTrace::stackTrace()
{
QStringList sl_ret;
#if defined Q_CC_GNU && !defined Q_CC_MINGW
QStringList sl = trace2str();
for(String s : sl) {
int ix = s.indexOf('(');
String s1, s2, s3;
if(ix > 0) {
s1 = s.slice(0, ix);
s = s.slice(ix+1);
ix = s.indexOf('[');
if(ix > 0) {
s2 = s.slice(0, ix-2);
s3 = s.slice(ix + 1, -1);
}
else s2 = s.slice(0, -1);
}
else {
ix = s.indexOf('[');
if(ix > 0) {
s1 = s.slice(0, ix-1);
s3 = s.slice(ix + 1, -1);
}
else s1 = s;
}
sl_ret << s1 + ";" + demangle_gcc(s2) + ";" + s3;
}
#endif
return StackTrace(sl_ret);
}
const int max_frames = 100;
void* addrlist[max_frames]; // NOLINT(modernize-avoid-c-arrays)

QString StackTrace::toString() const
{
return m_trace.join("\n");
}

QStringList StackTrace::trace() const
{
return m_trace;
}
// Retrieve current stack addresses
int addrlen = backtrace(addrlist, max_frames);

#if defined(Q_CC_MSVC)
QString QFStackTrace::trace2str()
{
std::ostringstream oss;

CONTEXT context = {0};
::GetThreadContext( GetCurrentThread(), &context );

_asm call $+5
_asm pop eax
_asm mov context.Eip, eax
_asm mov eax, esp
_asm mov context.Esp, eax
_asm mov context.Ebp, ebp

SimpleSymbolEngine::instance().StackTrace( &context, oss );
return oss.str();
}
#elif defined Q_CC_GNU && !defined Q_CC_MINGW && !defined ANDROID
QStringList StackTrace::trace2str()
{
static const int MAX_CNT = 100;
void *array[MAX_CNT];
int size;
char **strings;
QStringList ret;
if (addrlen == 0) {
return {};
}

size = backtrace (array, MAX_CNT);
strings = backtrace_symbols (array, size);
// Create readable strings for each frame
auto symbollist = backtrace_symbols(addrlist, addrlen);

for(int i = 1; i < size; i++) {
//qDebug() << strings[i];
ret << QString::fromUtf8(strings[i]);
QStringList sl_ret;
for (int i = 0; i < addrlen; i++) {
sl_ret << symbollist[i];
}
free(strings);
return ret;
}

free(symbollist); // NOLINT(bugprone-multi-level-implicit-pointer-conversion,cppcoreguidelines-no-malloc,hicpp-no-malloc)
return sl_ret;
#else
///http://www.gnu.org/software/hello/manual/gnulib/execinfo_002eh.html
/**
8.13 execinfo.h

Declares the functions backtrace, backtrace_symbols, backtrace_symbols_fd.

Documentation:
http://www.gnu.org/software/libc/manual/html_node/Backtraces.html,
man backtrace.

Gnulib module: —

Portability problems fixed by Gnulib:

Portability problems not fixed by Gnulib:
This header file is missing on all non-glibc platforms:
MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10,
Cygwin, mingw, Interix 3.5, BeOS.
*/
QStringList StackTrace::trace2str() {return QStringList();}
return {};
#endif
}

9 changes: 1 addition & 8 deletions libqf/libqfcore/src/core/stacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ namespace core {
class QFCORE_DECL_EXPORT StackTrace
{
public:
static StackTrace stackTrace();
QString toString() const;
QStringList trace() const;
protected:
static QStringList trace2str();
private:
StackTrace(const QStringList &sl);
QStringList m_trace;
static QStringList stackTrace();
};

}
Expand Down
Loading
Loading