From 92d9e99eb4f7071bda43a17f76b5d3ebdd52081b Mon Sep 17 00:00:00 2001 From: birkeh Date: Wed, 12 Apr 2017 19:35:27 +0200 Subject: [PATCH] init --- Kooky/cInterface.h | 20 ++++++ Kooky/cdbinterface.h | 93 +++++++++++++++++++++++++ Kooky/cimportingredientdialog.h | 20 ++++++ Kooky/cimportinterface.h | 4 ++ Kooky/cingredient.cpp | 5 ++ Kooky/cingredient.h | 80 ++++++++++++++++++++-- Kooky/cingredientvalue.h | 29 +++++++- Kooky/cingredientwindow.cpp | 5 +- Kooky/cingredientwindow.h | 99 ++++++++++++++++++++++++--- Kooky/cmainwindow.cpp | 63 ++++++++++++----- Kooky/cmainwindow.h | 33 +++++++-- Kooky/cmdiarea.h | 11 ++- Kooky/cmessageanimatedialog.h | 4 ++ Kooky/coptions.h | 14 ++++ Kooky/coptionsplugins.h | 4 ++ Kooky/cplugin.h | 20 ++++++ Kooky/cplugininfo.h | 20 +++++- Kooky/csplashscreen.h | 9 +++ Kooky/typedef.h | 22 ++++-- dMySQL/cconfigdialog.h | 4 ++ dMySQL/cmysqlplugin.h | 118 ++++++++++++++++++++++++++++++++ dSQLite/cconfigdialog.h | 34 ++++++++- dSQLite/csqliteplugin.cpp | 2 +- dSQLite/csqliteplugin.h | 118 ++++++++++++++++++++++++++++++++ iBleibFit/cbleibfitplugin.h | 20 ++++++ iErnaehrung/cernaehrungplugin.h | 20 ++++++ 26 files changed, 819 insertions(+), 52 deletions(-) diff --git a/Kooky/cInterface.h b/Kooky/cInterface.h index 44ebc7f..604bc37 100644 --- a/Kooky/cInterface.h +++ b/Kooky/cInterface.h @@ -87,9 +87,29 @@ public: virtual bool config() = 0; virtual QString author() = 0; + /*! + \brief + + \return QString + */ virtual QString company() = 0; + /*! + \brief + + \return QString + */ virtual QString link() = 0; + /*! + \brief + + \return QString + */ virtual QString description() = 0; + /*! + \brief + + \return QString + */ virtual QString copyright() = 0; protected: }; diff --git a/Kooky/cdbinterface.h b/Kooky/cdbinterface.h index b15ebd3..9d8b390 100644 --- a/Kooky/cdbinterface.h +++ b/Kooky/cdbinterface.h @@ -78,20 +78,113 @@ public: QString lastError() { return(QString("no error")); } virtual qint32 exists(const QString& szName, const QString& szGroup) = 0; + /*! + \brief + + \param szGroup + \return qint32 + */ virtual qint32 existsGroup(const QString& szGroup) = 0; + /*! + \brief + + \param id + \param ingredientNumber + \return qint32 + */ virtual qint32 existsIngredient(qint32 id, qint16 ingredientNumber) = 0; + /*! + \brief + + \param szName + \param szGroup + \return qint32 + */ virtual qint32 create(const QString& szName, const QString& szGroup) = 0; + /*! + \brief + + \param id + \return bool + */ virtual bool deleteIngredient(qint32 id) = 0; + /*! + \brief + + \param szGroup + \return qint32 + */ virtual qint32 createGroup(const QString& szGroup) = 0; + /*! + \brief + + \param id + \param ingredientNumber + \param value + \return bool + */ virtual bool set(qint32 id, qint16 ingredientNumber, qreal value) = 0; + /*! + \brief + + \param id + \param szName + \return bool + */ virtual bool setName(qint32 id, const QString& szName) = 0; + /*! + \brief + + \param id + \param szGroup + \return bool + */ virtual bool setGroup(qint32 id, const QString& szGroup) = 0; + /*! + \brief + + \param id + \return QString + */ virtual QString name(qint32 id) = 0; + /*! + \brief + + \param id + \return QString + */ virtual QString group(qint32 id) = 0; + /*! + \brief + + \param id + \param ingredientNumber + \return qreal + */ virtual qreal get(qint32 id, qint16 ingredientNumber) = 0; + /*! + \brief + + \return INGREDIENT_LIST + */ virtual INGREDIENT_LIST ingredients() = 0; + /*! + \brief + + \return QStringList + */ virtual QStringList groups() = 0; + /*! + \brief + + \return bool + */ virtual bool beginTransaction() = 0; + /*! + \brief + + \return bool + */ virtual bool endTransaction() = 0; protected: bool m_bConnected; /*!< holds the current connection status. */ diff --git a/Kooky/cimportingredientdialog.h b/Kooky/cimportingredientdialog.h index 4733a7d..26ccb19 100644 --- a/Kooky/cimportingredientdialog.h +++ b/Kooky/cimportingredientdialog.h @@ -62,9 +62,24 @@ public: void setPluginList(const QList pluginList, const QString& szPlugin = QString("")); cIngredient toIngredient(); + /*! + \brief + + \return QString + */ QString pluginSelected(); + /*! + \brief + + \param ingredientGroupList + */ void setIngredientGroupList(const QStringList& ingredientGroupList); + /*! + \brief + + \param szIngredientGroup + */ void setIngredientGroup(const QString& szIngredientGroup); private: Ui::cImportIngredientDialog* ui; /*!< TODO: describe */ @@ -73,6 +88,11 @@ private: private slots: void on_m_lpSearchButton_clicked(); + /*! + \brief + + \param arg1 + */ void on_m_lpSearchString_textChanged(const QString &arg1); /** * \brief diff --git a/Kooky/cimportinterface.h b/Kooky/cimportinterface.h index 8992d6a..6a92fb1 100644 --- a/Kooky/cimportinterface.h +++ b/Kooky/cimportinterface.h @@ -29,6 +29,10 @@ #include +/*! + \brief + +*/ class cImportInterface : public cInterface { public: diff --git a/Kooky/cingredient.cpp b/Kooky/cingredient.cpp index 9945dc1..44e9848 100644 --- a/Kooky/cingredient.cpp +++ b/Kooky/cingredient.cpp @@ -265,6 +265,11 @@ bool cIngredient::save(cPlugin* lpDB) return(true); } +qint32 cIngredient::ingredientID() +{ + return(m_iID); +} + void cIngredient::setIngredientName(const QString& szIngredientName) { m_szIngredientName = szIngredientName; diff --git a/Kooky/cingredient.h b/Kooky/cingredient.h index 4812d4d..4158e25 100644 --- a/Kooky/cingredient.h +++ b/Kooky/cingredient.h @@ -201,6 +201,10 @@ public: iIngredientMax, }; + /*! + \brief + + */ enum UNIT { UNIT_None = 0, @@ -213,11 +217,41 @@ public: }; cIngredient(); + /*! + \brief + + \param szIngredientName + \param szIngredientGroup + */ cIngredient(const QString& szIngredientName, const QString& szIngredientGroup); + /*! + \brief + + \param i + \param dValue + */ void setValue(cIngredient::iIngredient i, qreal dValue); + /*! + \brief + + \param i + \return qreal + */ qreal value(cIngredient::iIngredient i); + /*! + \brief + + \param i + \return QString + */ QString valueFormatted(cIngredient::iIngredient i); + /*! + \brief + + \param i + \return UNIT + */ UNIT unit(cIngredient::iIngredient i); /*! \brief @@ -238,10 +272,36 @@ public: */ bool save(cPlugin* lpDB); + qint32 ingredientID(); + /*! + \brief + + \param szIngredientName + */ void setIngredientName(const QString& szIngredientName); + /*! + \brief + + \return QString + */ QString ingredientName(); + /*! + \brief + + \param szIngredientGroup + */ void setIngredientGroup(const QString& szIngredientGroup); + /*! + \brief + + \return QString + */ QString ingredientGroup(); + /*! + \brief + + \return QStringList + */ QStringList groups(); /*! \brief @@ -267,6 +327,12 @@ public: m_dValue[z] = D.m_dValue[z]; } + /*! + \brief + + \param D + \return bool operator + */ bool operator==(const cIngredient& D) { if(m_szIngredientName != D.m_szIngredientName) @@ -286,16 +352,22 @@ public: return(true); } + /*! + \brief + + \param D + \return bool operator + */ bool operator!=(const cIngredient& D) { return(!(*this == D)); } private: - QString m_szIngredientName; - QString m_szIngredientGroup; - qint32 m_iID; - qreal m_dValue[iIngredientMax]; + QString m_szIngredientName; /*!< TODO: describe */ + QString m_szIngredientGroup; /*!< TODO: describe */ + qint32 m_iID; /*!< TODO: describe */ + qreal m_dValue[iIngredientMax]; /*!< TODO: describe */ }; #endif // CINGREDIENT_H diff --git a/Kooky/cingredientvalue.h b/Kooky/cingredientvalue.h index 137571c..de5b21d 100644 --- a/Kooky/cingredientvalue.h +++ b/Kooky/cingredientvalue.h @@ -11,19 +11,44 @@ namespace Ui { class cIngredientValue; } +/*! + \brief + +*/ class cIngredientValue : public QDialog { Q_OBJECT public: + /*! + \brief + + \param parent + */ explicit cIngredientValue(QWidget *parent = 0); + /*! + \brief + + */ ~cIngredientValue(); + /*! + \brief + + \param szName + \param value + \param unit + */ void setValues(const QString& szName, qreal value, cIngredient::UNIT unit); + /*! + \brief + + \return qreal + */ qreal value(); private: - Ui::cIngredientValue* ui; - qint32 m_index; + Ui::cIngredientValue* ui; /*!< TODO: describe */ + qint32 m_index; /*!< TODO: describe */ }; #endif // CINGREDIENTVALUE_H diff --git a/Kooky/cingredientwindow.cpp b/Kooky/cingredientwindow.cpp index 48c2182..3e0a6b4 100644 --- a/Kooky/cingredientwindow.cpp +++ b/Kooky/cingredientwindow.cpp @@ -175,6 +175,7 @@ bool cIngredientWindow::save() } m_ingredient.save(m_lpDBPlugin); + checkGroupChanged(); m_ingredientSaved = m_ingredient; return(true); } @@ -240,7 +241,6 @@ void cIngredientWindow::updateTitle() { setWindowTitle(QString(" %1*").arg(m_ingredientSaved.ingredientName())); m_lpItem->setText(QString("%1*").arg(m_ingredientSaved.ingredientName())); - checkGroupChanged(); ui->m_lpSave->setEnabled(true); ui->m_lpRevert->setEnabled(true); } @@ -248,7 +248,6 @@ void cIngredientWindow::updateTitle() { setWindowTitle(QString(" %1").arg(m_ingredientSaved.ingredientName())); m_lpItem->setText(QString("%1").arg(m_ingredientSaved.ingredientName())); - checkGroupChanged(); ui->m_lpSave->setEnabled(false); ui->m_lpRevert->setEnabled(false); } @@ -262,7 +261,6 @@ void cIngredientWindow::checkGroupChanged() if(m_ingredient.ingredientGroup() == m_ingredientSaved.ingredientGroup()) return; - QString szGroup = m_ingredient.ingredientGroup(); QStandardItem* lpOldGroup = m_lpItem->parent(); QStandardItemModel* lpModel = m_lpItem->model(); QList lpItems = lpOldGroup->takeRow(lpModel->indexFromItem(m_lpItem).row()); @@ -273,6 +271,7 @@ void cIngredientWindow::checkGroupChanged() if(lpGroup->text() == m_ingredient.ingredientGroup()) { lpGroup->insertRow(0, lpItems); + lpGroup->sortChildren(0); break; } } diff --git a/Kooky/cingredientwindow.h b/Kooky/cingredientwindow.h index 3457b9f..4a25d19 100644 --- a/Kooky/cingredientwindow.h +++ b/Kooky/cingredientwindow.h @@ -14,43 +14,126 @@ class cIngredientWindow; } +/*! + \brief + +*/ class cIngredientWindow : public QWidget { Q_OBJECT public: + /*! + \brief + + \param parent + */ explicit cIngredientWindow(QWidget *parent = 0); + /*! + \brief + + */ ~cIngredientWindow(); + /*! + \brief + + \param lpItem + \param lpPlugin + */ void setIngredient(QStandardItem* lpItem = 0, cPlugin* lpPlugin = 0); + /*! + \brief + + \return qint32 + */ qint32 ingredientID(void); + /*! + \brief + + \param szIngredientGroup + */ void setIngredientGroup(const QString& szIngredientGroup); + /*! + \brief + + \return bool + */ bool isChanged(); + /*! + \brief + + */ void forceClose(); private slots: + /*! + \brief + + \param text + */ void nameChanged(const QString& text); + /*! + \brief + + \param text + */ void groupChanged(const QString & text); + /*! + \brief + + \param modelIndex + */ void ingredientEdit(const QModelIndex& modelIndex); + /*! + \brief + + */ void saveClicked(); + /*! + \brief + + */ void revertClicked(); + /*! + \brief + + */ void closeClicked(); private: - Ui::cIngredientWindow* ui; + Ui::cIngredientWindow* ui; /*!< TODO: describe */ - cPlugin* m_lpDBPlugin; - qint32 m_iIngredient; - cIngredient m_ingredient; - cIngredient m_ingredientSaved; - QStandardItemModel* m_lpIngredientValuesModel; - QStandardItem* m_lpItem; - bool m_bIsInitialized; + cPlugin* m_lpDBPlugin; /*!< TODO: describe */ + qint32 m_iIngredient; /*!< TODO: describe */ + cIngredient m_ingredient; /*!< TODO: describe */ + cIngredient m_ingredientSaved; /*!< TODO: describe */ + QStandardItemModel* m_lpIngredientValuesModel; /*!< TODO: describe */ + QStandardItem* m_lpItem; /*!< TODO: describe */ + bool m_bIsInitialized; /*!< TODO: describe */ + /*! + \brief + + \return bool + */ bool save(); + /*! + \brief + + */ void updateTitle(); protected: + /*! + \brief + + */ void checkGroupChanged(); + /*! + \brief + + \param event + */ void closeEvent(QCloseEvent *event); }; diff --git a/Kooky/cmainwindow.cpp b/Kooky/cmainwindow.cpp index bdd9665..7814660 100644 --- a/Kooky/cmainwindow.cpp +++ b/Kooky/cmainwindow.cpp @@ -298,32 +298,44 @@ void cMainWindow::loadIngredients() { m_lpIngredientsListModel->removeRows(0, m_lpIngredientsListModel->rowCount()); - QString szOldGroup(""); - QStandardItem* lpGroupItem = 0; - if(m_lpDB) { cDBInterface* lpInterface = m_lpDB->dbInterface(); if(lpInterface) { - INGREDIENT_LIST ingredients = lpInterface->ingredients(); + QStringList groups = lpInterface->groups(); + + for(int z = 0;z < groups.count();z++) + { + QStandardItem* lpGroup = new QStandardItem(groups.at(z)); + + m_lpIngredientsListModel->appendRow(lpGroup); + lpGroup->setBackground(QBrush(QColor(191, 191, 191))); + QFont font = lpGroup->font(); + font.setItalic(true); + font.setBold(true); + lpGroup->setFont(font); + ui->m_lpIngredientsList->setFirstColumnSpanned(z, ui->m_lpIngredientsList->rootIndex(), true); + } + + INGREDIENT_LIST ingredients = lpInterface->ingredients(); + QList lpGroupItem; + for(int z = 0;z < ingredients.count();z++) { - if(ingredients.at(z).szGroup != szOldGroup) + lpGroupItem = m_lpIngredientsListModel->findItems(ingredients.at(z).szGroup); + if(lpGroupItem.count()) { - szOldGroup = ingredients.at(z).szGroup; - lpGroupItem = new QStandardItem(szOldGroup); - m_lpIngredientsListModel->appendRow(lpGroupItem); + QStandardItem* lpNew = new QStandardItem(ingredients.at(z).szIngredient); + QStandardItem* lpCalories = new QStandardItem(QString("%1 kCal").arg(ingredients.at(z).dCalories)); + QStandardItem* lpCarbos = new QStandardItem(QString("%1 g").arg(ingredients.at(z).dCarbohydrates, 0, 'f', 1)); + lpNew->setData(ingredients.at(z).iIngredient); + lpCalories->setData(ingredients.at(z).iIngredient); + lpCarbos->setData(ingredients.at(z).iIngredient); + lpCalories->setTextAlignment(Qt::AlignRight); + lpCarbos->setTextAlignment(Qt::AlignRight); + lpGroupItem.at(0)->appendRow(QList() << lpNew << lpCalories << lpCarbos); } - QStandardItem* lpNew = new QStandardItem(ingredients.at(z).szIngredient); - QStandardItem* lpCalories = new QStandardItem(QString("%1 kCal").arg(ingredients.at(z).dCalories)); - QStandardItem* lpCarbos = new QStandardItem(QString("%1 g").arg(ingredients.at(z).dCarbohydrates, 0, 'f', 1)); - lpNew->setData(ingredients.at(z).iIngredient); - lpCalories->setData(ingredients.at(z).iIngredient); - lpCarbos->setData(ingredients.at(z).iIngredient); - lpCalories->setTextAlignment(Qt::AlignRight); - lpCarbos->setTextAlignment(Qt::AlignRight); - lpGroupItem->appendRow(QList() << lpNew << lpCalories << lpCarbos); } } } @@ -510,7 +522,20 @@ void cMainWindow::ingredientsListImportTriggered() cIngredient ingredient = importIngredientDialog.toIngredient(); ingredient.save(m_lpDB); - loadIngredients(); + + QListlpGroupItem = m_lpIngredientsListModel->findItems(ingredient.ingredientGroup()); + if(lpGroupItem.count()) + { + QStandardItem* lpNew = new QStandardItem(ingredient.ingredientName()); + QStandardItem* lpCalories = new QStandardItem(QString("%1 kCal").arg(ingredient.value(cIngredient::iIngredientCalories))); + QStandardItem* lpCarbos = new QStandardItem(QString("%1 g").arg(ingredient.value(cIngredient::iIngredientCarbohydrates), 0, 'f', 1)); + lpNew->setData(ingredient.ingredientID()); + lpCalories->setData(ingredient.ingredientID()); + lpCarbos->setData(ingredient.ingredientID()); + lpCalories->setTextAlignment(Qt::AlignRight); + lpCarbos->setTextAlignment(Qt::AlignRight); + lpGroupItem.at(0)->appendRow(QList() << lpNew << lpCalories << lpCarbos); + } delete lpDialog; } @@ -603,7 +628,7 @@ void cMainWindow::ingredientsListEditTriggered() lpIngredientWindow->setIngredient(ingredientItemFromID(lpItem->data().toInt()), m_lpDB); QMdiSubWindow* lpSubWindow = ui->m_lpMDIArea->addSubWindow(lpIngredientWindow); lpSubWindow->setAttribute(Qt::WA_DeleteOnClose); - lpIngredientWindow->show(); + lpIngredientWindow->showMaximized(); } } diff --git a/Kooky/cmainwindow.h b/Kooky/cmainwindow.h index 4a760ca..107505c 100644 --- a/Kooky/cmainwindow.h +++ b/Kooky/cmainwindow.h @@ -40,6 +40,10 @@ namespace Ui class cMainWindow; } +/*! + \brief + +*/ class cMainWindow : public QMainWindow { Q_OBJECT @@ -119,7 +123,16 @@ private slots: */ void ingredientsListEditTriggered(); void ingredientsListDoubleClicked(QModelIndex modelIndex); + + /*! + \brief + + */ void updateMenus(); + /*! + \brief + + */ void updateWindowMenu(); private: @@ -135,13 +148,13 @@ private: cPlugin* m_lpDB; QString m_szLastImportPlugin; - QAction* m_lpWindowMenuCloseAct; - QAction* m_lpWindowMenuCloseAllAct; - QAction* m_lpWindowMenuTileAct; - QAction* m_lpWindowMenuCascadeAct; - QAction* m_lpWindowMenuNextAct; - QAction* m_lpWindowMenuPreviousAct; - QAction* m_lpWindowMenuSeparatorAct; + QAction* m_lpWindowMenuCloseAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuCloseAllAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuTileAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuCascadeAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuNextAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuPreviousAct; /*!< TODO: describe */ + QAction* m_lpWindowMenuSeparatorAct; /*!< TODO: describe */ /** * \brief Initialized main windows. @@ -168,6 +181,12 @@ private: cPlugin* plugin(QAction* lpAction); QMdiSubWindow* activeMdiChild() const; + /*! + \brief + + \param id + \return QStandardItem + */ QStandardItem* ingredientItemFromID(qint32 id); protected: }; diff --git a/Kooky/cmdiarea.h b/Kooky/cmdiarea.h index d9687c5..1f0e714 100644 --- a/Kooky/cmdiarea.h +++ b/Kooky/cmdiarea.h @@ -25,14 +25,23 @@ #include +/*! + \brief + +*/ class cMdiArea : public QMdiArea { Q_OBJECT public: cMdiArea(QWidget * parent = 0); private: - QImage m_background; + QImage m_background; /*!< TODO: describe */ protected: + /*! + \brief + + \param event + */ void paintEvent(QPaintEvent *event); }; diff --git a/Kooky/cmessageanimatedialog.h b/Kooky/cmessageanimatedialog.h index f49a543..2b0a262 100644 --- a/Kooky/cmessageanimatedialog.h +++ b/Kooky/cmessageanimatedialog.h @@ -27,6 +27,10 @@ namespace Ui { class cMessageAnimateDialog; } +/*! + \brief + +*/ class cMessageAnimateDialog : public QDialog { Q_OBJECT diff --git a/Kooky/coptions.h b/Kooky/coptions.h index 2267655..a04eb5e 100644 --- a/Kooky/coptions.h +++ b/Kooky/coptions.h @@ -62,8 +62,16 @@ private slots: void onOptionsTreeSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); void on_m_lpButtonBox_clicked(QAbstractButton *button); void on_m_lpButtonBox_accepted(); + /*! + \brief + + */ void on_m_lpButtonBox_rejected(); + /*! + \brief + + */ void somethingChanged(); private: Ui::cOptions* ui; /*!< TODO: describe */ @@ -74,6 +82,12 @@ private: QStandardItem* m_lpPluginRoot; + /*! + \brief + + \param lpItem + \return bool + */ bool saveData(QStandardItem *lpItem = 0); protected: /*! diff --git a/Kooky/coptionsplugins.h b/Kooky/coptionsplugins.h index e7a368e..dfe8d95 100644 --- a/Kooky/coptionsplugins.h +++ b/Kooky/coptionsplugins.h @@ -59,6 +59,10 @@ public: void setPlugins(QList& plugins); signals: + /*! + \brief + + */ void somethingChanged(); private slots: /*! diff --git a/Kooky/cplugin.h b/Kooky/cplugin.h index a227116..0704321 100644 --- a/Kooky/cplugin.h +++ b/Kooky/cplugin.h @@ -114,9 +114,29 @@ public: cDBInterface* dbInterface(); QString author(); + /*! + \brief + + \return QString + */ QString company(); + /*! + \brief + + \return QString + */ QString link(); + /*! + \brief + + \return QString + */ QString description(); + /*! + \brief + + \return QString + */ QString copyright(); private: diff --git a/Kooky/cplugininfo.h b/Kooky/cplugininfo.h index b24dbd6..9cfbcae 100644 --- a/Kooky/cplugininfo.h +++ b/Kooky/cplugininfo.h @@ -11,17 +11,35 @@ namespace Ui { class cPluginInfo; } +/*! + \brief + +*/ class cPluginInfo : public QWidget { Q_OBJECT public: + /*! + \brief + + \param parent + */ explicit cPluginInfo(QWidget *parent = 0); + /*! + \brief + + */ ~cPluginInfo(); + /*! + \brief + + \param lpPlugin + */ void setInfo(cPlugin* lpPlugin); private: - Ui::cPluginInfo *ui; + Ui::cPluginInfo *ui; /*!< TODO: describe */ }; #endif // CPLUGININFO_H diff --git a/Kooky/csplashscreen.h b/Kooky/csplashscreen.h index f109374..8882ace 100644 --- a/Kooky/csplashscreen.h +++ b/Kooky/csplashscreen.h @@ -5,11 +5,20 @@ #include +/*! + \brief + +*/ class cSplashScreen : public QSplashScreen { public: cSplashScreen(const QPixmap & pixmap = QPixmap(), Qt::WindowFlags f = 0); + /*! + \brief + + \param painter + */ virtual void drawContents(QPainter *painter); }; diff --git a/Kooky/typedef.h b/Kooky/typedef.h index cafc652..87c8b2e 100644 --- a/Kooky/typedef.h +++ b/Kooky/typedef.h @@ -6,15 +6,27 @@ #include +/*! + \brief + +*/ typedef struct tagINGREDIENT { - qint32 iIngredient; - QString szGroup; - QString szIngredient; - qreal dCalories; - qreal dCarbohydrates; + qint32 iIngredient; /*!< TODO: describe */ + QString szGroup; /*!< TODO: describe */ + QString szIngredient; /*!< TODO: describe */ + qreal dCalories; /*!< TODO: describe */ + qreal dCarbohydrates; /*!< TODO: describe */ +/*! + \brief + +*/ } INGREDIENT, *LPINGREDIENT; +/*! + \brief + +*/ typedef QList INGREDIENT_LIST; diff --git a/dMySQL/cconfigdialog.h b/dMySQL/cconfigdialog.h index 4d1a3e2..7bd7d10 100644 --- a/dMySQL/cconfigdialog.h +++ b/dMySQL/cconfigdialog.h @@ -28,6 +28,10 @@ namespace Ui { class cConfigDialog; } +/*! + \brief + +*/ class cConfigDialog : public QDialog { Q_OBJECT diff --git a/dMySQL/cmysqlplugin.h b/dMySQL/cmysqlplugin.h index 4524a6f..6d3ad79 100644 --- a/dMySQL/cmysqlplugin.h +++ b/dMySQL/cmysqlplugin.h @@ -112,26 +112,144 @@ public: bool config(); qint32 exists(const QString& szName, const QString& szGroup); + /*! + \brief + + \param szGroup + \return qint32 + */ qint32 existsGroup(const QString& szGroup); + /*! + \brief + + \param id + \param ingredientNumber + \return qint32 + */ qint32 existsIngredient(qint32 id, qint16 ingredientNumber); + /*! + \brief + + \param szName + \param szGroup + \return qint32 + */ qint32 create(const QString& szName, const QString& szGroup); + /*! + \brief + + \param szGroup + \return qint32 + */ qint32 createGroup(const QString& szGroup); + /*! + \brief + + \param id + \return bool + */ bool deleteIngredient(qint32 id); + /*! + \brief + + \param id + \param ingredientNumber + \param value + \return bool + */ bool set(qint32 id, qint16 ingredientNumber, qreal value); + /*! + \brief + + \param id + \param szName + \return bool + */ bool setName(qint32 id, const QString& szName); + /*! + \brief + + \param id + \param szGroup + \return bool + */ bool setGroup(qint32 id, const QString& szGroup); + /*! + \brief + + \param id + \return QString + */ QString name(qint32 id); + /*! + \brief + + \param id + \return QString + */ QString group(qint32 id); + /*! + \brief + + \param id + \param ingredientNumber + \return qreal + */ qreal get(qint32 id, qint16 ingredientNumber); + /*! + \brief + + \return INGREDIENT_LIST + */ INGREDIENT_LIST ingredients(); + /*! + \brief + + \return QStringList + */ QStringList groups(); + /*! + \brief + + \return bool + */ bool beginTransaction(); + /*! + \brief + + \return bool + */ bool endTransaction(); + /*! + \brief + + \return QString + */ QString author(); + /*! + \brief + + \return QString + */ QString company(); + /*! + \brief + + \return QString + */ QString link(); + /*! + \brief + + \return QString + */ QString description(); + /*! + \brief + + \return QString + */ QString copyright(); protected: diff --git a/dSQLite/cconfigdialog.h b/dSQLite/cconfigdialog.h index 73eae52..bb3f312 100644 --- a/dSQLite/cconfigdialog.h +++ b/dSQLite/cconfigdialog.h @@ -7,23 +7,55 @@ namespace Ui { class cConfigDialog; } +/*! + \brief + +*/ class cConfigDialog : public QDialog { Q_OBJECT public: + /*! + \brief + + \param parent + */ explicit cConfigDialog(QWidget *parent = 0); + /*! + \brief + + */ ~cConfigDialog(); + /*! + \brief + + \param szFile + */ void setFile(const QString& szFile); + /*! + \brief + + \return QString + */ QString file(); private slots: + /*! + \brief + + */ void on_m_lpBrowse_clicked(); + /*! + \brief + + \param arg1 + */ void on_m_lpFile_textChanged(const QString &arg1); private: - Ui::cConfigDialog *ui; + Ui::cConfigDialog *ui; /*!< TODO: describe */ }; #endif // CCONFIGDIALOG_H diff --git a/dSQLite/csqliteplugin.cpp b/dSQLite/csqliteplugin.cpp index 3588196..c006911 100644 --- a/dSQLite/csqliteplugin.cpp +++ b/dSQLite/csqliteplugin.cpp @@ -309,7 +309,7 @@ bool cSQLitePlugin::setGroup(qint32 id, const QString& szGroup) return(false); QSqlQuery query(m_db); - if(!query.exec(QString("UPDATE ingredient SET ingredient_group=%1 WHERE id=%2").arg(groupID).arg(id))) + if(!query.exec(QString("UPDATE ingredient SET ingredient_group_id=%1 WHERE id=%2").arg(groupID).arg(id))) { m_szLastError = query.lastError().text(); return(""); diff --git a/dSQLite/csqliteplugin.h b/dSQLite/csqliteplugin.h index 18b0789..49a7d04 100644 --- a/dSQLite/csqliteplugin.h +++ b/dSQLite/csqliteplugin.h @@ -73,26 +73,144 @@ public: bool config(); qint32 exists(const QString& szName, const QString& szGroup); + /*! + \brief + + \param szGroup + \return qint32 + */ qint32 existsGroup(const QString& szGroup); + /*! + \brief + + \param id + \param ingredientNumber + \return qint32 + */ qint32 existsIngredient(qint32 id, qint16 ingredientNumber); + /*! + \brief + + \param szName + \param szGroup + \return qint32 + */ qint32 create(const QString& szName, const QString &szGroup); + /*! + \brief + + \param szGroup + \return qint32 + */ qint32 createGroup(const QString& szGroup); + /*! + \brief + + \param id + \return bool + */ bool deleteIngredient(qint32 id); + /*! + \brief + + \param id + \param ingredientNumber + \param value + \return bool + */ bool set(qint32 id, qint16 ingredientNumber, qreal value); + /*! + \brief + + \param id + \param szName + \return bool + */ bool setName(qint32 id, const QString& szName); + /*! + \brief + + \param id + \param szGroup + \return bool + */ bool setGroup(qint32 id, const QString& szGroup); + /*! + \brief + + \param id + \return QString + */ QString name(qint32 id); + /*! + \brief + + \param id + \return QString + */ QString group(qint32 id); + /*! + \brief + + \param id + \param ingredientNumber + \return qreal + */ qreal get(qint32 id, qint16 ingredientNumber); + /*! + \brief + + \return INGREDIENT_LIST + */ INGREDIENT_LIST ingredients(); + /*! + \brief + + \return QStringList + */ QStringList groups(); + /*! + \brief + + \return bool + */ bool beginTransaction(); + /*! + \brief + + \return bool + */ bool endTransaction(); + /*! + \brief + + \return QString + */ QString author(); + /*! + \brief + + \return QString + */ QString company(); + /*! + \brief + + \return QString + */ QString link(); + /*! + \brief + + \return QString + */ QString description(); + /*! + \brief + + \return QString + */ QString copyright(); protected: diff --git a/iBleibFit/cbleibfitplugin.h b/iBleibFit/cbleibfitplugin.h index 1182a52..210a7e1 100644 --- a/iBleibFit/cbleibfitplugin.h +++ b/iBleibFit/cbleibfitplugin.h @@ -52,9 +52,29 @@ public: bool config(); QString author(); + /*! + \brief + + \return QString + */ QString company(); + /*! + \brief + + \return QString + */ QString link(); + /*! + \brief + + \return QString + */ QString description(); + /*! + \brief + + \return QString + */ QString copyright(); /*! diff --git a/iErnaehrung/cernaehrungplugin.h b/iErnaehrung/cernaehrungplugin.h index 3cbd6b7..76a3996 100644 --- a/iErnaehrung/cernaehrungplugin.h +++ b/iErnaehrung/cernaehrungplugin.h @@ -87,9 +87,29 @@ public: QString ingredientName(); QString author(); + /*! + \brief + + \return QString + */ QString company(); + /*! + \brief + + \return QString + */ QString link(); + /*! + \brief + + \return QString + */ QString description(); + /*! + \brief + + \return QString + */ QString copyright(); private: QStringList m_szUrls; /*!< TODO: describe */