diff --git a/src/additive/additive.h b/src/additive/additive.h index e3581e3..67e0f46 100644 --- a/src/additive/additive.h +++ b/src/additive/additive.h @@ -17,7 +17,6 @@ class Additive : public QObject, public Meta { Q_OBJECT public: - /** * @brief Index for additive type */ @@ -61,12 +60,12 @@ class Additive : public QObject, public Meta { Additive(const QJsonObject& json); /**< @brief Create Additive from JSON */ // setter and getter - float get(Value what) const; /**< @brief get requested amount */ - void set(Value what, float value); /**< @brief set given type with amount */ + float get(Value what) const; /**< @brief get requested amount */ + void set(Value what, float value); /**< @brief set given type with amount */ // JSON conversion - bool fromJson(const QJsonObject& json); /**< @brief Update Additive from JSON */ - QJsonObject toJson() const; /**< @brief convert this Additive to JSON */ + bool fromJson(const QJsonObject& json); /**< @brief Update Additive from JSON */ + QJsonObject toJson() const; /**< @brief convert this Additive to JSON */ /** * @brief Additive::operator + calculates effect of additive to water values diff --git a/src/additive/additivewindow.h b/src/additive/additivewindow.h index 0d5a8fd..2712844 100644 --- a/src/additive/additivewindow.h +++ b/src/additive/additivewindow.h @@ -19,8 +19,7 @@ /** * @brief Window for managing your additions */ -class AdditiveWindow : public QWidget -{ +class AdditiveWindow : public QWidget { Q_OBJECT public: @@ -47,4 +46,4 @@ class AdditiveWindow : public QWidget QComboBox* unitSelect; }; -#endif // ADDITIVEWINDOW_H +#endif // ADDITIVEWINDOW_H diff --git a/src/common/jsonhelper.h b/src/common/jsonhelper.h index 2fc1b04..24bd82e 100644 --- a/src/common/jsonhelper.h +++ b/src/common/jsonhelper.h @@ -9,8 +9,7 @@ /** * @brief Class with common JSON functions */ -class JsonHelper -{ +class JsonHelper { public: JsonHelper() = delete; @@ -37,4 +36,4 @@ class JsonHelper static void mergeJson(QJsonObject& into, const QJsonObject from); }; -#endif // JSONHELPER_H +#endif // JSONHELPER_H diff --git a/src/common/meta.cpp b/src/common/meta.cpp index 57366bc..b0a4260 100644 --- a/src/common/meta.cpp +++ b/src/common/meta.cpp @@ -40,13 +40,11 @@ void Meta::setName(const QString& newName) { updateEditTime(); } -void Meta::updateEditTime() -{ +void Meta::updateEditTime() { edit = QDateTime::currentDateTime(); } -void Meta::updateCreationTime() -{ +void Meta::updateCreationTime() { create = QDateTime::currentDateTime(); } diff --git a/src/main.cpp b/src/main.cpp index 45cb823..8820cfc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,7 @@ #include #include -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) { QApplication a(argc, argv); a.setOrganizationName("jo-hannes"); @@ -19,7 +19,7 @@ int main(int argc, char *argv[]) { QTranslator trMyApp; QTranslator trQt; const QStringList uiLanguages = QLocale::system().uiLanguages(); - for (const QString &locale : uiLanguages) { + for (const QString& locale : uiLanguages) { const QString languageCode = QLocale::languageToCode(QLocale(locale).language()); if (trMyApp.load(":/i18n/Aqua-mixtura_" + languageCode)) { a.installTranslator(&trMyApp); diff --git a/src/mainmodel.h b/src/mainmodel.h index 6627c5c..bb28377 100644 --- a/src/mainmodel.h +++ b/src/mainmodel.h @@ -19,11 +19,11 @@ class MainModel : public QObject { MainModel(); public slots: - void load(); /**< @brief Load all data from JSON files */ - void save(); /**< @brief Save all data to JSON files */ + void load(); /**< @brief Load all data from JSON files */ + void save(); /**< @brief Save all data to JSON files */ public: Mixtures mixtures; /**< @brief Model of mixtures */ }; -#endif // MAINMODEL_H +#endif // MAINMODEL_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 420acf4..5f540fa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -88,8 +88,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { setCentralWidget(mainWidget); } -MainWindow::~MainWindow() { -} +MainWindow::~MainWindow() {} void MainWindow::closeEvent(QCloseEvent* event) { // close all other windows diff --git a/src/mainwindow.h b/src/mainwindow.h index d7e4088..4c74f4c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -7,8 +7,8 @@ #include "mainmodel.h" #include "additive/additivewindow.h" -#include "settings/settingswindow.h" #include "malt/maltwindow.h" +#include "settings/settingswindow.h" #include "style/styleswindow.h" #include "water/watersourcewindow.h" @@ -40,11 +40,11 @@ class MainWindow : public QMainWindow { void settings(); /**< @brief Slot to show window with settings */ // mixtures slots - void mixAdd(); /**< @brief Slot for adding a new mixture */ - void mixCopy(); /**< @brief Slot to copy the currently selected mixture */ - void mixDelete(); /**< @brief Slot to delete the currently selected mixture */ - void mixImport(); /**< @brief Slot for importing a mixture form JSON */ - void mixExport(); /**< @brief Slot for exporting a mixture to JSON */ + void mixAdd(); /**< @brief Slot for adding a new mixture */ + void mixCopy(); /**< @brief Slot to copy the currently selected mixture */ + void mixDelete(); /**< @brief Slot to delete the currently selected mixture */ + void mixImport(); /**< @brief Slot for importing a mixture form JSON */ + void mixExport(); /**< @brief Slot for exporting a mixture to JSON */ void mixDoubleClicked(const QModelIndex& idx); /**< @brief Slot for double clicks on mixtures */ private: diff --git a/src/malt/malt.h b/src/malt/malt.h index af0c8b2..778fd19 100644 --- a/src/malt/malt.h +++ b/src/malt/malt.h @@ -65,13 +65,13 @@ class Malt : public Meta { static float calcualtePhRoestmalz(); // JSON conversion - bool fromJson(const QJsonObject& json); /**< @brief Update Malt from JSON */ - QJsonObject toJson() const; /**< @brief convert this Malt to JSON */ + bool fromJson(const QJsonObject& json); /**< @brief Update Malt from JSON */ + QJsonObject toJson() const; /**< @brief convert this Malt to JSON */ private: - float mass; /**< Amount of malt in kg */ - float ebc; /**< Color of malt in EBC */ - float ph; /**< pH of malt in purified water */ + float mass; /**< Amount of malt in kg */ + float ebc; /**< Color of malt in EBC */ + float ph; /**< pH of malt in purified water */ }; -#endif // MALT_H +#endif // MALT_H diff --git a/src/malt/maltphedit.cpp b/src/malt/maltphedit.cpp index becf264..0508e0b 100644 --- a/src/malt/maltphedit.cpp +++ b/src/malt/maltphedit.cpp @@ -8,9 +8,7 @@ #include #include -MaltPhEdit::MaltPhEdit(QWidget *parent) - : QWidget{parent} -{ +MaltPhEdit::MaltPhEdit(QWidget* parent) : QWidget{parent} { QGridLayout* mainLayout = new QGridLayout(this); // malt names QLabel* txtMalt = new QLabel(tr("Malze <120 EBC") + ":"); diff --git a/src/malt/maltphedit.h b/src/malt/maltphedit.h index 4ebe7f9..fd26ada 100644 --- a/src/malt/maltphedit.h +++ b/src/malt/maltphedit.h @@ -8,8 +8,7 @@ #include #include -class MaltPhEdit : public QWidget -{ +class MaltPhEdit : public QWidget { Q_OBJECT public: explicit MaltPhEdit(QWidget* parent = nullptr); @@ -33,4 +32,4 @@ class MaltPhEdit : public QWidget QDoubleSpinBox* phSpinBox; }; -#endif // MALTPHEDIT_H +#endif // MALTPHEDIT_H diff --git a/src/malt/malts.cpp b/src/malt/malts.cpp index 8b4bc5a..6019eaa 100644 --- a/src/malt/malts.cpp +++ b/src/malt/malts.cpp @@ -199,8 +199,7 @@ Qt::ItemFlags Malts::flags(const QModelIndex& index) const { return Qt::ItemIsEditable | QAbstractItemModel::flags(index); } -void Malts::load() -{ +void Malts::load() { const QString fileName = "malts.json"; Download::loadDefaults(fileName); QString file = Paths::dataDir() + "/" + fileName; @@ -209,8 +208,7 @@ void Malts::load() } } -void Malts::save() -{ +void Malts::save() { QString file = Paths::dataDir() + "/malts.json"; JsonHelper::saveFile(file, this->toJson()); setChanged(false); diff --git a/src/malt/malts.h b/src/malt/malts.h index 632ccd6..aa4fac2 100644 --- a/src/malt/malts.h +++ b/src/malt/malts.h @@ -18,14 +18,14 @@ class Malts : public QAbstractTableModel { Malts(const QJsonObject& json); /**< @brief Create Malts from JSON */ // JSON conversion - bool fromJson(const QJsonObject& json); /**< @brief Update Malts from JSON */ - QJsonObject toJson() const; /**< @brief convert this Malts to JSON */ - bool importMalt(const QString& path); /**< @brief import and add a Malt from JSON */ + bool fromJson(const QJsonObject& json); /**< @brief Update Malts from JSON */ + QJsonObject toJson() const; /**< @brief convert this Malts to JSON */ + bool importMalt(const QString& path); /**< @brief import and add a Malt from JSON */ bool exportMalt(const QString& path, qsizetype i) const; /**< @brief export a Malt at index as JSON */ - const Malt& getMalt(qsizetype i); /**< @brief Get malt at index */ - void addMalt(const Malt& malt); /**< @brief Add a malt */ - void deleteMalt(qsizetype i); /**< @brief Delete malt at index */ + const Malt& getMalt(qsizetype i); /**< @brief Get malt at index */ + void addMalt(const Malt& malt); /**< @brief Add a malt */ + void deleteMalt(qsizetype i); /**< @brief Delete malt at index */ bool isChanged() const; /**< @brief True if changes not saved */ diff --git a/src/malt/malttabledelegate.h b/src/malt/malttabledelegate.h index cbb8671..089df35 100644 --- a/src/malt/malttabledelegate.h +++ b/src/malt/malttabledelegate.h @@ -4,8 +4,8 @@ #ifndef MALTTABLEDELEGATE_H #define MALTTABLEDELEGATE_H -#include #include +#include /** * @brief Delegate to use a spin box for entering the EBC value of a malt diff --git a/src/malt/maltwindow.h b/src/malt/maltwindow.h index 39eee2d..c22a4f0 100644 --- a/src/malt/maltwindow.h +++ b/src/malt/maltwindow.h @@ -24,12 +24,12 @@ class MaltWindow : public QWidget { void closeEvent(QCloseEvent* event) override; private slots: - void maltAdd(); /**< @brief Slot for adding a new malt */ - void maltCopy(); /**< @brief Slot to copy the currently selected malt */ - void maltDelete(); /**< @brief Slot to delete the currently selected malt */ - void maltImport(); /**< @brief Slot for importing a malt form JSON */ - void maltExport(); /**< @brief Slot for exporting a malt to JSON */ - void unsavedMalts(); /**< @brief Slot for checking if unsaved changes exist */ + void maltAdd(); /**< @brief Slot for adding a new malt */ + void maltCopy(); /**< @brief Slot to copy the currently selected malt */ + void maltDelete(); /**< @brief Slot to delete the currently selected malt */ + void maltImport(); /**< @brief Slot for importing a malt form JSON */ + void maltExport(); /**< @brief Slot for exporting a malt to JSON */ + void unsavedMalts(); /**< @brief Slot for checking if unsaved changes exist */ signals: void load(); @@ -42,4 +42,4 @@ class MaltWindow : public QWidget { QString title; /**< @brief Window tittle */ }; -#endif // MALTWINDOW_H +#endif // MALTWINDOW_H diff --git a/src/mixture/mixadditivewidget.h b/src/mixture/mixadditivewidget.h index 561a5c5..903cb3a 100644 --- a/src/mixture/mixadditivewidget.h +++ b/src/mixture/mixadditivewidget.h @@ -38,7 +38,7 @@ class MixAdditiveWidget : public QFrame { QLabel* liquidUnit; /**< @brief Unit for liquids */ QLabel* percents[static_cast(Additive::Value::lastLiquid) + 1]; /**< @brief Weight percent for liquids */ - QDoubleSpinBox* amounts[static_cast(Additive::Value::Size)]; /** @brief Spin boxes of additive */ + QDoubleSpinBox* amounts[static_cast(Additive::Value::Size)]; /**< @brief Spin boxes of additive */ }; #endif // MIXADDITIVEWIDGET_H diff --git a/src/mixture/mixture.h b/src/mixture/mixture.h index 3b97d04..94afa72 100644 --- a/src/mixture/mixture.h +++ b/src/mixture/mixture.h @@ -40,4 +40,4 @@ class Mixture : public Meta { QString path; }; -#endif // MIXTURE_H +#endif // MIXTURE_H diff --git a/src/mixture/mixtures.cpp b/src/mixture/mixtures.cpp index 4b17c0d..e4da0a3 100644 --- a/src/mixture/mixtures.cpp +++ b/src/mixture/mixtures.cpp @@ -8,8 +8,7 @@ #include -Mixtures::Mixtures(QObject* parent) : QAbstractTableModel{parent} { -} +Mixtures::Mixtures(QObject* parent) : QAbstractTableModel{parent} {} Mixtures::Mixtures(const QJsonObject& json, QObject* parent) : Mixtures(parent) { fromJson(json); @@ -193,16 +192,14 @@ QVariant Mixtures::headerData(int section, Qt::Orientation orientation, int role } } -void Mixtures::load() -{ +void Mixtures::load() { QString file = Paths::dataDir() + "/mixtures.json"; if (QFile::exists(file)) { this->fromJson(JsonHelper::loadFile(file)); } } -void Mixtures::save() -{ +void Mixtures::save() { QString file = Paths::dataDir() + "/mixtures.json"; JsonHelper::saveFile(file, this->toJson()); } diff --git a/src/style/style.h b/src/style/style.h index da72bcc..445c766 100644 --- a/src/style/style.h +++ b/src/style/style.h @@ -58,4 +58,4 @@ class Style : public QAbstractTableModel, public Meta { static const inline QString jsonKeys[static_cast(Limit::Size)] = {"Min", "Target", "Max"}; }; -#endif // STYLE_H +#endif // STYLE_H diff --git a/src/style/styles.cpp b/src/style/styles.cpp index b1c7c32..d693fd2 100644 --- a/src/style/styles.cpp +++ b/src/style/styles.cpp @@ -130,8 +130,7 @@ QVariant Styles::data(const QModelIndex& index, int role) const { return styles.at(row)->getName(); } -void Styles::load() -{ +void Styles::load() { const QString fileName = "styles.json"; Download::loadDefaults(fileName); QString file = Paths::dataDir() + "/" + fileName; @@ -140,8 +139,7 @@ void Styles::load() } } -void Styles::save() -{ +void Styles::save() { QString file = Paths::dataDir() + "/styles.json"; JsonHelper::saveFile(file, this->toJson()); setChanged(false); diff --git a/src/style/styles.h b/src/style/styles.h index df93b6a..8a8a043 100644 --- a/src/style/styles.h +++ b/src/style/styles.h @@ -19,9 +19,9 @@ class Styles : public QAbstractListModel { ~Styles(); // JSON conversion - bool fromJson(const QJsonObject& json); /**< @brief Update Styles from JSON */ - QJsonObject toJson() const; /**< @brief convert Styles to JSON */ - bool importStyle(const QString& path); /**< @brief import and add a Style from JSON */ + bool fromJson(const QJsonObject& json); /**< @brief Update Styles from JSON */ + QJsonObject toJson() const; /**< @brief convert Styles to JSON */ + bool importStyle(const QString& path); /**< @brief import and add a Style from JSON */ bool exportStyle(const QString& path, qsizetype i) const; /**< @brief export a Style at index as JSON */ Style* getStyle(qsizetype i); /**< @brief Get style at index */ @@ -48,7 +48,7 @@ class Styles : public QAbstractListModel { void clear(); /**< @brief Clear/remove all Styles*/ QVector styles; - Style* noStyle; /**< @brief Empty style used to return no style on error */ + Style* noStyle; /**< @brief Empty style used to return no style on error */ }; -#endif // STYLES_H +#endif // STYLES_H diff --git a/src/water/water.h b/src/water/water.h index e7f5d2b..6d3fee1 100644 --- a/src/water/water.h +++ b/src/water/water.h @@ -85,8 +85,8 @@ class Water : public Meta { void set(Value what, float value); /**< @brief set given type with value */ // JSON conversion - bool fromJson(const QJsonObject& json); /**< @brief Update Water from JSON */ - QJsonObject toJson() const; /**< @brief convert this Water to JSON */ + bool fromJson(const QJsonObject& json); /**< @brief Update Water from JSON */ + QJsonObject toJson() const; /**< @brief convert this Water to JSON */ QJsonObject profileToJson() const; /**< @brief convert this Water profile to JSON (A profile is without volume) */ // Operators @@ -155,4 +155,4 @@ class Water : public Meta { float values[static_cast(Value::LastAnion) + 1]; }; -#endif // WATER_H +#endif // WATER_H diff --git a/src/water/waterprofileedit.h b/src/water/waterprofileedit.h index 3792de5..bf36725 100644 --- a/src/water/waterprofileedit.h +++ b/src/water/waterprofileedit.h @@ -13,8 +13,7 @@ #include #include -class WaterProfileEdit : public QWidget -{ +class WaterProfileEdit : public QWidget { Q_OBJECT public: @@ -56,4 +55,4 @@ class WaterProfileEdit : public QWidget QLabel *restalkallität, *gesammtHaerte, *carbonHaerte, *caHaerte, *mgHaerte, *nichtcarbonHaerte, *so4cl; }; -#endif // WATERPROFILEEDIT_H +#endif // WATERPROFILEEDIT_H diff --git a/src/water/watersources.h b/src/water/watersources.h index 979e4e1..e55ef6b 100644 --- a/src/water/watersources.h +++ b/src/water/watersources.h @@ -25,11 +25,11 @@ class WaterSources : public QAbstractTableModel { // bool import(const QString& path); - const Water& getProfile(qsizetype i); /**< @brief Get water profile at index */ - Water getMix(); /**< @brief Get mixture of all waters */ - void updateProfile(Water& profile, qsizetype i); /**< @brief Update water profile at index */ - void addProfile(const Water& profile); /**< @brief Add a water profile */ - void deleteProfile(qsizetype i); /**< @brief Delete water profile at index */ + const Water& getProfile(qsizetype i); /**< @brief Get water profile at index */ + Water getMix(); /**< @brief Get mixture of all waters */ + void updateProfile(Water& profile, qsizetype i); /**< @brief Update water profile at index */ + void addProfile(const Water& profile); /**< @brief Add a water profile */ + void deleteProfile(qsizetype i); /**< @brief Delete water profile at index */ // for QAbstractTableModel, see QT documentation for details int rowCount(const QModelIndex& parent = QModelIndex()) const; @@ -51,4 +51,4 @@ class WaterSources : public QAbstractTableModel { Water noWater; }; -#endif // WATERSOURCES_H +#endif // WATERSOURCES_H diff --git a/translations/Aqua-mixtura_de.ts b/translations/Aqua-mixtura_de.ts index 5d668a0..ed0269c 100644 --- a/translations/Aqua-mixtura_de.ts +++ b/translations/Aqua-mixtura_de.ts @@ -147,108 +147,108 @@ - + Aufbereitung importieren Aufbereitung importieren - + Aufbereitung exportieren Aufbereitung exportieren - + Rechner zur Wasseraufbereitung fürs Bierbrauen.<br><br><a href="https://github.com/jo-hannes/Aqua-mixtura">github.com/jo-hannes/Aqua-mixtura</a> Rechner zur Wasseraufbereitung fürs Bierbrauen.<br><br><a href="https://github.com/jo-hannes/Aqua-mixtura">github.com/jo-hannes/Aqua-mixtura</a> - + Aufbereitung wirklich löschen? Aufbereitung wirklich löschen? - + Exit Beenden - + About Über - + About Qt Über Qt - + File Datei - + Help Hilfe - + JSON (*.json);; Any (*.*) JSON (*.json);; Alle (*.*) - + Fehler beim Importieren Fehler beim Importieren - + Konnte Aufbereitung nicht im JSON finden Konnte Aufbereitung nicht im JSON finden - + Fehler beim Exportieren Fehler beim Exportieren - + Konnte Aufbereitung nicht speichern Konnte Aufbereitung nicht speichern - + Preferences... Einstellungen - + Die Anwendung Konfigurieren Die Anwendung Konfigurieren - + Save Speichern - + Save changes Änderungen speichern - + Exit the application Anwendung Beenden - + Show the application's About box Zeigt Informationen über diese Anwendungen - + Show the Qt library's About box Zeigt Informationen über die Qt library @@ -256,24 +256,24 @@ MaltPhEdit - + Malze <120 EBC Malze <120 EBC - + Caramalz Caramalz - + Röstmalz Röstmalz - - - + + + Wert übernehmen Wert übernehmen @@ -488,17 +488,17 @@ Mixtures - + Name Name - + Erstellt Erstellt - + Geändert Geändert diff --git a/translations/Aqua-mixtura_en.ts b/translations/Aqua-mixtura_en.ts index 0f8fedf..04ce855 100644 --- a/translations/Aqua-mixtura_en.ts +++ b/translations/Aqua-mixtura_en.ts @@ -147,108 +147,108 @@ - + Aufbereitung importieren Import mixture - + Aufbereitung exportieren Export mixture - + Rechner zur Wasseraufbereitung fürs Bierbrauen.<br><br><a href="https://github.com/jo-hannes/Aqua-mixtura">github.com/jo-hannes/Aqua-mixtura</a> Calculator for water treatment for beer brewing.<br><br><a href="https://github.com/jo-hannes/Aqua-mixtura">github.com/jo-hannes/Aqua-mixtura</a> - + Aufbereitung wirklich löschen? Really delete mixture? - + Exit Exit - + About About - + About Qt About Qt - + File File - + Help Help - + JSON (*.json);; Any (*.*) JSON (*.json);; Any (*.*) - + Fehler beim Importieren Error during import - + Konnte Aufbereitung nicht im JSON finden Could not find mixture in JSON - + Fehler beim Exportieren Error during export - + Konnte Aufbereitung nicht speichern Could not save mixture - + Preferences... Preferences... - + Die Anwendung Konfigurieren Configuring the application - + Save Save - + Save changes Save changes - + Exit the application Exit the application - + Show the application's About box Show the application's About box - + Show the Qt library's About box Show the Qt library's About box @@ -256,25 +256,25 @@ MaltPhEdit - + Malze <120 EBC Malts <120 EBC - + Caramalz Caramel malt - + Röstmalz Nicht sicher ob das die richtige bezeichnung ist. Roasted malt - - - + + + Wert übernehmen Accept value @@ -481,17 +481,17 @@ Mixtures - + Name Name - + Erstellt Created - + Geändert Modified