Skip to content

File confighandler.cpp#

FileList > src > utils > confighandler.cpp

Go to the source code of this file.

  • #include "confighandler.h"
  • #include "abstractlogger.h"
  • #include "src/tools/capturetool.h"
  • #include "valuehandler.h"
  • #include <QCoreApplication>
  • #include <QDebug>
  • #include <QDir>
  • #include <QFile>
  • #include <QFileSystemWatcher>
  • #include <QKeySequence>
  • #include <QMap>
  • #include <QSharedPointer>
  • #include <QStandardPaths>
  • #include <QVector>
  • #include <algorithm>
  • #include <stdexcept>

Public Static Attributes#

Type Name
QMap< class QString, QSharedPointer< ValueHandler > > recognizedGeneralOptions
QMap< QString, QSharedPointer< KeySequence > > recognizedShortcuts

Public Functions#

Type Name
bool verifyLaunchFile ()

Macros#

Type Name
define OPTION (KEY, TYPE)
define SHORTCUT (NAME, DEFAULT_VALUE)

Public Static Attributes Documentation#

variable recognizedGeneralOptions#

QMap<class QString, QSharedPointer<ValueHandler> > recognizedGeneralOptions;

This map contains all the information that is needed to parse, verify and preprocess each configuration option in the General section. NOTE: Please keep it well structured

variable recognizedShortcuts#

QMap<QString, QSharedPointer<KeySequence> > recognizedShortcuts;

Public Functions Documentation#

function verifyLaunchFile#

bool verifyLaunchFile () 

Macro Definition Documentation#

define OPTION#

#define OPTION (
    KEY,
    TYPE
) {                                                                          \
        QStringLiteral(KEY), QSharedPointer < ValueHandler >(new TYPE)            \
    }

Use this to declare a setting with a type that is either unrecognized by QVariant or if you need to place additional constraints on its value.

Parameters:

  • KEY Name of the setting as in the config file (a C-style string literal)
  • TYPE An instance of a ValueHandler derivative. This must be specified in the form of a constructor, or the macro will misbehave.

define SHORTCUT#

#define SHORTCUT (
    NAME,
    DEFAULT_VALUE
) {                                                                          \
        QStringLiteral(NAME), QSharedPointer < KeySequence >(new KeySequence (     \
                                QKeySequence(QLatin1String(DEFAULT_VALUE))))   \
    }