From 4c0329c5c2690bde28212c89029015a5da4c7e34 Mon Sep 17 00:00:00 2001 From: Enar Vaikene Date: Sat, 31 Aug 2019 09:26:55 +0300 Subject: [PATCH] Warning fixes and copyright update. --- src/apps/FileFinder/Engine/CMakeLists.txt | 3 ++ src/apps/FileFinder/Engine/engine.cpp | 22 +++++++------- src/apps/FileFinder/Engine/engine.h | 4 +-- src/apps/FileFinder/Engine/ifilefinder.h | 2 +- src/apps/FileFinder/Engine/version.h | 4 +-- src/apps/FileFinder/GUI/CMakeLists.txt | 2 ++ src/apps/FileFinder/GUI/gui.cpp | 36 +++++++++++------------ src/apps/FileFinder/GUI/gui.h | 4 +-- src/apps/FileFinder/GUI/version.h | 6 ++-- src/apps/PswGen/CLI/CMakeLists.txt | 3 ++ src/apps/PswGen/CLI/cli.cpp | 14 ++++----- src/apps/PswGen/CLI/cli.h | 2 +- src/apps/PswGen/CLI/version.h | 4 +-- src/apps/PswGen/GUI/CMakeLists.txt | 3 ++ src/apps/PswGen/GUI/gui.cpp | 12 ++++---- src/apps/PswGen/GUI/gui.h | 2 +- src/apps/PswGen/GUI/version.h | 6 ++-- src/apps/PswGen/Generator/CMakeLists.txt | 4 +++ src/apps/PswGen/Generator/igenerator.h | 7 ++++- src/apps/PswGen/Generator/module.cpp | 8 ++--- src/apps/PswGen/Generator/module.h | 2 +- src/apps/PswGen/Generator/version.h | 6 ++-- src/apps/PswGen/Storage/CMakeLists.txt | 4 +++ src/apps/PswGen/Storage/istorage.h | 7 ++++- src/apps/PswGen/Storage/lib.h | 2 +- src/apps/PswGen/Storage/module.cpp | 8 ++--- src/apps/PswGen/Storage/module.h | 4 +-- src/apps/PswGen/Storage/version.h | 6 ++-- src/apps/ScosTime/CMakeLists.txt | 3 ++ src/apps/ScosTime/gui.cpp | 16 ++++------ src/apps/ScosTime/gui.h | 2 +- src/apps/ScosTime/version.h | 6 ++-- src/libs/Common/CMakeLists.txt | 29 ++++++++++++++---- src/libs/Common/event.cpp | 5 +++- src/libs/Common/event.h | 2 ++ src/libs/Common/inifile.cpp | 14 ++++----- src/libs/Common/inifile_p.h | 10 +++---- src/libs/Common/logger.cpp | 6 ++-- src/libs/Common/registry.cpp | 4 +-- src/libs/Common/registry.h | 4 +-- src/libs/Common/util.cpp | 35 ++++++++++------------ src/libs/Common/util.h | 2 +- src/libs/Common/version.h | 6 ++-- src/libs/Gui/CMakeLists.txt | 3 ++ src/libs/Gui/libgui.h | 2 +- src/libs/Gui/panel.cpp | 2 +- src/libs/Gui/panel.h | 4 +-- src/libs/Gui/version.h | 6 ++-- src/main/CLI/exithandler.cpp | 6 ++-- src/main/CLI/main.cpp | 8 ++--- src/main/GUI/exithandler.cpp | 6 ++-- src/main/GUI/exithandler.h | 2 +- src/main/GUI/fatalerr.cpp | 2 +- src/main/GUI/fatalerr.h | 6 ++-- src/main/GUI/main.cpp | 4 +-- src/main/GUI/main.h | 2 +- src/plugins/LogView/CMakeLists.txt | 4 +++ src/plugins/LogView/factory.cpp | 4 +-- src/plugins/LogView/factory.h | 2 +- src/plugins/LogView/liblogview.h | 2 +- src/plugins/LogView/logview.cpp | 9 ++---- src/plugins/LogView/logview.h | 6 ++-- src/plugins/SdiWindow/CMakeLists.txt | 5 ++++ src/plugins/SdiWindow/factory.cpp | 2 +- src/plugins/SdiWindow/isdiwindow.h | 7 ++++- src/plugins/SdiWindow/libsdiwindow.h | 2 +- src/plugins/SdiWindow/sdiwindow.h | 2 +- src/plugins/SdiWindow/version.h | 2 +- 68 files changed, 245 insertions(+), 186 deletions(-) diff --git a/src/apps/FileFinder/Engine/CMakeLists.txt b/src/apps/FileFinder/Engine/CMakeLists.txt index 310d509..ba802a3 100644 --- a/src/apps/FileFinder/Engine/CMakeLists.txt +++ b/src/apps/FileFinder/Engine/CMakeLists.txt @@ -17,6 +17,9 @@ set(eVaf_LIBRARIES CommonLib PluginsLib) # Source files set(SRCS engine.cpp + engine.h + ifilefinder.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/FileFinder/Engine/engine.cpp b/src/apps/FileFinder/Engine/engine.cpp index bd15220..1cded90 100644 --- a/src/apps/FileFinder/Engine/engine.cpp +++ b/src/apps/FileFinder/Engine/engine.cpp @@ -3,7 +3,7 @@ * @brief Module for the FileFinder application that searches for files * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -79,7 +79,7 @@ void Module::done() Internal::Engine::Engine() : iFileFinder() - , mWorker(0) + , mWorker(nullptr) { setObjectName(QString("%1.Engine").arg(VER_MODULE_NAME_STR)); @@ -108,10 +108,10 @@ bool Internal::Engine::init() void Internal::Engine::done() { - if (mWorker) { + if (mWorker != nullptr) { mWorker->stop(); delete mWorker; - mWorker = 0; + mWorker = nullptr; } EVAF_INFO("%s finalized", qPrintable(objectName())); @@ -119,20 +119,20 @@ void Internal::Engine::done() void Internal::Engine::search(QString const & dir, bool recursive, Filter const & filter) { - if (mWorker) + if (mWorker != nullptr) mWorker->search(dir, recursive, filter); } bool Internal::Engine::busy() const { - if (mWorker) + if (mWorker != nullptr) return mWorker->busy(); return false; } void Internal::Engine::cancel() { - if (mWorker) + if (mWorker != nullptr) mWorker->cancel(); } @@ -194,7 +194,7 @@ QStringList Internal::RegExpChain::split(const QString & pattern) bool e = false; while (offset < sz) { - QChar ch = pattern.at(offset++); + QChar const ch = pattern.at(offset++); if (e) { e = false; if (ch == '*' || ch == '?' || ch == '[' || ch == ']') @@ -328,7 +328,7 @@ void Internal::Worker::recursiveSearch(QString const & path) QDir dir(l); // Get the list of files in this directory - QStringList files = dir.entryList(QDir::Files | QDir::NoSymLinks); + QStringList const files = dir.entryList(QDir::Files | QDir::NoSymLinks); foreach (QString const & file, files) { // Check for the cancel flag @@ -377,7 +377,7 @@ void Internal::Worker::recursiveSearch(QString const & path) * ReadBufferSize bytes of data. Every block is checked twice, but we make sure that * also strings that stretch from one block to another are checked. */ - QByteArray b = f.read(ReadBufferSize); + QByteArray const b = f.read(ReadBufferSize); buf.append(b); if (buf.size() > (2 * ReadBufferSize)) buf.remove(0, ReadBufferSize); @@ -398,7 +398,7 @@ void Internal::Worker::recursiveSearch(QString const & path) // Process sub-directories if (mRecursive) { - QStringList dirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); + QStringList const dirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); foreach (QString const & directory, dirs) { // Check for the cancel flag diff --git a/src/apps/FileFinder/Engine/engine.h b/src/apps/FileFinder/Engine/engine.h index a17d3cc..a6c2370 100644 --- a/src/apps/FileFinder/Engine/engine.h +++ b/src/apps/FileFinder/Engine/engine.h @@ -3,7 +3,7 @@ * @brief Module for the FileFinder application that searches for files * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -181,7 +181,7 @@ class Worker : public QThread public: - Worker(QObject * parent = 0); + Worker(QObject * parent = nullptr); virtual ~Worker(); diff --git a/src/apps/FileFinder/Engine/ifilefinder.h b/src/apps/FileFinder/Engine/ifilefinder.h index 7c0380e..539a95c 100644 --- a/src/apps/FileFinder/Engine/ifilefinder.h +++ b/src/apps/FileFinder/Engine/ifilefinder.h @@ -3,7 +3,7 @@ * @brief Interface for the file finder engine * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/FileFinder/Engine/version.h b/src/apps/FileFinder/Engine/version.h index 510754b..936534c 100644 --- a/src/apps/FileFinder/Engine/version.h +++ b/src/apps/FileFinder/Engine/version.h @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,1,3,3 +#define VER_FILE_VERSION 0,1,3,4 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.3.3\0" +#define VER_FILE_VERSION_STR "0.1.3.4\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/FileFinder/GUI/CMakeLists.txt b/src/apps/FileFinder/GUI/CMakeLists.txt index 3c9d64c..1868826 100644 --- a/src/apps/FileFinder/GUI/CMakeLists.txt +++ b/src/apps/FileFinder/GUI/CMakeLists.txt @@ -13,6 +13,8 @@ set(eVaf_LIBRARIES CommonLib PluginsLib GuiLib) # Source files set(SRCS gui.cpp + gui.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/FileFinder/GUI/gui.cpp b/src/apps/FileFinder/GUI/gui.cpp index 9574df1..b0531af 100644 --- a/src/apps/FileFinder/GUI/gui.cpp +++ b/src/apps/FileFinder/GUI/gui.cpp @@ -3,7 +3,7 @@ * @brief GUI for the FileFinder application * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -78,19 +78,19 @@ int const FileFinder::GUI::Module::MaxHistoryItems = 20; FileFinder::GUI::Module::Module() : Plugins::iPlugin() , mReady(false) - , mFinder(0) - , mOpenFileAction(0) - , mOpenDirectoryAction(0) - , mCopyNameAction(0) - , mCopyAllNamesAction(0) - , wMain(0) - , wDirectory(0) - , wRecursive(0) - , wIncludeNames(0) - , wExcludeNames(0) - , wIncludeContent(0) - , wExcludeContent(0) - , wFind(0) + , mFinder(nullptr) + , mOpenFileAction(nullptr) + , mOpenDirectoryAction(nullptr) + , mCopyNameAction(nullptr) + , mCopyAllNamesAction(nullptr) + , wMain(nullptr) + , wDirectory(nullptr) + , wRecursive(nullptr) + , wIncludeNames(nullptr) + , wExcludeNames(nullptr) + , wIncludeContent(nullptr) + , wExcludeContent(nullptr) + , wFind(nullptr) { setObjectName(QString("%1.Module").arg(VER_MODULE_NAME_STR)); @@ -107,13 +107,13 @@ bool FileFinder::GUI::Module::init(QString const & args) Q_UNUSED(args) // Get the iFileFinder interface - EVAF_TEST_X((mFinder = evafQueryInterface("iFileFinder")), "No iFileFinder interface"); + EVAF_TEST_X((mFinder = evafQueryInterface("iFileFinder")), "No iFileFinder interface") connect(mFinder, SIGNAL(found(QString,QString)), this, SLOT(found(QString,QString))); connect(mFinder, SIGNAL(finished(bool)), this, SLOT(finished(bool))); // Get the main window interface and fill it with widgets SdiWindow::iSdiWindow * win = evafQueryInterface("iSdiWindow"); - EVAF_TEST_X(win, "No iSdiWindow interface"); + EVAF_TEST_X(win, "No iSdiWindow interface") // Create the main widget for this window wMain = new Internal::MainWidget; @@ -140,14 +140,14 @@ void FileFinder::GUI::Module::done() { mReady = false; - mFinder = 0; + mFinder = nullptr; /* * Widgets are deleted by the SdiWindow module. We use wMain to track calls to done() without * proper init(). */ if (wMain) { - wMain = 0; + wMain = nullptr; saveHistory(); } diff --git a/src/apps/FileFinder/GUI/gui.h b/src/apps/FileFinder/GUI/gui.h index 283b167..3b584c3 100644 --- a/src/apps/FileFinder/GUI/gui.h +++ b/src/apps/FileFinder/GUI/gui.h @@ -3,7 +3,7 @@ * @brief GUI for the FileFinder application * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -57,7 +57,7 @@ class MainWidget : public Gui::Panel public: - MainWidget(QWidget * parent = 0) + MainWidget(QWidget * parent = nullptr) : Gui::Panel(parent) {} diff --git a/src/apps/FileFinder/GUI/version.h b/src/apps/FileFinder/GUI/version.h index 248d5e0..6ff25cc 100644 --- a/src/apps/FileFinder/GUI/version.h +++ b/src/apps/FileFinder/GUI/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,1,5,5 +#define VER_FILE_VERSION 0,1,5,6 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.5.5\0" +#define VER_FILE_VERSION_STR "0.1.5.6\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/PswGen/CLI/CMakeLists.txt b/src/apps/PswGen/CLI/CMakeLists.txt index 8629168..8140b4c 100644 --- a/src/apps/PswGen/CLI/CMakeLists.txt +++ b/src/apps/PswGen/CLI/CMakeLists.txt @@ -10,6 +10,9 @@ set(eVaf_LIBRARIES CommonLib PluginsLib) # Source files set(SRCS cli.cpp + cli.h + lib.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/PswGen/CLI/cli.cpp b/src/apps/PswGen/CLI/cli.cpp index 2d2ca1c..b27fa8a 100644 --- a/src/apps/PswGen/CLI/cli.cpp +++ b/src/apps/PswGen/CLI/cli.cpp @@ -3,7 +3,7 @@ * @brief Command line interface for the PswGen application * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -53,8 +53,8 @@ int const Module::DefaultPasswordLength = 16; Module::Module() : Plugins::iPlugin() , mReady(false) - , mGenerator(0) - , mStorage(0) + , mGenerator(nullptr) + , mStorage(nullptr) , mEvReady(0) { setObjectName(QString("%1-Module").arg(VER_MODULE_NAME_STR)); @@ -68,10 +68,10 @@ Module::~Module() bool Module::init(QString const & args) { - Q_UNUSED(args); + Q_UNUSED(args) // Get the iGenerator interface - EVAF_TEST_X((mGenerator = evafQueryInterface("iGenerator")), "No iGenerator interface"); + EVAF_TEST_X((mGenerator = evafQueryInterface("iGenerator")), "No iGenerator interface") // Get the optional iStorage interface mStorage = evafQueryInterface("iStorage"); @@ -80,10 +80,10 @@ bool Module::init(QString const & args) // Get the iEventQueue interface and subscribe to the 'ready' event Common::iEventQueue * eventQueue = evafQueryInterface("iEventQueue"); - EVAF_TEST_X(eventQueue, "No iEventQueue interface"); + EVAF_TEST_X(eventQueue, "No iEventQueue interface") // Subscribe to the 'ready' event - EVAF_TEST_X((mEvReady = eventQueue->subscribeEvent(eventQueue->queryEvent(Common::iApp::EV_READY), this)), "No 'ready' event"); + EVAF_TEST_X((mEvReady = eventQueue->subscribeEvent(eventQueue->queryEvent(Common::iApp::EV_READY), this)), "No 'ready' event") mReady = true; diff --git a/src/apps/PswGen/CLI/cli.h b/src/apps/PswGen/CLI/cli.h index cf53859..7406255 100644 --- a/src/apps/PswGen/CLI/cli.h +++ b/src/apps/PswGen/CLI/cli.h @@ -3,7 +3,7 @@ * @brief Command line interface for the PswGen application * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/PswGen/CLI/version.h b/src/apps/PswGen/CLI/version.h index eb872f5..1618338 100644 --- a/src/apps/PswGen/CLI/version.h +++ b/src/apps/PswGen/CLI/version.h @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,2,1,3 +#define VER_FILE_VERSION 0,2,1,4 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.2.1.3\0" +#define VER_FILE_VERSION_STR "0.2.1.4\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/PswGen/GUI/CMakeLists.txt b/src/apps/PswGen/GUI/CMakeLists.txt index 89e9473..a582bd2 100644 --- a/src/apps/PswGen/GUI/CMakeLists.txt +++ b/src/apps/PswGen/GUI/CMakeLists.txt @@ -10,6 +10,9 @@ set(eVaf_LIBRARIES CommonLib PluginsLib GuiLib) # Source files set(SRCS gui.cpp + gui.h + lib.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/PswGen/GUI/gui.cpp b/src/apps/PswGen/GUI/gui.cpp index 99cd6cb..2a03089 100644 --- a/src/apps/PswGen/GUI/gui.cpp +++ b/src/apps/PswGen/GUI/gui.cpp @@ -3,7 +3,7 @@ * @brief GUI for the PswGen application * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -44,8 +44,8 @@ int const Module::DefaultPasswordLength = 16; Module::Module() : Plugins::iPlugin() , mReady(false) - , mGenerator(NULL) - , mStorage(NULL) + , mGenerator(nullptr) + , mStorage(nullptr) { setObjectName(QString("%1.%2").arg(VER_MODULE_NAME_STR).arg(__FUNCTION__)); @@ -59,10 +59,10 @@ Module::~Module() bool Module::init(QString const & args) { - Q_UNUSED(args); + Q_UNUSED(args) // Get the iGenerator interface - EVAF_TEST_X((mGenerator = evafQueryInterface("iGenerator")), "No iGenerator interface"); + EVAF_TEST_X((mGenerator = evafQueryInterface("iGenerator")), "No iGenerator interface") // Get the iStorage interface (can be null) mStorage = evafQueryInterface("iStorage"); @@ -71,7 +71,7 @@ bool Module::init(QString const & args) // Get the main window interface and fill it with the widgets SdiWindow::iSdiWindow * win = evafQueryInterface("iSdiWindow"); - EVAF_TEST_X(win, "No iSdiWindow interface"); + EVAF_TEST_X(win, "No iSdiWindow interface") Gui::Panel * panel = new Gui::Panel; win->addPanel("PswGen", panel); diff --git a/src/apps/PswGen/GUI/gui.h b/src/apps/PswGen/GUI/gui.h index f4abd24..e672201 100644 --- a/src/apps/PswGen/GUI/gui.h +++ b/src/apps/PswGen/GUI/gui.h @@ -3,7 +3,7 @@ * @brief GUI for the PswGen application * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/PswGen/GUI/version.h b/src/apps/PswGen/GUI/version.h index b9003fd..f8de08f 100644 --- a/src/apps/PswGen/GUI/version.h +++ b/src/apps/PswGen/GUI/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,2,1,7 +#define VER_FILE_VERSION 0,2,1,8 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.2.1.7\0" +#define VER_FILE_VERSION_STR "0.2.1.8\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/PswGen/Generator/CMakeLists.txt b/src/apps/PswGen/Generator/CMakeLists.txt index c4ca65f..4224491 100644 --- a/src/apps/PswGen/Generator/CMakeLists.txt +++ b/src/apps/PswGen/Generator/CMakeLists.txt @@ -12,7 +12,11 @@ set(eVaf_LIBRARIES CommonLib PluginsLib) # Source files set(SRCS + igenerator.h + lib.h module.cpp + module.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/PswGen/Generator/igenerator.h b/src/apps/PswGen/Generator/igenerator.h index 3d1db68..f331049 100644 --- a/src/apps/PswGen/Generator/igenerator.h +++ b/src/apps/PswGen/Generator/igenerator.h @@ -3,7 +3,7 @@ * @brief Interface for password generator modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -41,6 +41,11 @@ struct iGenerator ALPHANUMERIC = 0x01 ///< Generated password contains only alphanumeric characters }; + /** + * Empty virtual destructor + */ + virtual ~iGenerator() {} + /** * Generates a strong password * @param name Name of the password diff --git a/src/apps/PswGen/Generator/module.cpp b/src/apps/PswGen/Generator/module.cpp index bca1954..7921337 100644 --- a/src/apps/PswGen/Generator/module.cpp +++ b/src/apps/PswGen/Generator/module.cpp @@ -3,7 +3,7 @@ * @brief Implementation of the iGenerator interface * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -51,7 +51,7 @@ Module::~Module() bool Module::init(QString const & args) { - Q_UNUSED(args); + Q_UNUSED(args) EVAF_INFO("%s initialized", qPrintable(objectName())); @@ -85,7 +85,7 @@ GeneratorImpl::~GeneratorImpl() QString GeneratorImpl::generatePassword(QString const & name, QString const & masterPassword, int length, uint flags) const { - Q_UNUSED(flags); + Q_UNUSED(flags) QByteArray inputString = QString("%1%2").arg(name).arg(masterPassword).toLatin1(); QCryptographicHash hash(QCryptographicHash::Md5); @@ -97,7 +97,7 @@ QString GeneratorImpl::generatePassword(QString const & name, QString const & ma if (flags & uint(ALPHANUMERIC)) { // Convert all characters to alpha-numeric for (int i = 0; i < result.size(); ++i) { - unsigned char c = result.at(i); + char c = result.at(i); while (isalnum(c) == 0) c++; result[i] = c; diff --git a/src/apps/PswGen/Generator/module.h b/src/apps/PswGen/Generator/module.h index 68cdb4c..99706f4 100644 --- a/src/apps/PswGen/Generator/module.h +++ b/src/apps/PswGen/Generator/module.h @@ -3,7 +3,7 @@ * @brief Implementation of the iGenerator interface * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/PswGen/Generator/version.h b/src/apps/PswGen/Generator/version.h index c2e78d0..f59b0f1 100644 --- a/src/apps/PswGen/Generator/version.h +++ b/src/apps/PswGen/Generator/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,1,2,2 +#define VER_FILE_VERSION 0,1,2,3 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.2.2\0" +#define VER_FILE_VERSION_STR "0.1.2.3\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/PswGen/Storage/CMakeLists.txt b/src/apps/PswGen/Storage/CMakeLists.txt index e3ffd48..8387080 100644 --- a/src/apps/PswGen/Storage/CMakeLists.txt +++ b/src/apps/PswGen/Storage/CMakeLists.txt @@ -12,7 +12,11 @@ set(eVaf_LIBRARIES CommonLib PluginsLib) # Source files set(SRCS + istorage.h + lib.h module.cpp + module.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/PswGen/Storage/istorage.h b/src/apps/PswGen/Storage/istorage.h index e9abef9..add6f7a 100644 --- a/src/apps/PswGen/Storage/istorage.h +++ b/src/apps/PswGen/Storage/istorage.h @@ -3,7 +3,7 @@ * @brief Interface for password storage modules * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -117,6 +117,11 @@ private: struct iStorage { + /** + * Empty virtual destructor + */ + ~iStorage() {} + /** * Saves the data record * @param name Name of the password diff --git a/src/apps/PswGen/Storage/lib.h b/src/apps/PswGen/Storage/lib.h index 2dbfa67..7c63b6c 100644 --- a/src/apps/PswGen/Storage/lib.h +++ b/src/apps/PswGen/Storage/lib.h @@ -2,7 +2,7 @@ * @file PswGen/Storage/lib.h * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/PswGen/Storage/module.cpp b/src/apps/PswGen/Storage/module.cpp index fc75dbb..8e65360 100644 --- a/src/apps/PswGen/Storage/module.cpp +++ b/src/apps/PswGen/Storage/module.cpp @@ -3,7 +3,7 @@ * @brief Implementation of the iStorage interface * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -57,7 +57,7 @@ Module::~Module() bool Module::init(QString const & args) { - Q_UNUSED(args); + Q_UNUSED(args) if (!mStorage->init()) return false; @@ -149,8 +149,8 @@ void StorageImpl::done() bool StorageImpl::save(QString const & name, QExplicitlySharedDataPointer data) { - EVAF_TEST_X(data, "Data cannot be null"); - EVAF_TEST_X(!name.isEmpty(), "Name cannot be empty"); + EVAF_TEST_X(data, "Data cannot be null") + EVAF_TEST_X(!name.isEmpty(), "Name cannot be empty") if (!QSqlDatabase::contains(DbConnectionName)) { diff --git a/src/apps/PswGen/Storage/module.h b/src/apps/PswGen/Storage/module.h index e0839b3..68416f0 100644 --- a/src/apps/PswGen/Storage/module.h +++ b/src/apps/PswGen/Storage/module.h @@ -3,7 +3,7 @@ * @brief Implementation of the iStorage interface * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -113,7 +113,7 @@ public: QAbstractListModel methods */ - virtual int rowCount(QModelIndex const & parent) const { return mData.count(); } + virtual int rowCount(QModelIndex const &) const { return mData.count(); } virtual QVariant data(QModelIndex const & index, int role = Qt::DisplayRole) const; diff --git a/src/apps/PswGen/Storage/version.h b/src/apps/PswGen/Storage/version.h index cbcf67f..b7f03f8 100644 --- a/src/apps/PswGen/Storage/version.h +++ b/src/apps/PswGen/Storage/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,2,1,3 +#define VER_FILE_VERSION 0,2,1,4 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.2.1.3\0" +#define VER_FILE_VERSION_STR "0.2.1.4\0" /** * Module/library name (shall end with \0) diff --git a/src/apps/ScosTime/CMakeLists.txt b/src/apps/ScosTime/CMakeLists.txt index e32c9ef..f193dd6 100644 --- a/src/apps/ScosTime/CMakeLists.txt +++ b/src/apps/ScosTime/CMakeLists.txt @@ -10,6 +10,9 @@ set(eVaf_LIBRARIES CommonLib PluginsLib GuiLib) # Source files set(SRCS gui.cpp + gui.h + lib.h + version.h ) # Header files for the meta-object compiler diff --git a/src/apps/ScosTime/gui.cpp b/src/apps/ScosTime/gui.cpp index 6b4b116..4888288 100644 --- a/src/apps/ScosTime/gui.cpp +++ b/src/apps/ScosTime/gui.cpp @@ -3,7 +3,7 @@ * @brief GUI for the ScosTime application * @author Enar Vaikene * - * Copyright (c) 2012 Enar Vaikene + * Copyright (c) 2012-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -173,7 +173,6 @@ QDateTime Internal::DateTime::strToDateTime(QString const & s, Type type) const dt = dt.addDays(days - 1); return QDateTime(dt, QTime(hours, minutes, secs, msecs), Qt::UTC); - break; } case ISO: { @@ -186,13 +185,12 @@ QDateTime Internal::DateTime::strToDateTime(QString const & s, Type type) const QDateTime dt = QDateTime::fromString(tmp, Qt::ISODate); dt.setTimeSpec(Qt::UTC); return dt; - break; } case CUC: { // Get the CUC coarse and fine values bool ok = false; - int coarse = s.left(8).toLong(&ok, 16); + int const coarse = static_cast(s.left(8).toLong(&ok, 16)); if (!ok) { return QDateTime(); @@ -200,7 +198,7 @@ QDateTime Internal::DateTime::strToDateTime(QString const & s, Type type) const int fine = 0; if (s.size() == 12) { - fine = s.mid(8, 4).toLong(&ok, 16); + fine = static_cast(s.mid(8, 4).toLong(&ok, 16)); if (!ok) { return QDateTime(); @@ -209,10 +207,8 @@ QDateTime Internal::DateTime::strToDateTime(QString const & s, Type type) const // Get the date/time value QDateTime tm = mEpoch.addSecs(coarse); - tm = tm.addMSecs(rint((double(fine) / 58.0 * 885.0) / 1000.0)); + tm = tm.addMSecs(static_cast(rint((double(fine) / 58.0 * 885.0) / 1000.0))); return tm; - - break; } default: { @@ -281,11 +277,11 @@ Module::~Module() bool Module::init(QString const & args) { - Q_UNUSED(args); + Q_UNUSED(args) // Get the main window interface and fill it with the widgets SdiWindow::iSdiWindow * win = evafQueryInterface("iSdiWindow"); - EVAF_TEST_X(win, "No iSdiWindow interface"); + EVAF_TEST_X(win, "No iSdiWindow interface") Gui::Panel * panel = new Gui::Panel; win->addPanel("PswGen", panel); diff --git a/src/apps/ScosTime/gui.h b/src/apps/ScosTime/gui.h index 42516e5..1d7483b 100644 --- a/src/apps/ScosTime/gui.h +++ b/src/apps/ScosTime/gui.h @@ -3,7 +3,7 @@ * @brief GUI for the ScosTime application * @author Enar Vaikene * - * Copyright (c) 2012 Enar Vaikene + * Copyright (c) 2012-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/apps/ScosTime/version.h b/src/apps/ScosTime/version.h index d3a0b51..638afd3 100644 --- a/src/apps/ScosTime/version.h +++ b/src/apps/ScosTime/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2012 Enar Vaikene + * Copyright (c) 2012-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,1,1,1 +#define VER_FILE_VERSION 0,1,1,2 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.1.1.1\0" +#define VER_FILE_VERSION_STR "0.1.1.2\0" /** * Module/library name (shall end with \0) diff --git a/src/libs/Common/CMakeLists.txt b/src/libs/Common/CMakeLists.txt index ce5f10c..c5083a3 100644 --- a/src/libs/Common/CMakeLists.txt +++ b/src/libs/Common/CMakeLists.txt @@ -12,16 +12,35 @@ set(eVaf_LIBRARIES) # Source files set(SRCS - app.cpp - event.cpp + app.h + config.cpp + config.h eventqueue.cpp + eventqueue.h globals.cpp + globals.h + iapp.h + iconfig.h + ieventqueue.h + ilogger.h + inifile.h + iprop.h + iregistry.h + libcommon.h + logger.h + prop.cpp + prop.h + app.cpp + event.h + event.cpp + inifile_p.h + inifile.cpp logger.cpp registry.cpp + registry.h util.cpp - inifile.cpp - config.cpp - prop.cpp + util.h + version.h ) # Header files for the meta-object compiler diff --git a/src/libs/Common/event.cpp b/src/libs/Common/event.cpp index be9f34b..8ebc14f 100644 --- a/src/libs/Common/event.cpp +++ b/src/libs/Common/event.cpp @@ -3,7 +3,7 @@ * @brief Event class implementation * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -22,3 +22,6 @@ using namespace eVaf::Common; QEvent::Type const Event::eVafEvent = QEvent::Type(QEvent::registerEventType()); + +Event::~Event() +{} diff --git a/src/libs/Common/event.h b/src/libs/Common/event.h index 44396c1..0658a6a 100644 --- a/src/libs/Common/event.h +++ b/src/libs/Common/event.h @@ -65,6 +65,8 @@ public: , mData(dataObj) {} + virtual ~Event(); + /** * Returns the event ID value */ diff --git a/src/libs/Common/inifile.cpp b/src/libs/Common/inifile.cpp index 55b9fd7..ebdfd73 100644 --- a/src/libs/Common/inifile.cpp +++ b/src/libs/Common/inifile.cpp @@ -3,7 +3,7 @@ * @brief Internal implementation of the class for reading and writing parameter values in INI files. * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -96,7 +96,7 @@ IniFileImpl::~IniFileImpl() mCache.clear(); } -void IniFileImpl::updateCache(quint64 pos, qint64 diff) +void IniFileImpl::updateCache(qint64 pos, qint64 diff) { // Walk through all the sections in the cache QHash >::const_iterator it; @@ -181,7 +181,7 @@ QExplicitlySharedDataPointer IniFileImpl::getParameter(QFile & fil while (mValid && !file.atEnd()) { // Current file position - quint64 currentPos = file.pos(); + qint64 currentPos = file.pos(); QByteArray line = file.readLine().trimmed(); @@ -352,7 +352,7 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value) if (c.unicode() < 32 || c.unicode() >= 127) valueString = QByteArray("\\0x").append(QByteArray::number(c.unicode(), 16)); else - valueString = QByteArray(1, (char const)c.unicode()); + valueString = QByteArray(1, static_cast(c.unicode())); break; } case QVariant::ByteArray: @@ -399,7 +399,7 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value) } // Current file position - quint64 currentPos = f.pos(); + qint64 currentPos = f.pos(); // Add the new section to the internal cache sectionObject = new IniFileSection(currentPos); @@ -423,8 +423,8 @@ bool IniFileImpl::setValue(QByteArray const & paramName, QVariant const & value) // If the section is found, use the existing section object from the cache else { - quint64 currentPos; - quint64 oldPos = f.pos(); + qint64 currentPos; + qint64 oldPos = f.pos(); QString prefix; // Platform-specific prefix // Locate the parameter value diff --git a/src/libs/Common/inifile_p.h b/src/libs/Common/inifile_p.h index 07ac793..e886bb3 100644 --- a/src/libs/Common/inifile_p.h +++ b/src/libs/Common/inifile_p.h @@ -40,7 +40,7 @@ class IniFileValue : public QSharedData { public: - IniFileValue(quint64 pos) + IniFileValue(qint64 pos) : QSharedData() , filePos(pos) , thisOsOnly(false) @@ -52,7 +52,7 @@ public: * Offset of the parameter in the INI file. By seeking the file to this offset value, * the next character read or written will be the beginning of the key name. */ - quint64 filePos; + qint64 filePos; /** * Key name of the parameter @@ -82,7 +82,7 @@ class IniFileSection : public QSharedData { public: - IniFileSection(quint64 pos) + IniFileSection(qint64 pos) : QSharedData() , filePos(pos) {} @@ -93,7 +93,7 @@ public: * Offset of the section in the INI file. By seeking the file to this offset value, * the next character read or written will be the first character of the section. */ - quint64 filePos; + qint64 filePos; /** * Name of the section @@ -167,7 +167,7 @@ private: /// Methods * Sections and parameters that come after the modified parameter value are shifted and their file * positions changed. This method updates items in the internal cache after changes to the INI file. */ - void updateCache(quint64 pos, qint64 diff); + void updateCache(qint64 pos, qint64 diff); /** * Looks for a section in the INI file diff --git a/src/libs/Common/logger.cpp b/src/libs/Common/logger.cpp index 870af5f..94d9fa9 100644 --- a/src/libs/Common/logger.cpp +++ b/src/libs/Common/logger.cpp @@ -3,7 +3,7 @@ * @brief iLogger interface implementation * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -42,7 +42,7 @@ [[noreturn]] void eVaf::Common::Internal::defFatalMsgHandler(QString const & msg, QString const & source, QString const & where) { - Q_UNUSED(source); + Q_UNUSED(source) fprintf(stderr, "FATAL ERROR: %s (occurred in %s)\n", qPrintable(msg), qPrintable(where)); @@ -443,7 +443,7 @@ QString Logger::printf(char const * const fmt, ...) const va_end(ap); #else ::va_start(ap, fmt); - if (::vasprintf(&str, fmt, ap)) {}; // IF is needed to avoid the compiler warning + if (::vasprintf(&str, fmt, ap)) {} // IF is needed to avoid the compiler warning ::va_end(ap); #endif diff --git a/src/libs/Common/registry.cpp b/src/libs/Common/registry.cpp index 37b47e0..c3bc2be 100644 --- a/src/libs/Common/registry.cpp +++ b/src/libs/Common/registry.cpp @@ -3,7 +3,7 @@ * @brief Common registry implementation * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -65,7 +65,7 @@ bool Registry::registerInterface(QString const & name, QObject * obj) QObject * Registry::queryInterface(QString const & name) const { Interfaces::const_iterator it = mInterfaces.constFind(name); - return it != mInterfaces.constEnd() ? *it : 0; + return it != mInterfaces.constEnd() ? *it : nullptr; } void Registry::interfaceDestroyed(QObject * obj) diff --git a/src/libs/Common/registry.h b/src/libs/Common/registry.h index e8bf68b..3df7d58 100644 --- a/src/libs/Common/registry.h +++ b/src/libs/Common/registry.h @@ -3,7 +3,7 @@ * @brief Common registry implementation * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -66,7 +66,7 @@ private slots: /// Interface object destroyed /// We need to remove the interface from the list of registered interfaces - void interfaceDestroyed(QObject * obj = 0); + void interfaceDestroyed(QObject * obj = nullptr); }; diff --git a/src/libs/Common/util.cpp b/src/libs/Common/util.cpp index 30874eb..3e8a375 100644 --- a/src/libs/Common/util.cpp +++ b/src/libs/Common/util.cpp @@ -3,7 +3,7 @@ * @brief Global utility functions for eVaf * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -33,30 +33,27 @@ QVariant eVaf::Common::toVariant(QString const & value, QVariant const & default switch (defaultValue.type()) { case QVariant::UInt: { bool ok; - uint v = value.toUInt(&ok, 0); + uint const v = value.toUInt(&ok, 0); if (ok) return QVariant(v); else return defaultValue; - break; } case QVariant::Int: { bool ok; - int v = value.toInt(&ok, 0); + int const v = value.toInt(&ok, 0); if (ok) return QVariant(v); else return defaultValue; - break; } case QVariant::Double: { bool ok; - double v = value.toDouble(&ok); + double const v = value.toDouble(&ok); if (ok) return QVariant(v); else return defaultValue; - break; } case QVariant::Bool: { if (eVaf::Common::isTrue(value)) @@ -65,30 +62,29 @@ QVariant eVaf::Common::toVariant(QString const & value, QVariant const & default return QVariant(false); else { bool ok; - uint v = value.toUInt(&ok, 0); + uint const v = value.toUInt(&ok, 0); if (ok) return QVariant(v); else return defaultValue; } - break; } case QVariant::Char: { if (value.size() > 0) { if (value.startsWith("\\0x")) { bool ok; - char c = value.mid(1).toUInt(&ok, 16); + char const c = static_cast(value.mid(1).toUInt(&ok, 16)); if (ok) return QVariant(c); } else if (value.startsWith("\\0")) { bool ok; - char c = value.mid(1).toUInt(&ok, 8); + char const c = static_cast(value.mid(1).toUInt(&ok, 8)); if (ok) return QVariant(c); } else if (value.startsWith('&')) { - QString c = strFromEscapedCharArray(value.toLatin1()); + QString const c = strFromEscapedCharArray(value.toLatin1()); if (c.size() > 0) return QVariant(c.at(0)); } @@ -96,7 +92,6 @@ QVariant eVaf::Common::toVariant(QString const & value, QVariant const & default return QVariant(value.at(0)); } return defaultValue; - break; } default: return QVariant(value); @@ -120,7 +115,7 @@ QByteArray eVaf::Common::strToEscapedCharArray(QString const & str) else if (c == '>') rval.append(">"); else - rval.append((char const)c.unicode()); + rval.append(static_cast(c.unicode())); } return rval; @@ -139,7 +134,7 @@ QString eVaf::Common::strFromEscapedCharArray(QByteArray const & str) ref = "&"; } else - rval.append(QChar((ushort)c)); + rval.append(QChar(static_cast(c))); } else { ref.append(c); @@ -150,7 +145,7 @@ QString eVaf::Common::strFromEscapedCharArray(QByteArray const & str) if (ref.startsWith("&#x")) { // Numeric character reference in the HEX format bool ok; - ushort ucode = ref.mid(3, ref.size() - 4).toUInt(&ok, 16); + ushort const ucode = static_cast(ref.mid(3, ref.size() - 4).toUInt(&ok, 16)); if (ok) rval.append(QChar(ucode)); else @@ -160,7 +155,7 @@ QString eVaf::Common::strFromEscapedCharArray(QByteArray const & str) else if (ref.startsWith("&#")) { // Numeric character reference in the DEC format bool ok; - ushort ucode = ref.mid(2, ref.size() - 3).toUInt(&ok, 10); + ushort const ucode = static_cast(ref.mid(2, ref.size() - 3).toUInt(&ok, 10)); if (ok) rval.append(QChar(ucode)); else @@ -190,7 +185,7 @@ QString eVaf::Common::strFromEscapedCharArray(QByteArray const & str) QByteArray eVaf::Common::binToEscapedCharArray(QByteArray const & src) { QByteArray rval; - foreach (uchar c, src) { + foreach (char const c, src) { if (c < 32 || c >= 127) rval.append("&#x" + QByteArray::number(c, 16) + ";"); else if (c == '\"') @@ -234,7 +229,7 @@ QByteArray eVaf::Common::binFromEscapedCharArray(QByteArray const & str) if (ref.startsWith("&#x")) { // Numeric character reference in the HEX format bool ok; - uchar ucode = ref.mid(3, ref.size() - 4).toUInt(&ok, 16); + char const ucode = static_cast(ref.mid(3, ref.size() - 4).toUInt(&ok, 16)); if (ok) rval.append(ucode); else @@ -244,7 +239,7 @@ QByteArray eVaf::Common::binFromEscapedCharArray(QByteArray const & str) else if (ref.startsWith("&#")) { // Numeric character reference in the DEC format bool ok; - uchar ucode = ref.mid(2, ref.size() - 3).toUInt(&ok, 10); + char const ucode = static_cast(ref.mid(2, ref.size() - 3).toUInt(&ok, 10)); if (ok) rval.append(ucode); else diff --git a/src/libs/Common/util.h b/src/libs/Common/util.h index 486da25..62a2e99 100644 --- a/src/libs/Common/util.h +++ b/src/libs/Common/util.h @@ -3,7 +3,7 @@ * @brief Global utility functions for eVaf * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/libs/Common/version.h b/src/libs/Common/version.h index dbc0b89..87c1266 100644 --- a/src/libs/Common/version.h +++ b/src/libs/Common/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011-2012 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,2,4,13 +#define VER_FILE_VERSION 0,2,4,15 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.2.4.13\0" +#define VER_FILE_VERSION_STR "0.2.4.15\0" /** * Module/library name (shall end with \0) diff --git a/src/libs/Gui/CMakeLists.txt b/src/libs/Gui/CMakeLists.txt index eea9014..e973a0a 100644 --- a/src/libs/Gui/CMakeLists.txt +++ b/src/libs/Gui/CMakeLists.txt @@ -12,7 +12,10 @@ set(eVaf_LIBRARIES) # Source files set(SRCS + libgui.h panel.cpp + panel.h + version.h ) # Header files for the meta-object compiler diff --git a/src/libs/Gui/libgui.h b/src/libs/Gui/libgui.h index b67d9be..fb4d7fa 100644 --- a/src/libs/Gui/libgui.h +++ b/src/libs/Gui/libgui.h @@ -2,7 +2,7 @@ * @file Gui/libgui.h * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/libs/Gui/panel.cpp b/src/libs/Gui/panel.cpp index f552789..28c6292 100644 --- a/src/libs/Gui/panel.cpp +++ b/src/libs/Gui/panel.cpp @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/libs/Gui/panel.h b/src/libs/Gui/panel.h index 3ac0b57..0b2d9a3 100644 --- a/src/libs/Gui/panel.h +++ b/src/libs/Gui/panel.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -52,7 +52,7 @@ class GUI_EXPORT Panel : public QWidget public: - Panel(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + Panel(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); virtual ~Panel(); diff --git a/src/libs/Gui/version.h b/src/libs/Gui/version.h index dc36c0a..3db1f93 100644 --- a/src/libs/Gui/version.h +++ b/src/libs/Gui/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -25,12 +25,12 @@ /** * Module/library version number in the form major,minor,release,build */ -#define VER_FILE_VERSION 0,2,1,3 +#define VER_FILE_VERSION 0,2,1,4 /** * Module/library version number in the string format (shall end with \0) */ -#define VER_FILE_VERSION_STR "0.2.1.3\0" +#define VER_FILE_VERSION_STR "0.2.1.4\0" /** * Module/library name (shall end with \0) diff --git a/src/main/CLI/exithandler.cpp b/src/main/CLI/exithandler.cpp index dac8008..0961ce5 100644 --- a/src/main/CLI/exithandler.cpp +++ b/src/main/CLI/exithandler.cpp @@ -3,7 +3,7 @@ * @brief Exit handlers for the eVaf main executable * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -115,11 +115,11 @@ bool eVaf::CLI::Internal::installExitHandler() struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = signalHandler; - if (sigaction(SIGTERM, &sa, NULL) != 0) { + if (sigaction(SIGTERM, &sa, nullptr) != 0) { EVAF_FATAL_ERROR("sigaction() failed: %m"); return false; } - if (sigaction(SIGHUP, &sa, NULL) != 0) { + if (sigaction(SIGHUP, &sa, nullptr) != 0) { EVAF_FATAL_ERROR("sigaction() failed: %m"); return false; } diff --git a/src/main/CLI/main.cpp b/src/main/CLI/main.cpp index 0be3f36..908619f 100644 --- a/src/main/CLI/main.cpp +++ b/src/main/CLI/main.cpp @@ -2,7 +2,7 @@ * @file main/CLI/main.cpp * @brief The main eVaf CLI application class * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -94,9 +94,9 @@ static void messageOutput(QtMsgType type, QMessageLogContext const &, QString co */ [[noreturn]] static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where) { - Q_UNUSED(msg); - Q_UNUSED(source); - Q_UNUSED(where); + Q_UNUSED(msg) + Q_UNUSED(source) + Q_UNUSED(where) exit(1); } diff --git a/src/main/GUI/exithandler.cpp b/src/main/GUI/exithandler.cpp index 80c364c..0dc97ef 100644 --- a/src/main/GUI/exithandler.cpp +++ b/src/main/GUI/exithandler.cpp @@ -3,7 +3,7 @@ * @brief Exit handlers for the eVaf main executable * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -115,11 +115,11 @@ bool eVaf::GUI::Internal::installExitHandler() struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = signalHandler; - if (sigaction(SIGTERM, &sa, NULL) != 0) { + if (sigaction(SIGTERM, &sa, nullptr) != 0) { EVAF_FATAL_ERROR("sigaction() failed: %m"); return false; } - if (sigaction(SIGHUP, &sa, NULL) != 0) { + if (sigaction(SIGHUP, &sa, nullptr) != 0) { EVAF_FATAL_ERROR("sigaction() failed: %m"); return false; } diff --git a/src/main/GUI/exithandler.h b/src/main/GUI/exithandler.h index e1ccd41..8230bc3 100644 --- a/src/main/GUI/exithandler.h +++ b/src/main/GUI/exithandler.h @@ -3,7 +3,7 @@ * @brief Exit handlers for the eVaf main executable * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/main/GUI/fatalerr.cpp b/src/main/GUI/fatalerr.cpp index 24e6a59..4d1875e 100644 --- a/src/main/GUI/fatalerr.cpp +++ b/src/main/GUI/fatalerr.cpp @@ -3,7 +3,7 @@ * @brief Fatal error message dialog box * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/main/GUI/fatalerr.h b/src/main/GUI/fatalerr.h index d10b1d7..7f1a088 100644 --- a/src/main/GUI/fatalerr.h +++ b/src/main/GUI/fatalerr.h @@ -3,7 +3,7 @@ * @brief Fatal error message dialog box * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -53,7 +53,7 @@ public: * @param text Text shown on the dialog box * @param parent Optional parent widget */ - FatalErr(QString const & title, QString const & text, QWidget * parent = 0); + FatalErr(QString const & title, QString const & text, QWidget * parent = nullptr); /** * Shows a fatal error message dialog box @@ -62,7 +62,7 @@ public: * @param parent Optional parent widget * @return The result code */ - static int message(QString const & title, QString const & text, QWidget * parent = 0); + static int message(QString const & title, QString const & text, QWidget * parent = nullptr); protected: diff --git a/src/main/GUI/main.cpp b/src/main/GUI/main.cpp index cffe9ba..806617b 100644 --- a/src/main/GUI/main.cpp +++ b/src/main/GUI/main.cpp @@ -3,7 +3,7 @@ * @brief The main eVaf GUI application class * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -127,7 +127,7 @@ static void messageOutput(QtMsgType type, QMessageLogContext const &, QString co */ static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where) { - Q_UNUSED(source); + Q_UNUSED(source) // Show the message on the screen if (BeVerbose) { diff --git a/src/main/GUI/main.h b/src/main/GUI/main.h index 2c51846..08057e5 100644 --- a/src/main/GUI/main.h +++ b/src/main/GUI/main.h @@ -3,7 +3,7 @@ * @brief The main eVaf GUI application class * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/plugins/LogView/CMakeLists.txt b/src/plugins/LogView/CMakeLists.txt index 1d4b839..37700d7 100644 --- a/src/plugins/LogView/CMakeLists.txt +++ b/src/plugins/LogView/CMakeLists.txt @@ -13,7 +13,11 @@ set(eVaf_LIBRARIES CommonLib PluginsLib GuiLib) # Source files set(SRCS factory.cpp + factory.h + liblogview.h logview.cpp + logview.h + version.h ) # Header files for the meta-object compiler diff --git a/src/plugins/LogView/factory.cpp b/src/plugins/LogView/factory.cpp index 27372fd..aec63ae 100644 --- a/src/plugins/LogView/factory.cpp +++ b/src/plugins/LogView/factory.cpp @@ -3,7 +3,7 @@ * @brief LogView module's factory class * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -50,7 +50,7 @@ Factory::~Factory() QObject * Factory::create(QString const & name) { - Q_UNUSED(name); + Q_UNUSED(name) if (mPlugin == nullptr) mPlugin = new Internal::Module; diff --git a/src/plugins/LogView/factory.h b/src/plugins/LogView/factory.h index bdf3962..fd27c33 100644 --- a/src/plugins/LogView/factory.h +++ b/src/plugins/LogView/factory.h @@ -3,7 +3,7 @@ * @brief LogView module's factory class * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/plugins/LogView/liblogview.h b/src/plugins/LogView/liblogview.h index 1f88060..8a8b09d 100644 --- a/src/plugins/LogView/liblogview.h +++ b/src/plugins/LogView/liblogview.h @@ -2,7 +2,7 @@ * @file LogView/liblogview.h * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/plugins/LogView/logview.cpp b/src/plugins/LogView/logview.cpp index 75e973e..1bd41a1 100644 --- a/src/plugins/LogView/logview.cpp +++ b/src/plugins/LogView/logview.cpp @@ -3,7 +3,7 @@ * @brief Implementation of the LogView module * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -62,7 +62,6 @@ QVariant Model::data(QModelIndex const & index, int role) const // Return the message for the display role case Qt::DisplayRole: { return mData.at(index.row()).simplified; - break; } // Change color for different message types @@ -71,18 +70,14 @@ QVariant Model::data(QModelIndex const & index, int role) const switch (s) { case Common::iLogger::Info: return QBrush(QColor(Qt::blue)); - break; case Common::iLogger::Warning: return QBrush(QColor(Qt::black)); - break; case Common::iLogger::Error: case Common::iLogger::Fatal: return QBrush(QColor(Qt::red)); - break; default: return QVariant(); } - break; } } // switch (role) @@ -158,7 +153,7 @@ bool Model::saveToFile(QString const & fileName) return true; } -char const * const Model::severityText(Common::iLogger::Severity s) const +char const * Model::severityText(Common::iLogger::Severity s) const { if (s >= Common::iLogger::None && s < Common::iLogger::Count) return SeverityText[s]; diff --git a/src/plugins/LogView/logview.h b/src/plugins/LogView/logview.h index e652f61..228a689 100644 --- a/src/plugins/LogView/logview.h +++ b/src/plugins/LogView/logview.h @@ -3,7 +3,7 @@ * @brief Implementation of the LogView module * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -120,7 +120,7 @@ private: // Members private: // Methods - inline char const * const severityText(Common::iLogger::Severity s) const; + inline char const * severityText(Common::iLogger::Severity s) const; }; @@ -178,7 +178,7 @@ class Window : public Gui::Panel public: - Window(QString const & args, QWidget * parent = nullptr, Qt::WindowFlags flags = 0); + Window(QString const & args, QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~Window(); diff --git a/src/plugins/SdiWindow/CMakeLists.txt b/src/plugins/SdiWindow/CMakeLists.txt index 75f9ce7..9d20998 100644 --- a/src/plugins/SdiWindow/CMakeLists.txt +++ b/src/plugins/SdiWindow/CMakeLists.txt @@ -13,7 +13,12 @@ set(eVaf_LIBRARIES CommonLib PluginsLib GuiLib) # Source files set(SRCS factory.cpp + factory.h + isdiwindow.h + libsdiwindow.h sdiwindow.cpp + sdiwindow.h + version.h ) # Header files for the meta-object compiler diff --git a/src/plugins/SdiWindow/factory.cpp b/src/plugins/SdiWindow/factory.cpp index 24aa0e5..6d5621b 100644 --- a/src/plugins/SdiWindow/factory.cpp +++ b/src/plugins/SdiWindow/factory.cpp @@ -48,7 +48,7 @@ Factory::~Factory() QObject * Factory::create(QString const & name) { - Q_UNUSED(name); + Q_UNUSED(name) if (!mPlugin) mPlugin.reset(new Internal::SdiWindowPlugin); diff --git a/src/plugins/SdiWindow/isdiwindow.h b/src/plugins/SdiWindow/isdiwindow.h index 4e0e43d..825961e 100644 --- a/src/plugins/SdiWindow/isdiwindow.h +++ b/src/plugins/SdiWindow/isdiwindow.h @@ -3,7 +3,7 @@ * @brief eVaf SDI window interface * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * @@ -53,6 +53,11 @@ struct SDIWINDOW_EXPORT iSdiWindow */ static iSdiWindow * instance(); + /** + * Empty virtual destructor + */ + virtual ~iSdiWindow() {} + /** * Adds a panel to the SDI window manager * @param name Name of the panel diff --git a/src/plugins/SdiWindow/libsdiwindow.h b/src/plugins/SdiWindow/libsdiwindow.h index 8608fdd..2bee518 100644 --- a/src/plugins/SdiWindow/libsdiwindow.h +++ b/src/plugins/SdiWindow/libsdiwindow.h @@ -2,7 +2,7 @@ * @file SdiWindow/libsdiwindow.h * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * diff --git a/src/plugins/SdiWindow/sdiwindow.h b/src/plugins/SdiWindow/sdiwindow.h index 40c7211..08bfcd9 100644 --- a/src/plugins/SdiWindow/sdiwindow.h +++ b/src/plugins/SdiWindow/sdiwindow.h @@ -49,7 +49,7 @@ class MainWindow : public QWidget, public iSdiWindow public: - MainWindow(QWidget * parent = nullptr, Qt::WindowFlags flags = 0); + MainWindow(QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~MainWindow(); diff --git a/src/plugins/SdiWindow/version.h b/src/plugins/SdiWindow/version.h index c47549d..cbcc292 100644 --- a/src/plugins/SdiWindow/version.h +++ b/src/plugins/SdiWindow/version.h @@ -3,7 +3,7 @@ * @brief Version information for eVaf modules * @author Enar Vaikene * - * Copyright (c) 2011 Enar Vaikene + * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * -- 2.44.0