# Source files
set(SRCS
engine.cpp
+ engine.h
+ ifilefinder.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
Internal::Engine::Engine()
: iFileFinder()
- , mWorker(0)
+ , mWorker(nullptr)
{
setObjectName(QString("%1.Engine").arg(VER_MODULE_NAME_STR));
void Internal::Engine::done()
{
- if (mWorker) {
+ if (mWorker != nullptr) {
mWorker->stop();
delete mWorker;
- mWorker = 0;
+ mWorker = nullptr;
}
EVAF_INFO("%s finalized", qPrintable(objectName()));
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();
}
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 == ']')
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
* 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);
// 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
* @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.
*
public:
- Worker(QObject * parent = 0);
+ Worker(QObject * parent = nullptr);
virtual ~Worker();
* @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.
*
/**
* 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)
# Source files
set(SRCS
gui.cpp
+ gui.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
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));
Q_UNUSED(args)
// Get the iFileFinder interface
- EVAF_TEST_X((mFinder = evafQueryInterface<FileFinder::iFileFinder>("iFileFinder")), "No iFileFinder interface");
+ EVAF_TEST_X((mFinder = evafQueryInterface<FileFinder::iFileFinder>("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<SdiWindow::iSdiWindow>("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;
{
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();
}
* @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.
*
public:
- MainWidget(QWidget * parent = 0)
+ MainWidget(QWidget * parent = nullptr)
: Gui::Panel(parent)
{}
* @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.
*
/**
* 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)
# Source files
set(SRCS
cli.cpp
+ cli.h
+ lib.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
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));
bool Module::init(QString const & args)
{
- Q_UNUSED(args);
+ Q_UNUSED(args)
// Get the iGenerator interface
- EVAF_TEST_X((mGenerator = evafQueryInterface<PswGen::iGenerator>("iGenerator")), "No iGenerator interface");
+ EVAF_TEST_X((mGenerator = evafQueryInterface<PswGen::iGenerator>("iGenerator")), "No iGenerator interface")
// Get the optional iStorage interface
mStorage = evafQueryInterface<PswGen::iStorage>("iStorage");
// Get the iEventQueue interface and subscribe to the 'ready' event
Common::iEventQueue * eventQueue = evafQueryInterface<Common::iEventQueue>("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;
* @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.
*
/**
* 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)
# Source files
set(SRCS
gui.cpp
+ gui.h
+ lib.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
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__));
bool Module::init(QString const & args)
{
- Q_UNUSED(args);
+ Q_UNUSED(args)
// Get the iGenerator interface
- EVAF_TEST_X((mGenerator = evafQueryInterface<PswGen::iGenerator>("iGenerator")), "No iGenerator interface");
+ EVAF_TEST_X((mGenerator = evafQueryInterface<PswGen::iGenerator>("iGenerator")), "No iGenerator interface")
// Get the iStorage interface (can be null)
mStorage = evafQueryInterface<PswGen::iStorage>("iStorage");
// Get the main window interface and fill it with the widgets
SdiWindow::iSdiWindow * win = evafQueryInterface<SdiWindow::iSdiWindow>("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);
* @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.
*
* @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.
*
/**
* 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)
# Source files
set(SRCS
+ igenerator.h
+ lib.h
module.cpp
+ module.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
ALPHANUMERIC = 0x01 ///< Generated password contains only alphanumeric characters
};
+ /**
+ * Empty virtual destructor
+ */
+ virtual ~iGenerator() {}
+
/**
* Generates a strong password
* @param name Name of the password
* @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.
*
bool Module::init(QString const & args)
{
- Q_UNUSED(args);
+ Q_UNUSED(args)
EVAF_INFO("%s initialized", qPrintable(objectName()));
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);
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;
* @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.
*
* @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.
*
/**
* 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)
# Source files
set(SRCS
+ istorage.h
+ lib.h
module.cpp
+ module.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
struct iStorage
{
+ /**
+ * Empty virtual destructor
+ */
+ ~iStorage() {}
+
/**
* Saves the data record
* @param name Name of the password
* @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.
*
* @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.
*
bool Module::init(QString const & args)
{
- Q_UNUSED(args);
+ Q_UNUSED(args)
if (!mStorage->init())
return false;
bool StorageImpl::save(QString const & name, QExplicitlySharedDataPointer<Storage::Data> 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))
{
* @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.
*
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;
* @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.
*
/**
* 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)
# Source files
set(SRCS
gui.cpp
+ gui.h
+ lib.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
dt = dt.addDays(days - 1);
return QDateTime(dt, QTime(hours, minutes, secs, msecs), Qt::UTC);
- break;
}
case ISO:
{
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<int>(s.left(8).toLong(&ok, 16));
if (!ok)
{
return QDateTime();
int fine = 0;
if (s.size() == 12)
{
- fine = s.mid(8, 4).toLong(&ok, 16);
+ fine = static_cast<int>(s.mid(8, 4).toLong(&ok, 16));
if (!ok)
{
return QDateTime();
// 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<int>(rint((double(fine) / 58.0 * 885.0) / 1000.0)));
return tm;
-
- break;
}
default:
{
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<SdiWindow::iSdiWindow>("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);
* @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.
*
* @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.
*
/**
* 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)
# 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
* @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.
*
using namespace eVaf::Common;
QEvent::Type const Event::eVafEvent = QEvent::Type(QEvent::registerEventType());
+
+Event::~Event()
+{}
, mData(dataObj)
{}
+ virtual ~Event();
+
/**
* Returns the event ID value
*/
* @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.
*
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<QByteArray, QExplicitlySharedDataPointer<IniFileSection> >::const_iterator it;
while (mValid && !file.atEnd()) {
// Current file position
- quint64 currentPos = file.pos();
+ qint64 currentPos = file.pos();
QByteArray line = file.readLine().trimmed();
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<char const>(c.unicode()));
break;
}
case QVariant::ByteArray:
}
// Current file position
- quint64 currentPos = f.pos();
+ qint64 currentPos = f.pos();
// Add the new section to the internal cache
sectionObject = new IniFileSection(currentPos);
// 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
{
public:
- IniFileValue(quint64 pos)
+ IniFileValue(qint64 pos)
: QSharedData()
, filePos(pos)
, thisOsOnly(false)
* 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
{
public:
- IniFileSection(quint64 pos)
+ IniFileSection(qint64 pos)
: QSharedData()
, filePos(pos)
{}
* 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
* 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
* @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.
*
[[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));
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
* @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.
*
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)
* @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.
*
/// 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);
};
* @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.
*
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))
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<char>(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<char>(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));
}
return QVariant(value.at(0));
}
return defaultValue;
- break;
}
default:
return QVariant(value);
else if (c == '>')
rval.append(">");
else
- rval.append((char const)c.unicode());
+ rval.append(static_cast<char const>(c.unicode()));
}
return rval;
ref = "&";
}
else
- rval.append(QChar((ushort)c));
+ rval.append(QChar(static_cast<ushort>(c)));
}
else {
ref.append(c);
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<ushort>(ref.mid(3, ref.size() - 4).toUInt(&ok, 16));
if (ok)
rval.append(QChar(ucode));
else
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<ushort>(ref.mid(2, ref.size() - 3).toUInt(&ok, 10));
if (ok)
rval.append(QChar(ucode));
else
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 == '\"')
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<char>(ref.mid(3, ref.size() - 4).toUInt(&ok, 16));
if (ok)
rval.append(ucode);
else
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<char>(ref.mid(2, ref.size() - 3).toUInt(&ok, 10));
if (ok)
rval.append(ucode);
else
* @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.
*
* @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.
*
/**
* 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)
# Source files
set(SRCS
+ libgui.h
panel.cpp
+ panel.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
* @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.
*
* @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.
*
public:
- Panel(QWidget * parent = nullptr, Qt::WindowFlags f = 0);
+ Panel(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
virtual ~Panel();
* @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.
*
/**
* 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)
* @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.
*
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;
}
* @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.
*
*/
[[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);
}
* @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.
*
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;
}
* @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.
*
* @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.
*
* @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.
*
* @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
* @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:
* @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.
*
*/
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) {
* @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.
*
# Source files
set(SRCS
factory.cpp
+ factory.h
+ liblogview.h
logview.cpp
+ logview.h
+ version.h
)
# Header files for the meta-object compiler
* @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.
*
QObject * Factory::create(QString const & name)
{
- Q_UNUSED(name);
+ Q_UNUSED(name)
if (mPlugin == nullptr)
mPlugin = new Internal::Module;
* @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.
*
* @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.
*
* @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.
*
// Return the message for the display role
case Qt::DisplayRole: {
return mData.at(index.row()).simplified;
- break;
}
// Change color for different message types
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)
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];
* @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.
*
private: // Methods
- inline char const * const severityText(Common::iLogger::Severity s) const;
+ inline char const * severityText(Common::iLogger::Severity s) const;
};
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();
# 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
QObject * Factory::create(QString const & name)
{
- Q_UNUSED(name);
+ Q_UNUSED(name)
if (!mPlugin)
mPlugin.reset(new Internal::SdiWindowPlugin);
* @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.
*
*/
static iSdiWindow * instance();
+ /**
+ * Empty virtual destructor
+ */
+ virtual ~iSdiWindow() {}
+
/**
* Adds a panel to the SDI window manager
* @param name Name of the panel
* @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.
*
public:
- MainWindow(QWidget * parent = nullptr, Qt::WindowFlags flags = 0);
+ MainWindow(QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
virtual ~MainWindow();
* @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.
*