ソースを参照

More renaming

Renaming and harmonizing class and file names
Felix Turo 2 年 前
コミット
ae84639a92

+ 5 - 7
CMakeLists.txt

@@ -85,8 +85,8 @@ set(PROJECT_SOURCES
     src/classes/downloadhelper.cpp
     src/classes/runguard.h
     src/classes/runguard.cpp
-    src/classes/asettings.h
-    src/classes/asettings.cpp
+    src/classes/settings.h
+    src/classes/settings.cpp
     src/classes/translator.h
     src/classes/translator.cpp
     src/classes/jsonhelper.h
@@ -97,15 +97,13 @@ set(PROJECT_SOURCES
     # Namespaces
     src/functions/calc.h
     src/functions/calc.cpp
-    src/functions/adatetime.h
     src/functions/log.h
     src/functions/log.cpp
-    src/functions/areadcsv.h
-    src/functions/areadcsv.cpp
+    src/functions/readcsv.h
     src/functions/statistics.h
     src/functions/statistics.cpp
-    src/functions/adate.h
-    src/functions/adate.cpp
+    src/functions/datetime.h
+    src/functions/datetime.cpp
     src/functions/time.h
 
     # Database

+ 0 - 0
src/functions/adatetime.h → deprecated/adatetime.h


+ 5 - 5
main.cpp

@@ -20,8 +20,8 @@
 #include "src/functions/log.h"
 #include "src/gui/dialogues/firstrundialog.h"
 #include "src/classes/runguard.h"
-#include "src/classes/asettings.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
+#include "src/classes/settings.h"
 #include "src/classes/style.h"
 #include "src/functions/log.h"
 #include "src/classes/paths.h"
@@ -57,7 +57,7 @@ void init()
         LOG << "Unable to initalise logging.";
     }
     LOG << "Reading Settings...";
-    ASettings::setup();
+    Settings::setup();
     LOG << "Setting up application style...";
     OPL::Style::setup();
     // Translations to be done at a later stage
@@ -71,7 +71,7 @@ bool firstRun()
         LOG << "Initial setup incomplete or unsuccessfull.";
         return false;
     }
-    ASettings::write(ASettings::Main::SetupComplete, true);
+    Settings::write(Settings::Main::SetupComplete, true);
     LOG << "Initial Setup Completed successfully";
     return true;
 }
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
     Main::init();
 
     // Check for First Run and launch Setup Wizard
-    if (!ASettings::read(ASettings::Main::SetupComplete).toBool())
+    if (!Settings::read(Settings::Main::SetupComplete).toBool())
         if(!Main::firstRun())
             return 0;
 

+ 1 - 1
mainwindow.cpp

@@ -249,7 +249,7 @@ void MainWindow::onDatabaseInvalid()
             LOG << "Initial setup incomplete or unsuccessfull.";
             on_actionQuit_triggered();
         }
-        ASettings::write(ASettings::Main::SetupComplete, true);
+        Settings::write(Settings::Main::SetupComplete, true);
         LOG << "Initial Setup Completed successfully";
     }
 }

+ 19 - 19
src/classes/asettings.cpp → src/classes/settings.cpp

@@ -15,11 +15,11 @@
  *You should have received a copy of the GNU General Public License
  *along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
-#include "asettings.h"
+#include "settings.h"
 #include <QSettings>
 
 
-QMap<ASettings::Main, QString> ASettings::mainMap = {
+QMap<Settings::Main, QString> Settings::mainMap = {
     {Main::SetupComplete,               QStringLiteral("setupComplete")},
     {Main::Style,                       QStringLiteral("style")},
     {Main::Font,                        QStringLiteral("font")},
@@ -29,7 +29,7 @@ QMap<ASettings::Main, QString> ASettings::mainMap = {
     {Main::DateFormat,                  QStringLiteral("dateFormat")},
 };
 
-QMap<ASettings::UserData, QString> ASettings::userDataMap = {
+QMap<Settings::UserData, QString> Settings::userDataMap = {
     {UserData::DisplaySelfAs,           QStringLiteral("displayselfas")},
     {UserData::TailSortColumn,          QStringLiteral("tailSortColumn")},
     {UserData::PilotSortColumn,         QStringLiteral("pilotSortColumn")},
@@ -46,7 +46,7 @@ QMap<ASettings::UserData, QString> ASettings::userDataMap = {
     {UserData::Custom2CurrencyName,     QStringLiteral("custom2CurrencyName")},
 };
 
-QMap<ASettings::FlightLogging, QString> ASettings::flightLoggingMap = {
+QMap<Settings::FlightLogging, QString> Settings::flightLoggingMap = {
     {FlightLogging::Function,           QStringLiteral("function")},
     {FlightLogging::Approach,           QStringLiteral("approach")},
     {FlightLogging::NightLoggingEnabled,QStringLiteral("nightLoggingEnabled")},
@@ -57,16 +57,16 @@ QMap<ASettings::FlightLogging, QString> ASettings::flightLoggingMap = {
     //{FlightLogging::FlightTimeFormat,   QStringLiteral("flightTimeFormat")},
 };
 
-void ASettings::setup()
+void Settings::setup()
 {
     QSettings::setDefaultFormat(QSettings::IniFormat);
     QSettings();
 }
 
 /*!
- * \brief ASettings::resetToDefaults (Re-)sets all settings to the default value
+ * \brief Settings::resetToDefaults (Re-)sets all settings to the default value
  */
-void ASettings::resetToDefaults()
+void Settings::resetToDefaults()
 {
     write(Main::Style, QStringLiteral("Fusion"));
     write(Main::UseSystemFont, true);
@@ -92,44 +92,44 @@ void ASettings::resetToDefaults()
 // Read/Write
 //
 
-QVariant ASettings::read(const FlightLogging key)
+QVariant Settings::read(const FlightLogging key)
 { return QSettings().value(groupOfKey(key)); }
 
-void ASettings::write(const FlightLogging key, const QVariant &val)
+void Settings::write(const FlightLogging key, const QVariant &val)
 { QSettings().setValue(groupOfKey(key), val); }
 
-QVariant ASettings::read(const Main key)
+QVariant Settings::read(const Main key)
 { return QSettings().value(groupOfKey(key)); }
 
-void ASettings::write(const Main key, const QVariant &val)
+void Settings::write(const Main key, const QVariant &val)
 { QSettings().setValue(groupOfKey(key), val); }
 
-QVariant ASettings::read(const UserData key)
+QVariant Settings::read(const UserData key)
 { return QSettings().value(groupOfKey(key)); }
 
-void ASettings::write(const UserData key, const QVariant &val)
+void Settings::write(const UserData key, const QVariant &val)
 { QSettings().setValue(groupOfKey(key), val); }
 
 //
 // QString conversion PATH
 //
-QString ASettings::groupOfKey (const ASettings::FlightLogging key)
+QString Settings::groupOfKey (const Settings::FlightLogging key)
 { return QStringLiteral("flightlogging/") + flightLoggingMap[key]; }
 
-QString ASettings::groupOfKey (const ASettings::Main key)
+QString Settings::groupOfKey (const Settings::Main key)
 { return QStringLiteral("main/") + mainMap[key]; }
 
-QString ASettings::groupOfKey (const ASettings::UserData key)
+QString Settings::groupOfKey (const Settings::UserData key)
 { return QStringLiteral("userdata/") + userDataMap[key]; }
 
 //
 // QString conversion ONLY KEY
 //
-QString ASettings::stringOfKey (const ASettings::FlightLogging key)
+QString Settings::stringOfKey (const Settings::FlightLogging key)
 { return  flightLoggingMap[key]; }
 
-QString ASettings::stringOfKey (const ASettings::Main key)
+QString Settings::stringOfKey (const Settings::Main key)
 { return  mainMap[key]; }
 
-QString ASettings::stringOfKey (const ASettings::UserData key)
+QString Settings::stringOfKey (const Settings::UserData key)
 { return  userDataMap[key]; }

+ 4 - 4
src/classes/asettings.h → src/classes/settings.h

@@ -15,8 +15,8 @@
  *You should have received a copy of the GNU General Public License
  *along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
-#ifndef ASETTINGS_H
-#define ASETTINGS_H
+#ifndef SETTINGS_H
+#define SETTINGS_H
 #include <QtCore>
 #include <QSettings>
 
@@ -24,7 +24,7 @@
  * \brief Thin wrapper for the QSettings class,
  * simplifying reading and writing of settings.
  */
-class ASettings {
+class Settings {
 public:
     enum class Main {
         SetupComplete,
@@ -102,4 +102,4 @@ private:
     static QMap<FlightLogging, QString> flightLoggingMap;
 };
 
-#endif // ASETTINGS_H
+#endif // SETTINGS_H

+ 7 - 7
src/classes/style.cpp

@@ -27,7 +27,7 @@
  */
 #include "src/opl.h"
 #include "style.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include <QStyle>
 #include <QStyleFactory>
 #include <QApplication>
@@ -50,21 +50,21 @@ QLatin1String Style::DARK_PALETTE = QLatin1String("Dark-Palette");
  */
 void Style::setup()
 {
-    if (!ASettings::read(ASettings::Main::SetupComplete).toBool()) // Use system default for first run
+    if (!Settings::read(Settings::Main::SetupComplete).toBool()) // Use system default for first run
         return;
     // Set Font
-    if (!ASettings::read(ASettings::Main::UseSystemFont).toBool()) {
-        QFont font(ASettings::read(ASettings::Main::Font).toString());
-        font.setPointSize(ASettings::read(ASettings::Main::FontSize).toUInt());
+    if (!Settings::read(Settings::Main::UseSystemFont).toBool()) {
+        QFont font(Settings::read(Settings::Main::Font).toString());
+        font.setPointSize(Settings::read(Settings::Main::FontSize).toUInt());
         qApp->setFont(font);
         LOG << "Application Font set: " << font.toString().split(',').first();
     }
     // Set style, stylesheet or palette
-    QString style_setting = ASettings::read(ASettings::Main::Style).toString();
+    QString style_setting = Settings::read(Settings::Main::Style).toString();
 
     if (style_setting == DARK_PALETTE) {
         Style::setStyle(Style::darkPalette());
-        ASettings::write(ASettings::Main::Style, style_setting);
+        Settings::write(Settings::Main::Style, style_setting);
         return;
     }
     for (const auto &style_name : styles) {

+ 0 - 139
src/functions/adate.cpp

@@ -1,139 +0,0 @@
-#include "adate.h"
-
-QDate ADate::parseInput(QString &io_user_input, OPL::DateFormat format)
-{
-    // Try input string
-    const QString &format_string = ADATEFORMATSMAP.value(format);
-    QDate return_date = QDate::fromString(io_user_input, format_string);
-    if (return_date.isValid())
-        return return_date;
-
-    // try to fix the user input
-    tryToFix(io_user_input, format);
-
-    return  QDate::fromString(io_user_input, format_string);
-}
-
-void ADate::tryToFix(QString &io_user_input, OPL::DateFormat format)
-{
-
-    if (io_user_input.length() < 10) {
-        if (containsSeperator(io_user_input)) {
-            padZeroes(io_user_input);
-        }
-        else {
-            addSeperators(io_user_input, format);
-            padZeroes(io_user_input);
-        }
-    }
-
-    if (io_user_input.length() == 8)
-        padCentury(io_user_input, format);
-
-}
-
-// Input contains seperators and is of length 8
-void ADate::padCentury(QString &io_user_input, OPL::DateFormat format)
-{
-    switch (format) {
-    case OPL::DateFormat::ISODate: {
-        int year = io_user_input.left(2).toInt();
-        if (year > 50)
-            io_user_input.prepend(QStringLiteral("19"));
-        else
-            io_user_input.prepend(QStringLiteral("20"));
-        break;
-    }
-    case OPL::DateFormat::DE: {
-        int year = io_user_input.right(2).toInt();
-        if (year > 50)
-            io_user_input.insert(6, QStringLiteral("19"));
-        else
-            io_user_input.insert(6, QStringLiteral("20"));
-        break;
-    }
-    case OPL::DateFormat::EN: {
-        int year = io_user_input.right(2).toInt();
-        if (year > 50)
-            io_user_input.insert(6, QStringLiteral("19"));
-        else
-            io_user_input.insert(6, QStringLiteral("20"));
-        break;
-    }
-    }
-    DEB << "Padded century: " << io_user_input;
-}
-
-void ADate::padZeroes(QString &io_user_input)
-{
-    const auto unpadded_start = QRegularExpression(QStringLiteral("^\\d{1}\\W"));
-    const auto unpadded_middle = QRegularExpression(QStringLiteral("\\W\\d\\W"));
-    const auto unpadded_end = QRegularExpression(QStringLiteral("\\W\\d$"));
-
-    auto match = unpadded_start.match(io_user_input);
-    if (match.hasMatch())
-        io_user_input.insert(match.capturedStart(), QLatin1Char('0'));
-
-    match = unpadded_middle.match(io_user_input);
-    if (match.hasMatch())
-        io_user_input.insert(match.capturedStart() + 1, QLatin1Char('0'));
-
-    match = unpadded_end.match(io_user_input);
-    if (match.hasMatch())
-        io_user_input.insert(match.capturedStart() + 1, QLatin1Char('0'));
-    DEB << "Padded zeroes: " << io_user_input;
-}
-// 10.10.2020
-void ADate::addSeperators(QString &io_user_input, const OPL::DateFormat &format)
-{
-    switch (format) {
-    case OPL::DateFormat::ISODate:
-        if (io_user_input.length() > 7) {
-            io_user_input.insert(4, QLatin1Char('-'));
-            io_user_input.insert(7, QLatin1Char('-'));
-        } else {
-            io_user_input.insert(2, QLatin1Char('-'));
-            io_user_input.insert(5, QLatin1Char('-'));
-        }
-        break;
-    case OPL::DateFormat::DE:
-            io_user_input.insert(2, QLatin1Char('.'));
-            io_user_input.insert(5, QLatin1Char('.'));
-        break;
-    case OPL::DateFormat::EN:
-            io_user_input.insert(2, QLatin1Char('/'));
-            io_user_input.insert(5, QLatin1Char('/'));
-        break;
-    }
-    DEB << "Added Seperators: " << io_user_input;
-}
-
-bool ADate::containsSeperator(const QString &user_input)
-{
-    if (user_input.contains(QLatin1Char('.')))
-        return true;
-    if (user_input.contains(QLatin1Char('-')))
-        return true;
-    if (user_input.contains(QLatin1Char('/')))
-        return true;
-
-    DEB << "No Seperators found.";
-
-    return false;
-}
-
-const QStringList& ADate::getDisplayNames()
-{
-    return DISPLAY_NAMES;
-}
-
-const QString ADate::getFormatString(OPL::DateFormat format)
-{
-    return ADATEFORMATSMAP.value(format);
-}
-
-const QString ADate::currentDate()
-{
-    return QDate::currentDate().toString(Qt::ISODate);
-}
-

+ 0 - 71
src/functions/adate.h

@@ -1,71 +0,0 @@
-#ifndef ADATE_H
-#define ADATE_H
-#include "src/opl.h"
-
-const static auto ISO = QStringLiteral("yyyy-MM-dd");
-const static auto DE = QStringLiteral("dd.MM.yyyy");
-const static auto EN = QStringLiteral("MM/dd/yyyy");
-
-const static QMap<OPL::DateFormat, QString> ADATEFORMATSMAP = {
-    {OPL::DateFormat::ISODate, ISO},
-    {OPL::DateFormat::DE,      DE },
-    {OPL::DateFormat::EN,      EN },
-
-};
-
-const static QStringList DISPLAY_NAMES = {
-    QStringLiteral("ISO 8601: yyyy-MM-dd"),
-    QStringLiteral("DE: dd.MM.yyyy"),
-    QStringLiteral("EN: MM/dd/yyyy")
-};
-
-/*!
- * \brief The ADate class is responsible for input/output of Dates and handling the different
- * Date Formats.
- */
-class ADate
-{
-public:
-    /*!
-     * \brief takes a user-provided input and tries to convert it to a (valid) QDate.
-     * \return QDate (invalid if input not recognized)
-     */
-    static QDate parseInput(QString &io_user_input, OPL::DateFormat format);
-
-    static void tryToFix(QString &io_user_input, OPL::DateFormat format);
-
-    /*!
-     * \brief padCentury adds the century to a date where it was omitted
-     */
-    static void padCentury(QString &io_user_input, OPL::DateFormat format);
-
-    /*!
-     * \brief pads a user-provided date string with 0s to facilitate conversion to QDate
-     */
-    static void padZeroes(QString &io_user_input);
-
-    static void addSeperators(QString &io_user_input, const OPL::DateFormat &format);
-
-    static bool containsSeperator(const QString &user_input);
-
-    /*!
-     * \brief Reimplements QDate::toString to accept OPL::Date::ADateFormat enums
-     */
-    inline static QString toString(const QDate &date, OPL::DateFormat format = OPL::DateFormat::ISODate)
-    {
-        return date.toString(ADATEFORMATSMAP.value(format));
-    };
-
-    static const QStringList& getDisplayNames();
-
-    static const QString getFormatString(OPL::DateFormat format);
-
-    /*!
-     * \brief today Returns a string containing the current date in ISO format
-     * \return
-     */
-    static const QString currentDate();
-
-};
-
-#endif // ADATE_H

+ 0 - 27
src/functions/areadcsv.h

@@ -1,27 +0,0 @@
-/*
- *openPilotLog - A FOSS Pilot Logbook Application
- *Copyright (C) 2020-2022 Felix Turowsky
- *
- *This program is free software: you can redistribute it and/or modify
- *it under the terms of the GNU General Public License as published by
- *the Free Software Foundation, either version 3 of the License, or
- *(at your option) any later version.
- *
- *This program is distributed in the hope that it will be useful,
- *but WITHOUT ANY WARRANTY; without even the implied warranty of
- *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *GNU General Public License for more details.
- *
- *You should have received a copy of the GNU General Public License
- *along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-#ifndef AREADCSV_H
-#define AREADCSV_H
-
-#include<QtCore>
-
-QVector<QStringList> aReadCsv(QString filename);
-QVector<QStringList> aReadCsvAsRows(const QString &filename);
-
-
-#endif // AREADCSV_H

+ 2 - 2
src/functions/calc.cpp

@@ -17,7 +17,7 @@
  */
 #include "calc.h"
 #include "src/database/database.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/opl.h"
 
 /*!
@@ -343,7 +343,7 @@ void OPL::Calc::updateAutoTimes(int acft_id)
  */
 void OPL::Calc::updateNightTimes()
 {
-    const int night_angle = ASettings::read(ASettings::FlightLogging::NightAngle).toInt();
+    const int night_angle = Settings::read(Settings::FlightLogging::NightAngle).toInt();
 
     //find all flights for aircraft
     auto statement = QStringLiteral("SELECT ROWID FROM flights");

+ 142 - 0
src/functions/datetime.cpp

@@ -0,0 +1,142 @@
+#include "datetime.h"
+
+namespace OPL {
+
+QDate DateTime::parseInput(QString &user_input, OPL::DateFormat format)
+{
+    // Try input string
+    const QString &format_string = DATEFORMATSMAP.value(format);
+    QDate return_date = QDate::fromString(user_input, format_string);
+    if (return_date.isValid())
+        return return_date;
+
+    // try to fix the user input
+    tryToFix(user_input, format);
+
+    return  QDate::fromString(user_input, format_string);
+}
+
+void DateTime::tryToFix(QString &user_input, OPL::DateFormat format)
+{
+
+    if (user_input.length() < 10) {
+        if (containsSeperator(user_input)) {
+            padZeroes(user_input);
+        }
+        else {
+            addSeperators(user_input, format);
+            padZeroes(user_input);
+        }
+    }
+
+    if (user_input.length() == 8)
+        padCentury(user_input, format);
+
+}
+
+// Input contains seperators and is of length 8
+void DateTime::padCentury(QString &user_input, OPL::DateFormat format)
+{
+    switch (format) {
+    case OPL::DateFormat::ISODate: {
+        int year = user_input.left(2).toInt();
+        if (year > 50)
+            user_input.prepend(QStringLiteral("19"));
+        else
+            user_input.prepend(QStringLiteral("20"));
+        break;
+    }
+    case OPL::DateFormat::DE: {
+        int year = user_input.right(2).toInt();
+        if (year > 50)
+            user_input.insert(6, QStringLiteral("19"));
+        else
+            user_input.insert(6, QStringLiteral("20"));
+        break;
+    }
+    case OPL::DateFormat::EN: {
+        int year = user_input.right(2).toInt();
+        if (year > 50)
+            user_input.insert(6, QStringLiteral("19"));
+        else
+            user_input.insert(6, QStringLiteral("20"));
+        break;
+    }
+    }
+    DEB << "Padded century: " << user_input;
+}
+
+void DateTime::padZeroes(QString &user_input)
+{
+    const static auto unpadded_start = QRegularExpression(QStringLiteral("^\\d{1}\\W"));
+    const static auto unpadded_middle = QRegularExpression(QStringLiteral("\\W\\d\\W"));
+    const static auto unpadded_end = QRegularExpression(QStringLiteral("\\W\\d$"));
+
+    auto match = unpadded_start.match(user_input);
+    if (match.hasMatch())
+        user_input.insert(match.capturedStart(), QLatin1Char('0'));
+
+    match = unpadded_middle.match(user_input);
+    if (match.hasMatch())
+        user_input.insert(match.capturedStart() + 1, QLatin1Char('0'));
+
+    match = unpadded_end.match(user_input);
+    if (match.hasMatch())
+        user_input.insert(match.capturedStart() + 1, QLatin1Char('0'));
+    DEB << "Padded zeroes: " << user_input;
+}
+// 10.10.2020
+void DateTime::addSeperators(QString &user_input, const OPL::DateFormat &format)
+{
+    switch (format) {
+    case OPL::DateFormat::ISODate:
+        if (user_input.length() > 7) {
+            user_input.insert(4, QLatin1Char('-'));
+            user_input.insert(7, QLatin1Char('-'));
+        } else {
+            user_input.insert(2, QLatin1Char('-'));
+            user_input.insert(5, QLatin1Char('-'));
+        }
+        break;
+    case OPL::DateFormat::DE:
+            user_input.insert(2, QLatin1Char('.'));
+            user_input.insert(5, QLatin1Char('.'));
+        break;
+    case OPL::DateFormat::EN:
+            user_input.insert(2, QLatin1Char('/'));
+            user_input.insert(5, QLatin1Char('/'));
+        break;
+    }
+    DEB << "Added Seperators: " << user_input;
+}
+
+bool DateTime::containsSeperator(const QString &user_input)
+{
+    if (user_input.contains(QLatin1Char('.')))
+        return true;
+    if (user_input.contains(QLatin1Char('-')))
+        return true;
+    if (user_input.contains(QLatin1Char('/')))
+        return true;
+
+    DEB << "No Seperators found.";
+
+    return false;
+}
+
+const QStringList& DateTime::getDisplayNames()
+{
+    return DISPLAY_NAMES;
+}
+
+const QString DateTime::getFormatString(OPL::DateFormat format)
+{
+    return DATEFORMATSMAP.value(format);
+}
+
+const QString DateTime::currentDate()
+{
+    return QDate::currentDate().toString(Qt::ISODate);
+}
+
+} // namespace OPL

+ 139 - 0
src/functions/datetime.h

@@ -0,0 +1,139 @@
+#ifndef DATETIME_H
+#define DATETIME_H
+#include "src/opl.h"
+
+namespace OPL {
+
+class DateTime {
+public:
+    const inline static QString ISO_FORMAT_STRING = QStringLiteral("yyyy-MM-dd");
+    const inline static QString DE_FORMAT_STRING = QStringLiteral("dd.MM.yyyy");
+    const inline static QString EN_FORMAT_STRING = QStringLiteral("MM/dd/yyyy");
+
+    const static inline QMap<OPL::DateFormat, QString> DATEFORMATSMAP = {
+        {OPL::DateFormat::ISODate, ISO_FORMAT_STRING},
+        {OPL::DateFormat::DE,      DE_FORMAT_STRING },
+        {OPL::DateFormat::EN,      EN_FORMAT_STRING },
+
+    };
+
+    const static inline QStringList DISPLAY_NAMES = {
+        QStringLiteral("ISO 8601: yyyy-MM-dd"),
+        QStringLiteral("DE: dd.MM.yyyy"),
+        QStringLiteral("EN: MM/dd/yyyy")
+    };
+
+    /*!
+     * \brief Reimplements QDate::toString to accept OPL::Date::DateFormat enums
+     */
+    inline static QString dateToString(const QDate &date, OPL::DateFormat format = OPL::DateFormat::ISODate)
+    {
+        return date.toString(DATEFORMATSMAP.value(format));
+    };
+
+    /*!
+     * \brief takes a user-provided input and tries to convert it to a (valid) QDate.
+     * \return QDate (invalid if input not recognized)
+     */
+    static QDate parseInput(QString &user_input, OPL::DateFormat format);
+
+    static void tryToFix(QString &user_input, OPL::DateFormat format);
+
+    /*!
+     * \brief padCentury adds the century to a date where it was omitted
+     */
+    static void padCentury(QString &io_user_input, OPL::DateFormat format);
+
+    /*!
+     * \brief pads a user-provided date string with 0s to facilitate conversion to QDate
+     */
+    static void padZeroes(QString &io_user_input);
+
+    static void addSeperators(QString &io_user_input, const OPL::DateFormat &format);
+
+    static bool containsSeperator(const QString &user_input);
+
+
+
+    static const QStringList& getDisplayNames();
+
+    static const QString getFormatString(OPL::DateFormat format);
+
+    /*!
+     * \brief today Returns a string containing the current date in ISO format
+     * \return
+     */
+    static const QString currentDate();
+
+    /*!
+     * \brief dateTimeToString formats a QDateTime object into a string in a uniform way.
+     * \return
+     */
+    static inline const QString dateTimeToString (const QDateTime& date_time, OPL::DateTimeFormat format) {
+        switch (format) {
+        case OPL::DateTimeFormat::Default:
+            return date_time.toString(Qt::ISODate);
+        case OPL::DateTimeFormat::Backup:
+            return date_time.toString(QStringLiteral("yyyy_MM_dd_T_hh_mm"));
+        default:
+            return QString();
+        }
+    }
+
+    static inline QDateTime fromString(const QString& date_time_string)
+    {
+        auto date_time = QDateTime::fromString(date_time_string, QStringLiteral("yyyy-MM-ddhh:mm"));
+        date_time.setTimeZone(QTimeZone::utc());
+        return date_time;
+    }
+
+};
+
+
+
+/*!
+ * \brief The ADate class is responsible for input/output of Dates and handling the different
+ * Date Formats.
+ */
+//class ADate
+//{
+//public:
+//    /*!
+//     * \brief takes a user-provided input and tries to convert it to a (valid) QDate.
+//     * \return QDate (invalid if input not recognized)
+//     */
+//    static QDate parseInput(QString &iuser_input, OPL::DateFormat format);
+//
+//    static void tryToFix(QString &user_input, OPL::DateFormat format);
+//
+//    /*!
+//     * \brief padCentury adds the century to a date where it was omitted
+//     */
+//    static void padCentury(QString &io_user_input, OPL::DateFormat format);
+//
+//    /*!
+//     * \brief pads a user-provided date string with 0s to facilitate conversion to QDate
+//     */
+//    static void padZeroes(QString &io_user_input);
+//
+//    static void addSeperators(QString &io_user_input, const OPL::DateFormat &format);
+//
+//    static bool containsSeperator(const QString &user_input);
+//
+//
+//
+//    static const QStringList& getDisplayNames();
+//
+//    static const QString getFormatString(OPL::DateFormat format);
+//
+//    /*!
+//     * \brief today Returns a string containing the current date in ISO format
+//     * \return
+//     */
+//    static const QString currentDate();
+//
+//};
+
+} // namespace OPL
+
+#endif // DATETIME_H

+ 14 - 5
src/functions/areadcsv.cpp → src/functions/readcsv.h

@@ -15,14 +15,19 @@
  *You should have received a copy of the GNU General Public License
  *along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
-#include "areadcsv.h"
+#ifndef READCSV_H
+#define READCSV_H
+
+#include<QtCore>
+
+namespace CSV {
 
 /*!
- * \brief aReadCSV reads from a CSV file
+ * \brief readCSV reads from a CSV file
  * \param filename - QString to csv file.
  * \return QVector<QStringList> of the CSV data, where each QStringList is one column of the input file
  */
-QVector<QStringList> aReadCsv(QString filename)
+static inline QVector<QStringList> readCSVasColumns(const QString &filename)
 {
     QFile csvfile(filename);
     csvfile.open(QIODevice::ReadOnly);
@@ -50,11 +55,11 @@ QVector<QStringList> aReadCsv(QString filename)
 }
 
 /*!
- * \brief aReadCsvAsRows reads from CSV
+ * \brief readCsvAsRows reads from CSV
  * \param file_name input file path
  * \return QVector<QStringList> of the CSV data, where each QStringList is one row of the input file
  */
-QVector<QStringList> aReadCsvAsRows(const QString &file_name)
+static inline QVector<QStringList> readCsvAsRows(const QString &file_name)
 {
     QFile csvfile(file_name);
     csvfile.open(QIODevice::ReadOnly);
@@ -69,3 +74,7 @@ QVector<QStringList> aReadCsvAsRows(const QString &file_name)
     }
     return csv_rows;
 }
+
+} // namespace CSV
+
+#endif // READCSV_H

+ 25 - 25
src/gui/dialogues/firstrundialog.cpp

@@ -23,8 +23,8 @@
 #include "src/gui/widgets/backupwidget.h"
 #include "src/database/row.h"
 #include "src/classes/downloadhelper.h"
-#include "src/classes/asettings.h"
-#include "src/functions/adate.h"
+#include "src/classes/settings.h"
+#include "src/functions/datetime.h"
 #include "src/classes/style.h"
 #include "src/classes/md5sum.h"
 #include <QErrorMessage>
@@ -55,7 +55,7 @@ FirstRunDialog::FirstRunDialog(QWidget *parent) :
     // Prepare Date Edits
     const auto date_edits = this->findChildren<QDateEdit *>();
     for (const auto &date_edit : date_edits) {
-        date_edit->setDisplayFormat(ADate::getFormatString(OPL::DateFormat::ISODate));
+        date_edit->setDisplayFormat(OPL::DateTime::getFormatString(OPL::DateFormat::ISODate));
         date_edit->setDate(QDate::currentDate());
     }
     // Debug - use ctrl + t to enable branchLineEdit to select from which git branch the templates are pulled
@@ -263,25 +263,25 @@ bool FirstRunDialog::verifyTemplates()
 
 void FirstRunDialog::writeSettings()
 {
-    ASettings::resetToDefaults();
+    Settings::resetToDefaults();
 
-    ASettings::write(ASettings::FlightLogging::Function, ui->functionComboBox->currentIndex());
-    ASettings::write(ASettings::FlightLogging::Approach, ui->approachComboBox->currentIndex());
-    ASettings::write(ASettings::FlightLogging::NightLoggingEnabled, ui->nightComboBox->currentIndex());
+    Settings::write(Settings::FlightLogging::Function, ui->functionComboBox->currentIndex());
+    Settings::write(Settings::FlightLogging::Approach, ui->approachComboBox->currentIndex());
+    Settings::write(Settings::FlightLogging::NightLoggingEnabled, ui->nightComboBox->currentIndex());
     switch (ui->nightRulesComboBox->currentIndex()) {
     case 0:
-        ASettings::write(ASettings::FlightLogging::NightAngle, -6);
+        Settings::write(Settings::FlightLogging::NightAngle, -6);
         break;
     case 1:
-        ASettings::write(ASettings::FlightLogging::NightAngle, 0);
+        Settings::write(Settings::FlightLogging::NightAngle, 0);
         break;
     }
-    ASettings::write(ASettings::FlightLogging::LogIFR, ui->rulesComboBox->currentIndex());
-    ASettings::write(ASettings::FlightLogging::FlightNumberPrefix, ui->prefixLineEdit->text());
-    ASettings::write(ASettings::UserData::DisplaySelfAs, ui->aliasComboBox->currentIndex());
-    ASettings::write(ASettings::Main::LogbookView, ui->logbookViewComboBox->currentIndex());
-    ASettings::write(ASettings::Main::Style, ui->styleComboBox->currentText());
-    ASettings::sync();
+    Settings::write(Settings::FlightLogging::LogIFR, ui->rulesComboBox->currentIndex());
+    Settings::write(Settings::FlightLogging::FlightNumberPrefix, ui->prefixLineEdit->text());
+    Settings::write(Settings::UserData::DisplaySelfAs, ui->aliasComboBox->currentIndex());
+    Settings::write(Settings::Main::LogbookView, ui->logbookViewComboBox->currentIndex());
+    Settings::write(Settings::Main::Style, ui->styleComboBox->currentText());
+    Settings::sync();
 }
 
 bool FirstRunDialog::setupDatabase()
@@ -344,13 +344,13 @@ bool FirstRunDialog::writeCurrencies()
         {OPL::CurrencyName::Custom1,    ui->currCustom1DateEdit},
         {OPL::CurrencyName::Custom2,    ui->currCustom2DateEdit},
     };
-    const QMap<OPL::CurrencyName, ASettings::UserData> settings_list = {
-        {OPL::CurrencyName::Licence,    ASettings::UserData::ShowLicCurrency },
-        {OPL::CurrencyName::TypeRating, ASettings::UserData::ShowTrCurrency },
-        {OPL::CurrencyName::LineCheck,  ASettings::UserData::ShowLckCurrency },
-        {OPL::CurrencyName::Medical,    ASettings::UserData::ShowMedCurrency },
-        {OPL::CurrencyName::Custom1,    ASettings::UserData::ShowCustom1Currency },
-        {OPL::CurrencyName::Custom2,    ASettings::UserData::ShowCustom2Currency },
+    const QMap<OPL::CurrencyName, Settings::UserData> settings_list = {
+        {OPL::CurrencyName::Licence,    Settings::UserData::ShowLicCurrency },
+        {OPL::CurrencyName::TypeRating, Settings::UserData::ShowTrCurrency },
+        {OPL::CurrencyName::LineCheck,  Settings::UserData::ShowLckCurrency },
+        {OPL::CurrencyName::Medical,    Settings::UserData::ShowMedCurrency },
+        {OPL::CurrencyName::Custom1,    Settings::UserData::ShowCustom1Currency },
+        {OPL::CurrencyName::Custom2,    Settings::UserData::ShowCustom2Currency },
     };
 
     QDate today = QDate::currentDate();
@@ -364,7 +364,7 @@ bool FirstRunDialog::writeCurrencies()
             else if(enum_value == OPL::CurrencyName::Custom2)
                 row_data.insert(OPL::Db::CURRENCIES_CURRENCYNAME, ui->currCustom2LineEdit->text());
 
-            ASettings::write(settings_list.value(enum_value), true); // Show selected currency on Home Screen
+            Settings::write(settings_list.value(enum_value), true); // Show selected currency on Home Screen
             OPL::CurrencyEntry entry(static_cast<int>(enum_value), row_data);
             if (!DB->commit(entry))
                 return false;
@@ -420,12 +420,12 @@ void FirstRunDialog::on_styleComboBox_currentTextChanged(const QString &new_styl
 
 void FirstRunDialog::on_currCustom1LineEdit_editingFinished()
 {
-    ASettings::write(ASettings::UserData::Custom1CurrencyName, ui->currCustom1LineEdit->text());
+    Settings::write(Settings::UserData::Custom1CurrencyName, ui->currCustom1LineEdit->text());
 }
 
 void FirstRunDialog::on_currCustom2LineEdit_editingFinished()
 {
-    ASettings::write(ASettings::UserData::Custom2CurrencyName, ui->currCustom2LineEdit->text());
+    Settings::write(Settings::UserData::Custom2CurrencyName, ui->currCustom2LineEdit->text());
 }
 
 void FirstRunDialog::on_importPushButton_clicked()

+ 3 - 3
src/gui/dialogues/firstrundialog.h

@@ -30,7 +30,7 @@ class FirstRunDialog;
 /*!
  * \brief The FirstRunDialog is used as a set-up wizard for the application.
  * \details The Application does not ship with a database, it is created on the fly. This is the main purpose of the
- * FirstRunDialog. Apart from this main task, user details and preferences are gathered and saved using ASettings.
+ * FirstRunDialog. Apart from this main task, user details and preferences are gathered and saved using Settings.
  *
  * The Dialog contains a tabbed widget which guides the user through the set up process.
  *
@@ -51,12 +51,12 @@ class FirstRunDialog;
  * ### 4 - Flight Logging
  *
  * In this tab, the user can determine what the defualt selections for logging a new flight will be. These selections (Pilot Function,
- * Flight Rules,...) are stored in an INI file using the ASettings class.
+ * Flight Rules,...) are stored in an INI file using the Settings class.
  *
  * ### 5 - Customization
  *
  * In this tab, the user can make selections regarding the application layout and theming, as well as with regards to how data is being
- * displayed. These settings are stored in an INI file using the ASettings class.
+ * displayed. These settings are stored in an INI file using the Settings class.
  *
  * ### 6 - Finish / Database creation
  *

+ 17 - 18
src/gui/dialogues/newflightdialog.cpp

@@ -18,10 +18,9 @@
 #include "newflightdialog.h"
 #include "ui_newflightdialog.h"
 #include "src/opl.h"
-#include "src/functions/adate.h"
-#include "src/classes/asettings.h"
+#include "src/functions/datetime.h"
+#include "src/classes/settings.h"
 #include "src/functions/calc.h"
-#include "src/functions/adatetime.h"
 #include "src/gui/dialogues/newtaildialog.h"
 #include "src/gui/dialogues/newpilotdialog.h"
 #include <QDateTime>
@@ -39,18 +38,18 @@ NewFlightDialog::NewFlightDialog(OPL::DbCompletionData &completion_data,
     init();
     //flightEntry = AFlightEntry();
     // Set up UI (New Flight)
-    LOG << ASettings::read(ASettings::FlightLogging::Function);
-    if(ASettings::read(ASettings::FlightLogging::Function).toInt() == static_cast<int>(OPL::PilotFunction::PIC)){
+    LOG << Settings::read(Settings::FlightLogging::Function);
+    if(Settings::read(Settings::FlightLogging::Function).toInt() == static_cast<int>(OPL::PilotFunction::PIC)){
         ui->picNameLineEdit->setText(self);
         ui->functionComboBox->setCurrentIndex(0);
         emit ui->picNameLineEdit->editingFinished();
     }
-    if (ASettings::read(ASettings::FlightLogging::Function).toInt() == static_cast<int>(OPL::PilotFunction::SIC)) {
+    if (Settings::read(Settings::FlightLogging::Function).toInt() == static_cast<int>(OPL::PilotFunction::SIC)) {
         ui->sicNameLineEdit->setText(self);
         ui->functionComboBox->setCurrentIndex(2);
         emit ui->sicNameLineEdit->editingFinished();
     }
-    ui->doftLineEdit->setText(ADate::currentDate());
+    ui->doftLineEdit->setText(OPL::DateTime::currentDate());
     emit ui->doftLineEdit->editingFinished();
 }
 
@@ -179,11 +178,11 @@ bool NewFlightDialog::eventFilter(QObject *object, QEvent *event)
  */
 void NewFlightDialog::readSettings()
 {
-    ui->functionComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::Function).toInt());
-    ui->approachComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::Approach).toInt());
-    ui->pilotFlyingCheckBox->setChecked(ASettings::read(ASettings::FlightLogging::PilotFlying).toBool());
-    ui->ifrCheckBox->setChecked(ASettings::read(ASettings::FlightLogging::LogIFR).toBool());
-    ui->flightNumberLineEdit->setText(ASettings::read(ASettings::FlightLogging::FlightNumberPrefix).toString());
+    ui->functionComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::Function).toInt());
+    ui->approachComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::Approach).toInt());
+    ui->pilotFlyingCheckBox->setChecked(Settings::read(Settings::FlightLogging::PilotFlying).toBool());
+    ui->ifrCheckBox->setChecked(Settings::read(Settings::FlightLogging::LogIFR).toBool());
+    ui->flightNumberLineEdit->setText(Settings::read(Settings::FlightLogging::FlightNumberPrefix).toString());
 }
 
 /*!
@@ -370,9 +369,9 @@ OPL::RowData_T NewFlightDialog::prepareFlightEntryData()
     OPL::RowData_T new_data;
     // Calculate Block and Night Time
     const int block_minutes = OPL::Time::blockMinutes(ui->tofbTimeLineEdit->text(), ui->tonbTimeLineEdit->text());
-    QDateTime departure_date_time = ADateTime::fromString(ui->doftLineEdit->text() + ui->tofbTimeLineEdit->text());
+    QDateTime departure_date_time = OPL::DateTime::fromString(ui->doftLineEdit->text() + ui->tofbTimeLineEdit->text());
     const auto night_time_data = OPL::Calc::NightTimeValues(ui->deptLocationLineEdit->text(), ui->destLocationLineEdit->text(),
-                           departure_date_time, block_minutes, ASettings::read(ASettings::FlightLogging::NightAngle).toInt());
+                           departure_date_time, block_minutes, Settings::read(Settings::FlightLogging::NightAngle).toInt());
     // Mandatory data
     new_data.insert(OPL::Db::FLIGHTS_DOFT, ui->doftLineEdit->text());
     new_data.insert(OPL::Db::FLIGHTS_DEPT, ui->deptLocationLineEdit->text());
@@ -479,9 +478,9 @@ void NewFlightDialog::updateNightCheckBoxes()
 {
     // Calculate Night Time
     const QString dept_date = (ui->doftLineEdit->text() + ui->tofbTimeLineEdit->text());
-    const auto dept_date_time = ADateTime::fromString(dept_date);
+    const auto dept_date_time = OPL::DateTime::fromString(dept_date);
     const int block_minutes = OPL::Time::blockMinutes(ui->tofbTimeLineEdit->text(), ui->tonbTimeLineEdit->text());
-    const int night_angle = ASettings::read(ASettings::FlightLogging::NightAngle).toInt();
+    const int night_angle = Settings::read(Settings::FlightLogging::NightAngle).toInt();
     const auto night_values = OPL::Calc::NightTimeValues(
                 ui->deptLocationLineEdit->text(),
                 ui->destLocationLineEdit->text(),
@@ -643,10 +642,10 @@ void NewFlightDialog::on_doftLineEdit_editingFinished()
 
     TODO << "Non-default Date formats not implemented yet.";
     OPL::DateFormat date_format = OPL::DateFormat::ISODate;
-    auto date = ADate::parseInput(text, date_format);
+    auto date = OPL::DateTime::parseInput(text, date_format);
     if (date.isValid()) {
         label->setText(date.toString(Qt::TextDate));
-        line_edit->setText(ADate::toString(date, date_format));
+        line_edit->setText(OPL::DateTime::dateToString(date, date_format));
         onGoodInputReceived(line_edit);
         return;
     }

+ 5 - 5
src/gui/dialogues/newsimdialog.cpp

@@ -2,7 +2,7 @@
 #include "ui_newsimdialog.h"
 #include "src/opl.h"
 #include "src/functions/time.h"
-#include "src/functions/adate.h"
+#include "src/functions/datetime.h"
 #include "src/database/database.h"
 #include "src/database/dbcompletiondata.h"
 #include <QCompleter>
@@ -15,7 +15,7 @@ NewSimDialog::NewSimDialog(QWidget *parent) :
 {
     //entry = ASimulatorEntry();
     ui->setupUi(this);
-    ui->dateLineEdit->setText(ADate::currentDate());
+    ui->dateLineEdit->setText(OPL::DateTime::currentDate());
     init();
 }
 /*!
@@ -72,9 +72,9 @@ void NewSimDialog::on_dateLineEdit_editingFinished()
     auto text = ui->dateLineEdit->text();
 
     OPL::DateFormat date_format = OPL::DateFormat::ISODate;
-    auto date = ADate::parseInput(text, date_format);
+    auto date = OPL::DateTime::parseInput(text, date_format);
     if (date.isValid()) {
-        ui->dateLineEdit->setText(ADate::toString(date, date_format));
+        ui->dateLineEdit->setText(OPL::DateTime::dateToString(date, date_format));
         ui->dateLineEdit->setStyleSheet(QString());
         return;
     } else {
@@ -120,7 +120,7 @@ bool NewSimDialog::verifyInput(QString& error_msg)
     // Date
     auto text = ui->dateLineEdit->text();
     OPL::DateFormat date_format = OPL::DateFormat::ISODate;
-    const auto date = ADate::parseInput(text, date_format);
+    const auto date = OPL::DateTime::parseInput(text, date_format);
 
     if (!date.isValid()) {
         ui->dateLineEdit->setStyleSheet(OPL::Styles::RED_BORDER);

+ 1 - 1
src/gui/dialogues/newtaildialog.h

@@ -24,7 +24,7 @@
 #include <QRegularExpression>
 #include <QComboBox>
 
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/functions/calc.h"
 #include "src/database/database.h"
 #include "src/database/row.h"

+ 3 - 3
src/gui/widgets/aircraftwidget.cpp

@@ -18,7 +18,7 @@
 #include "aircraftwidget.h"
 #include "ui_aircraftwidget.h"
 #include "src/opl.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/database/database.h"
 #include "src/database/row.h"
 
@@ -57,7 +57,7 @@ void AircraftWidget::setupModelAndView()
     view->verticalHeader()->hide();
     view->setAlternatingRowColors(true);
 
-    sortColumn = ASettings::read(ASettings::UserData::TailSortColumn).toInt();
+    sortColumn = Settings::read(Settings::UserData::TailSortColumn).toInt();
     view->setSortingEnabled(true);
     view->sortByColumn(sortColumn, Qt::DescendingOrder);
 
@@ -159,7 +159,7 @@ void AircraftWidget::on_aircraftSearchLineEdit_textChanged(const QString &arg1)
 void AircraftWidget::tableView_headerClicked(int column)
 {
     sortColumn = column;
-    ASettings::write(ASettings::UserData::TailSortColumn, column);
+    Settings::write(Settings::UserData::TailSortColumn, column);
 }
 
 void AircraftWidget::on_deleteAircraftButton_clicked()

+ 3 - 3
src/gui/widgets/backupwidget.cpp

@@ -19,7 +19,7 @@
 #include "ui_backupwidget.h"
 #include "src/opl.h"
 #include "src/database/database.h"
-#include "src/functions/adatetime.h"
+#include "src/functions/datetime.h"
 #include "src/database/dbsummary.h"
 
 #include <QListView>
@@ -80,7 +80,7 @@ void BackupWidget::refresh()
 const QString BackupWidget::absoluteBackupPath()
 {
     const QString backup_name = QLatin1String("logbook_backup_")
-            + ADateTime::toString(QDateTime::currentDateTime(), OPL::DateTimeFormat::Backup)
+            + OPL::DateTime::dateTimeToString(QDateTime::currentDateTime(), OPL::DateTimeFormat::Backup)
             + QLatin1String(".db");
     return OPL::Paths::filePath(OPL::Paths::Backup, backup_name);
 }
@@ -88,7 +88,7 @@ const QString BackupWidget::absoluteBackupPath()
 const QString BackupWidget::backupName()
 {
     return  QLatin1String("logbook_backup_")
-            + ADateTime::toString(QDateTime::currentDateTime(), OPL::DateTimeFormat::Backup)
+            + OPL::DateTime::dateTimeToString(QDateTime::currentDateTime(), OPL::DateTimeFormat::Backup)
             + QLatin1String(".db");
 }
 

+ 10 - 4
src/gui/widgets/debugwidget.cpp

@@ -16,14 +16,20 @@
  *along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 #include "debugwidget.h"
-#include "ui_debugwidget.h"
-#include <QtGlobal>
+#include "src/testing/importCrewlounge/processaircraft.h"
 #include "src/testing/importCrewlounge/processflights.h"
 #include "src/testing/importCrewlounge/processpilots.h"
-#include "src/testing/importCrewlounge/processaircraft.h"
+#include "ui_debugwidget.h"
+#include <QtGlobal>
+#include "src/classes/downloadhelper.h"
+#include "src/functions/readcsv.h"
+#include "src/database/database.h"
+#include "src/database/row.h"
+#include "src/testing/atimer.h"
+#include "src/functions/log.h"
 void DebugWidget::on_debugPushButton_clicked()
 {
-    auto rawCsvData = aReadCsvAsRows("/home/felix/git/importMCC/assets/data/felix.csv");
+    auto rawCsvData = CSV::readCsvAsRows("/home/felix/git/importMCC/assets/data/felix.csv");
     // Process Pilots
     auto proc_pilots = ProcessPilots(rawCsvData);
     proc_pilots.init();

+ 0 - 8
src/gui/widgets/debugwidget.h

@@ -25,14 +25,6 @@
 #include <QFileDialog>
 #include <QMessageBox>
 #include <QProcess>
-#include "src/classes/downloadhelper.h"
-#include "src/functions/areadcsv.h"
-
-#include "src/database/database.h"
-#include "src/database/row.h"
-
-#include "src/testing/atimer.h"
-#include "src/functions/log.h"
 
 namespace Ui {
 class DebugWidget;

+ 11 - 11
src/gui/widgets/homewidget.cpp

@@ -19,7 +19,7 @@
 #include "ui_homewidget.h"
 #include "src/database/database.h"
 #include "src/functions/time.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/database/row.h"
 
 // EASA FTL Limitations in minutes
@@ -37,8 +37,8 @@ HomeWidget::HomeWidget(QWidget *parent) :
 {
     ui->setupUi(this);
     today = QDate::currentDate();
-    ftlWarningThreshold = ASettings::read(ASettings::UserData::FtlWarningThreshold).toDouble();
-    currWarningThreshold = ASettings::read(ASettings::UserData::CurrWarningThreshold).toInt();
+    ftlWarningThreshold = Settings::read(Settings::UserData::FtlWarningThreshold).toDouble();
+    currWarningThreshold = Settings::read(Settings::UserData::CurrWarningThreshold).toInt();
     auto logo = QPixmap(OPL::Assets::LOGO);
     ui->logoLabel->setPixmap(logo);
     ui->welcomeLabel->setText(tr("Welcome to openPilotLog, %1!").arg(userName()));
@@ -142,25 +142,25 @@ void HomeWidget::fillSelectedCurrencies()
 {
     fillCurrencyTakeOffLanding();
 
-    ASettings::read(ASettings::UserData::ShowLicCurrency).toBool() ?
+    Settings::read(Settings::UserData::ShowLicCurrency).toBool() ?
                 fillCurrency(OPL::CurrencyName::Licence, ui->currLicDisplayLabel)
               : hideLabels(ui->currLicLabel, ui->currLicDisplayLabel);
-    ASettings::read(ASettings::UserData::ShowTrCurrency).toBool() ?
+    Settings::read(Settings::UserData::ShowTrCurrency).toBool() ?
                 fillCurrency(OPL::CurrencyName::TypeRating, ui->currTrDisplayLabel)
               : hideLabels(ui->currTrLabel, ui->currTrDisplayLabel);
-    ASettings::read(ASettings::UserData::ShowLckCurrency).toBool() ?
+    Settings::read(Settings::UserData::ShowLckCurrency).toBool() ?
                 fillCurrency(OPL::CurrencyName::LineCheck, ui->currLckDisplayLabel)
               : hideLabels(ui->currLckLabel, ui->currLckDisplayLabel);
-    ASettings::read(ASettings::UserData::ShowMedCurrency).toBool() ?
+    Settings::read(Settings::UserData::ShowMedCurrency).toBool() ?
                 fillCurrency(OPL::CurrencyName::Medical, ui->currMedDisplayLabel)
               : hideLabels(ui->currMedLabel, ui->currMedDisplayLabel);
-    ASettings::read(ASettings::UserData::ShowCustom1Currency).toBool() ?
+    Settings::read(Settings::UserData::ShowCustom1Currency).toBool() ?
                 fillCurrency(OPL::CurrencyName::Custom1, ui->currCustom1DisplayLabel)
               : hideLabels(ui->currCustom1Label, ui->currCustom1DisplayLabel);
-    ASettings::read(ASettings::UserData::ShowCustom1Currency).toBool() ?
+    Settings::read(Settings::UserData::ShowCustom1Currency).toBool() ?
                 fillCurrency(OPL::CurrencyName::Custom1, ui->currCustom1DisplayLabel)
               : hideLabels(ui->currCustom1Label, ui->currCustom1DisplayLabel);
-    ASettings::read(ASettings::UserData::ShowCustom2Currency).toBool() ?
+    Settings::read(Settings::UserData::ShowCustom2Currency).toBool() ?
                 fillCurrency(OPL::CurrencyName::Custom2, ui->currCustom2DisplayLabel)
               : hideLabels(ui->currCustom2Label, ui->currCustom2DisplayLabel);
 }
@@ -183,7 +183,7 @@ void HomeWidget::fillCurrencyTakeOffLanding()
     if (takeoff_landings[1].toUInt() < 3)
         setLabelColour(ui->LandingsDisplayLabel, Colour::Red);
 
-    if (ASettings::read(ASettings::UserData::ShowToLgdCurrency).toBool()) {
+    if (Settings::read(Settings::UserData::ShowToLgdCurrency).toBool()) {
         QDate expiration_date = OPL::Statistics::currencyTakeOffLandingExpiry();
         if (expiration_date <= QDate::currentDate())
             setLabelColour(ui->currToLdgDisplayLabel, Colour::Red);

+ 3 - 3
src/gui/widgets/homewidget.h

@@ -25,7 +25,7 @@
 #include <QSettings>
 #include "src/functions/statistics.h"
 #include "src/database/database.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 
 namespace Ui {
 class HomeWidget;
@@ -53,12 +53,12 @@ private:
     QList<QLabel*> limitationDisplayLabels;
     QDate          today;
     /*!
-     * \brief currWarningThreshold - Retreived from ASettings::UserData::CurrWarningThreshold, the number
+     * \brief currWarningThreshold - Retreived from Settings::UserData::CurrWarningThreshold, the number
      * of days before expiry that the user gets notified about impending expiries.
      */
     int currWarningThreshold;
     /*!
-     * \brief ftlWarningThreshold - Retreived from ASettings::UserData::FtlWarningThreshold, the percentage
+     * \brief ftlWarningThreshold - Retreived from Settings::UserData::FtlWarningThreshold, the percentage
      * of how close the user has to be to reaching a Flight Time Limitation before getting notified.
      */
     double ftlWarningThreshold;

+ 5 - 5
src/gui/widgets/logbookwidget.cpp

@@ -20,7 +20,7 @@
 #include "ui_logbookwidget.h"
 #include "src/database/row.h"
 #include "src/database/database.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/gui/dialogues/newflightdialog.h"
 #include "src/gui/dialogues/newsimdialog.h"
 
@@ -51,7 +51,7 @@ LogbookWidget::LogbookWidget(OPL::DbCompletionData& completion_data, QWidget *pa
     displayModel = new QSqlTableModel(this);
     view = ui->tableView;
 
-    setupModelAndView(ASettings::read(ASettings::Main::LogbookView).toInt());
+    setupModelAndView(Settings::read(Settings::Main::LogbookView).toInt());
     connectSignalsAndSlots();
 
 }
@@ -68,7 +68,7 @@ LogbookWidget::~LogbookWidget()
 /*!
  * \brief LogbookWidget::setupModelAndView configures the QTableView and populates the model with data
  * according to the current view.
- * \param view_id - retreived from ASettings::Main::LogbookView
+ * \param view_id - retreived from Settings::Main::LogbookView
  */
 void LogbookWidget::setupModelAndView(int view_id)
 {
@@ -237,7 +237,7 @@ void LogbookWidget::refresh()
 void LogbookWidget::onLogbookWidget_viewSelectionChanged(SettingsWidget::SettingSignal signal)
 {
     if (signal == SettingsWidget::SettingSignal::LogbookWidget)
-        setupModelAndView(ASettings::read(ASettings::Main::LogbookView).toInt());
+        setupModelAndView(Settings::read(Settings::Main::LogbookView).toInt());
 }
 
 //void LogbookWidget::on_showAllButton_clicked()
@@ -286,7 +286,7 @@ void LogbookWidget::repopulateModel()
     delete displayModel;
     // create a new model and populate it
     displayModel = new QSqlTableModel(this);
-    setupModelAndView(ASettings::read(ASettings::Main::LogbookView).toInt());
+    setupModelAndView(Settings::read(Settings::Main::LogbookView).toInt());
     connectSignalsAndSlots();
 }
 

+ 3 - 3
src/gui/widgets/pilotswidget.cpp

@@ -22,7 +22,7 @@
 #include "src/database/database.h"
 #include "src/database/row.h"
 #include "src/functions/time.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 
 PilotsWidget::PilotsWidget(QWidget *parent) :
     QWidget(parent),
@@ -59,7 +59,7 @@ void PilotsWidget::setupModelAndView()
     view->verticalHeader()->hide();
     view->setAlternatingRowColors(true);
     view->setSortingEnabled(true);
-    sortColumn = ASettings::read(ASettings::UserData::PilotSortColumn).toInt();
+    sortColumn = Settings::read(Settings::UserData::PilotSortColumn).toInt();
     view->sortByColumn(sortColumn, Qt::AscendingOrder);
 
     view->show();
@@ -137,7 +137,7 @@ void PilotsWidget::tableView_selectionChanged()
 void PilotsWidget::tableView_headerClicked(int column)
 {
     sortColumn = column;
-    ASettings::write(ASettings::UserData::PilotSortColumn, column);
+    Settings::write(Settings::UserData::PilotSortColumn, column);
 }
 
 void PilotsWidget::on_newPilotButton_clicked()

+ 62 - 62
src/gui/widgets/settingswidget.cpp

@@ -18,11 +18,11 @@
 #include "settingswidget.h"
 #include "ui_settingswidget.h"
 #include "src/classes/style.h"
-#include "src/classes/asettings.h"
+#include "src/classes/settings.h"
 #include "src/database/database.h"
 #include "src/database/row.h"
 #include "src/opl.h"
-#include "src/functions/adate.h"
+#include "src/functions/datetime.h"
 #include "src/gui/widgets/backupwidget.h"
 
 SettingsWidget::SettingsWidget(QWidget *parent) :
@@ -67,8 +67,8 @@ void SettingsWidget::setupComboBoxes(){
 void SettingsWidget::setupDateEdits()
 {
     // Read Display Format Setting
-    int date_format_index = ASettings::read(ASettings::Main::DateFormat).toInt();
-    const QString date_format_string = ADate::getFormatString(
+    int date_format_index = Settings::read(Settings::Main::DateFormat).toInt();
+    const QString date_format_string = OPL::DateTime::getFormatString(
                 static_cast<OPL::DateFormat>(date_format_index));
     const auto date_edits = this->findChildren<QDateEdit*>();
     for (const auto &date_edit : date_edits) {
@@ -106,7 +106,7 @@ void SettingsWidget::loadBackupWidget()
 }
 
 /*!
- * \brief SettingsWidget::readSettings Reads settings from ASettings and sets up the UI accordingly
+ * \brief SettingsWidget::readSettings Reads settings from Settings and sets up the UI accordingly
  */
 void SettingsWidget::readSettings()
 {
@@ -122,29 +122,29 @@ void SettingsWidget::readSettings()
     ui->emailLineEdit->setText(user_data.value(OPL::Db::PILOTS_EMAIL).toString());
 
     // FLight Logging Tab
-    ui->functionComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::Function).toInt());
-    ui->rulesComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::LogIFR).toInt());
-    ui->approachComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::Approach).toInt());
-    ui->nightComboBox->setCurrentIndex(ASettings::read(ASettings::FlightLogging::NightLoggingEnabled).toInt());
-    ui->prefixLineEdit->setText(ASettings::read(ASettings::FlightLogging::FlightNumberPrefix).toString());
+    ui->functionComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::Function).toInt());
+    ui->rulesComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::LogIFR).toInt());
+    ui->approachComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::Approach).toInt());
+    ui->nightComboBox->setCurrentIndex(Settings::read(Settings::FlightLogging::NightLoggingEnabled).toInt());
+    ui->prefixLineEdit->setText(Settings::read(Settings::FlightLogging::FlightNumberPrefix).toString());
 
-    ui->logbookViewComboBox->setCurrentIndex(ASettings::read(ASettings::Main::LogbookView).toInt());
-    ui->aliasComboBox->setCurrentIndex(ASettings::read(ASettings::UserData::DisplaySelfAs).toInt());
+    ui->logbookViewComboBox->setCurrentIndex(Settings::read(Settings::Main::LogbookView).toInt());
+    ui->aliasComboBox->setCurrentIndex(Settings::read(Settings::UserData::DisplaySelfAs).toInt());
 
     // Currencies Tab
-    ui->currToLdgCheckBox->setChecked(ASettings::read(ASettings::UserData::ShowToLgdCurrency).toBool());
-    ui->currLicCheckBox->setChecked(ASettings::read(ASettings::UserData::ShowLicCurrency).toBool());
-    ui->currTrCheckBox->setChecked(ASettings::read(ASettings::UserData::ShowTrCurrency).toBool());
-    ui->currLckCheckBox->setChecked(ASettings::read(ASettings::UserData::ShowLckCurrency).toBool());
-    ui->currMedCheckBox->setChecked(ASettings::read(ASettings::UserData::ShowMedCurrency).toBool());
-    ui->currCustom1CheckBox->setChecked(ASettings::read(ASettings::UserData::ShowCustom1Currency).toBool());
-    ui->currCustom2CheckBox->setChecked(ASettings::read(ASettings::UserData::ShowCustom2Currency).toBool());
-    ui->currCustom1LineEdit->setText(ASettings::read(ASettings::UserData::Custom1CurrencyName).toString());
-    ui->currCustom2LineEdit->setText(ASettings::read(ASettings::UserData::Custom2CurrencyName).toString());
+    ui->currToLdgCheckBox->setChecked(Settings::read(Settings::UserData::ShowToLgdCurrency).toBool());
+    ui->currLicCheckBox->setChecked(Settings::read(Settings::UserData::ShowLicCurrency).toBool());
+    ui->currTrCheckBox->setChecked(Settings::read(Settings::UserData::ShowTrCurrency).toBool());
+    ui->currLckCheckBox->setChecked(Settings::read(Settings::UserData::ShowLckCurrency).toBool());
+    ui->currMedCheckBox->setChecked(Settings::read(Settings::UserData::ShowMedCurrency).toBool());
+    ui->currCustom1CheckBox->setChecked(Settings::read(Settings::UserData::ShowCustom1Currency).toBool());
+    ui->currCustom2CheckBox->setChecked(Settings::read(Settings::UserData::ShowCustom2Currency).toBool());
+    ui->currCustom1LineEdit->setText(Settings::read(Settings::UserData::Custom1CurrencyName).toString());
+    ui->currCustom2LineEdit->setText(Settings::read(Settings::UserData::Custom2CurrencyName).toString());
 
     // Misc Tab
-    ui->acftSortComboBox->setCurrentIndex(ASettings::read(ASettings::UserData::TailSortColumn).toInt());
-    ui->pilotSortComboBox->setCurrentIndex(ASettings::read(ASettings::UserData::PilotSortColumn).toInt());
+    ui->acftSortComboBox->setCurrentIndex(Settings::read(Settings::UserData::TailSortColumn).toInt());
+    ui->pilotSortComboBox->setCurrentIndex(Settings::read(Settings::UserData::PilotSortColumn).toInt());
 
     // Don't emit signals for OPL::Style changes during setup
     const QSignalBlocker style_blocker(ui->styleComboBox);
@@ -152,10 +152,10 @@ void SettingsWidget::readSettings()
     const QSignalBlocker font_blocker_2(ui->fontComboBox);
     const QSignalBlocker font_blocker_3(ui->fontCheckBox);
 
-    ui->styleComboBox->setCurrentText(ASettings::read(ASettings::Main::Style).toString());
-    ui->fontSpinBox->setValue(ASettings::read(ASettings::Main::FontSize).toUInt());
-    ui->fontComboBox->setCurrentFont(QFont(ASettings::read(ASettings::Main::Font).toString()));
-    bool use_system_font = ASettings::read(ASettings::Main::UseSystemFont).toBool();
+    ui->styleComboBox->setCurrentText(Settings::read(Settings::Main::Style).toString());
+    ui->fontSpinBox->setValue(Settings::read(Settings::Main::FontSize).toUInt());
+    ui->fontComboBox->setCurrentFont(QFont(Settings::read(Settings::Main::Font).toString()));
+    bool use_system_font = Settings::read(Settings::Main::UseSystemFont).toBool();
     ui->fontCheckBox->setChecked(use_system_font);
     if (!use_system_font) {
         ui->fontComboBox->setEnabled(true);
@@ -268,43 +268,43 @@ void SettingsWidget::on_phoneLineEdit_editingFinished()
 
 void SettingsWidget::on_aliasComboBox_currentIndexChanged(int index)
 {
-    ASettings::write(ASettings::UserData::DisplaySelfAs, index);
+    Settings::write(Settings::UserData::DisplaySelfAs, index);
     updatePersonalDetails();
 }
 
 void SettingsWidget::on_functionComboBox_currentIndexChanged(int arg1)
 {
-    ASettings::write(ASettings::FlightLogging::Function, arg1);
+    Settings::write(Settings::FlightLogging::Function, arg1);
 }
 
 void SettingsWidget::on_rulesComboBox_currentIndexChanged(int arg1)
 {
-    ASettings::write(ASettings::FlightLogging::LogIFR, arg1);
+    Settings::write(Settings::FlightLogging::LogIFR, arg1);
 }
 
 void SettingsWidget::on_approachComboBox_currentIndexChanged(int arg1)
 {
-    ASettings::write(ASettings::FlightLogging::Approach, arg1);
+    Settings::write(Settings::FlightLogging::Approach, arg1);
 }
 
 void SettingsWidget::on_nightComboBox_currentIndexChanged(int index)
 {
-    ASettings::write(ASettings::FlightLogging::NightLoggingEnabled, index);
+    Settings::write(Settings::FlightLogging::NightLoggingEnabled, index);
     switch (index) {
     case 1:
-        ASettings::write(ASettings::FlightLogging::NightAngle, -6);
+        Settings::write(Settings::FlightLogging::NightAngle, -6);
         break;
     case 2:
-        ASettings::write(ASettings::FlightLogging::NightAngle, 0);
+        Settings::write(Settings::FlightLogging::NightAngle, 0);
         break;
     default:
-        ASettings::write(ASettings::FlightLogging::NightAngle, -6);
+        Settings::write(Settings::FlightLogging::NightAngle, -6);
     }
 }
 
 void SettingsWidget::on_prefixLineEdit_textChanged(const QString &arg1)
 {
-    ASettings::write(ASettings::FlightLogging::FlightNumberPrefix, arg1);
+    Settings::write(Settings::FlightLogging::FlightNumberPrefix, arg1);
 
 }
 
@@ -314,18 +314,18 @@ void SettingsWidget::on_prefixLineEdit_textChanged(const QString &arg1)
 
 void SettingsWidget::on_logbookViewComboBox_currentIndexChanged(int index)
 {
-    ASettings::write(ASettings::Main::LogbookView, index);
+    Settings::write(Settings::Main::LogbookView, index);
     emit settingChanged(SettingSignal::LogbookWidget);
 }
 void SettingsWidget::on_pilotSortComboBox_currentIndexChanged(int index)
 {
-    ASettings::write(ASettings::UserData::PilotSortColumn, index);
+    Settings::write(Settings::UserData::PilotSortColumn, index);
     emit settingChanged(PilotsWidget);
 }
 
 void SettingsWidget::on_acftSortComboBox_currentIndexChanged(int index)
 {
-    ASettings::write(ASettings::UserData::TailSortColumn, index);
+    Settings::write(Settings::UserData::TailSortColumn, index);
     emit settingChanged(AircraftWidget);
 }
 
@@ -387,14 +387,14 @@ void SettingsWidget::on_styleComboBox_currentTextChanged(const QString& new_styl
 {
     if (new_style_setting == QLatin1String("Dark-Palette")) {
         OPL::Style::setStyle(OPL::Style::darkPalette());
-        ASettings::write(ASettings::Main::Style, new_style_setting);
+        Settings::write(Settings::Main::Style, new_style_setting);
         emit settingChanged(MainWindow);
         return;
     }
     for (const auto &style_name : OPL::Style::styles) {
         if (new_style_setting == style_name) {
             OPL::Style::setStyle(style_name);
-            ASettings::write(ASettings::Main::Style, new_style_setting);
+            Settings::write(Settings::Main::Style, new_style_setting);
             emit settingChanged(MainWindow);
             return;
         }
@@ -403,7 +403,7 @@ void SettingsWidget::on_styleComboBox_currentTextChanged(const QString& new_styl
     for (const auto &style_sheet : OPL::Style::styleSheets) {
         if (new_style_setting == style_sheet.styleSheetName) {
             OPL::Style::setStyle(style_sheet);
-            ASettings::write(ASettings::Main::Style, new_style_setting);
+            Settings::write(Settings::Main::Style, new_style_setting);
             emit settingChanged(MainWindow);
             return;
         }
@@ -413,7 +413,7 @@ void SettingsWidget::on_styleComboBox_currentTextChanged(const QString& new_styl
 void SettingsWidget::on_fontComboBox_currentFontChanged(const QFont &f)
 {
     qApp->setFont(f);
-    ASettings::write(ASettings::Main::Font, f.toString());
+    Settings::write(Settings::Main::Font, f.toString());
     DEB << "Setting Font:" << f.toString();
 }
 
@@ -422,7 +422,7 @@ void SettingsWidget::on_fontSpinBox_valueChanged(int arg1)
     QFont f = qApp->font();
     f.setPointSize(arg1);
     qApp->setFont(f);
-    ASettings::write(ASettings::Main::FontSize, arg1);
+    Settings::write(Settings::Main::FontSize, arg1);
     DEB << "Setting Font:" << f.toString();
 }
 
@@ -438,7 +438,7 @@ void SettingsWidget::on_fontCheckBox_stateChanged(int arg1)
     {
         ui->fontComboBox->setEnabled(true);
         ui->fontSpinBox->setEnabled(true);
-        ASettings::write(ASettings::Main::UseSystemFont, false);
+        Settings::write(Settings::Main::UseSystemFont, false);
         QFont font(ui->fontComboBox->currentFont());
         font.setPointSize(ui->fontSpinBox->value());
         qApp->setFont(font);
@@ -449,7 +449,7 @@ void SettingsWidget::on_fontCheckBox_stateChanged(int arg1)
     {
         ui->fontComboBox->setEnabled(false);
         ui->fontSpinBox->setEnabled(false);
-        ASettings::write(ASettings::Main::UseSystemFont, true);
+        Settings::write(Settings::Main::UseSystemFont, true);
         INFO(tr("The application will be restarted for this change to take effect."));
         qApp->quit();
         QProcess::startDetached(qApp->arguments()[0], qApp->arguments());
@@ -546,10 +546,10 @@ void SettingsWidget::on_currToLdgCheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowToLgdCurrency, true);
+        Settings::write(Settings::UserData::ShowToLgdCurrency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowToLgdCurrency, false);
+        Settings::write(Settings::UserData::ShowToLgdCurrency, false);
         break;
     default:
         break;
@@ -561,10 +561,10 @@ void SettingsWidget::on_currLicCheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowLicCurrency, true);
+        Settings::write(Settings::UserData::ShowLicCurrency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowLicCurrency, false);
+        Settings::write(Settings::UserData::ShowLicCurrency, false);
         break;
     default:
         break;
@@ -576,10 +576,10 @@ void SettingsWidget::on_currTrCheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowTrCurrency, true);
+        Settings::write(Settings::UserData::ShowTrCurrency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowTrCurrency, false);
+        Settings::write(Settings::UserData::ShowTrCurrency, false);
         break;
     default:
         break;
@@ -591,10 +591,10 @@ void SettingsWidget::on_currLckCheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowLckCurrency, true);
+        Settings::write(Settings::UserData::ShowLckCurrency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowLckCurrency, false);
+        Settings::write(Settings::UserData::ShowLckCurrency, false);
         break;
     default:
         break;
@@ -606,10 +606,10 @@ void SettingsWidget::on_currMedCheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowMedCurrency, true);
+        Settings::write(Settings::UserData::ShowMedCurrency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowMedCurrency, false);
+        Settings::write(Settings::UserData::ShowMedCurrency, false);
         break;
     default:
         break;
@@ -621,10 +621,10 @@ void SettingsWidget::on_currCustom1CheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowCustom1Currency, true);
+        Settings::write(Settings::UserData::ShowCustom1Currency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowCustom1Currency, false);
+        Settings::write(Settings::UserData::ShowCustom1Currency, false);
         break;
     default:
         break;
@@ -636,10 +636,10 @@ void SettingsWidget::on_currCustom2CheckBox_stateChanged(int arg1)
 {
     switch (arg1) {
     case Qt::CheckState::Checked:
-        ASettings::write(ASettings::UserData::ShowCustom2Currency, true);
+        Settings::write(Settings::UserData::ShowCustom2Currency, true);
         break;
     case Qt::CheckState::Unchecked:
-        ASettings::write(ASettings::UserData::ShowCustom2Currency, false);
+        Settings::write(Settings::UserData::ShowCustom2Currency, false);
         break;
     default:
         break;
@@ -649,12 +649,12 @@ void SettingsWidget::on_currCustom2CheckBox_stateChanged(int arg1)
 
 void SettingsWidget::on_currCustom1LineEdit_editingFinished()
 {
-    ASettings::write(ASettings::UserData::Custom1CurrencyName, ui->currCustom1LineEdit->text());
+    Settings::write(Settings::UserData::Custom1CurrencyName, ui->currCustom1LineEdit->text());
 }
 
 void SettingsWidget::on_currCustom2LineEdit_editingFinished()
 {
-    ASettings::write(ASettings::UserData::Custom2CurrencyName, ui->currCustom2LineEdit->text());
+    Settings::write(Settings::UserData::Custom2CurrencyName, ui->currCustom2LineEdit->text());
 }
 
 void SettingsWidget::on_languageComboBox_activated(int arg1)

+ 1 - 1
src/gui/widgets/settingswidget.h

@@ -33,7 +33,7 @@ class SettingsWidget;
  * \brief The SettingsWidget is used to to display and alter Settings.
  *
  * \details Most Inputs are collected and processed in various slots and
- * written to the settings file via the ASettings class. In the `Personal` Settings
+ * written to the settings file via the Settings class. In the `Personal` Settings
  * tab, the user can edit his personal details, which are then written to the Database
  * (The Logbook owner is registered in the Pilots Database with `pilot_id = 1`).
  */

+ 2 - 2
src/testing/importCrewlounge/importcrewlounge.cpp

@@ -5,7 +5,7 @@
 #include "src/testing/importCrewlounge/processpilots.h"
 #include "src/testing/importCrewlounge/processaircraft.h"
 #include "src/testing/importCrewlounge/processflights.h"
-#include "src/functions/areadcsv.h"
+#include "src/functions/readcsv.h"
 
 namespace ImportCrewlounge
 {
@@ -21,7 +21,7 @@ void exec(const QString &csv_file_path)
     q.exec();
 
     // Read from CSV and remove first line (headers)
-    auto raw_csv_data = aReadCsvAsRows(csv_file_path);
+    auto raw_csv_data = CSV::readCsvAsRows(csv_file_path);
     raw_csv_data.removeFirst();
 
     // Process Pilots