Git commit 5e80634e1a0144b978ae8570be59597d13a92a16 by Jos=C3=A9 Manuel San= tamar=C3=ADa Lema. Committed on 07/04/2016 at 07:11. Pushed by joselema into branch 'master'. Add KreAllIngredientsModels stub. M +6 -0 src/CMakeLists.txt A +24 -0 src/models/kreallingredientsmodels.cpp [License: GPL (v2= +)] A +32 -0 src/models/kreallingredientsmodels.h [License: GPL (v2+)] http://commits.kde.org/krecipes/5e80634e1a0144b978ae8570be59597d13a92a16 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 68c3300..b104aa1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,11 @@ set(krecipesdbs_SRCS = qt4_add_dbus_adaptor(krecipesdbs_SRCS backends/org.kde.krecipesdb.xml reci= pedb.h RecipeDB) = +############## models ################ + +set(krecipesmodels_SRCS + models/kreallingredientsmodels.cpp + ) = ############ importers ############### = @@ -295,6 +300,7 @@ set(validators_SRCS = kde4_add_library(krecipescommon STATIC ${mysql_SRCS} ${postgresql_SRCS} ${sqlite_SRCS} ${krecipesdbs_SRCS} + ${krecipesmodels_SRCS} ${krecipesimporters_SRCS} ${krecipesexporters_SRCS} ${datablocks_SRCS} ${krecipesthreadedqueries_SRCS} ${validators_SRCS} diff --git a/src/models/kreallingredientsmodels.cpp b/src/models/kreallingr= edientsmodels.cpp new file mode 100644 index 0000000..1da6a5e --- /dev/null +++ b/src/models/kreallingredientsmodels.cpp @@ -0,0 +1,24 @@ +/*************************************************************************= ** +* Copyright =C2=A9 2016 Jos=C3=A9 Manuel Santamar=C3=ADa Lema * +* = * +* 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 2 of the License, or = * +* (at your option) any later version. = * +**************************************************************************= **/ + +#include "kreallingredientsmodels.h" + +#include + + +KreAllIngredientsModels::KreAllIngredientsModels( RecipeDB * database ): + m_database( database ) +{ + m_sourceModel =3D new QStandardItemModel( this ); +} + +QStandardItemModel * KreAllIngredientsModels::sourceModel() +{ + return m_sourceModel; +} diff --git a/src/models/kreallingredientsmodels.h b/src/models/kreallingred= ientsmodels.h new file mode 100644 index 0000000..52cf264 --- /dev/null +++ b/src/models/kreallingredientsmodels.h @@ -0,0 +1,32 @@ +/*************************************************************************= ** +* Copyright =C2=A9 2016 Jos=C3=A9 Manuel Santamar=C3=ADa Lema * +* = * +* 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 2 of the License, or = * +* (at your option) any later version. = * +**************************************************************************= **/ + +#ifndef KREALLINGREDIENTSMODELS_H +#define KREALLINGREDIENTSMODELS_H + +#include + +class RecipeDB; +class QStandardItemModel; + +class KreAllIngredientsModels: public QObject { +Q_OBJECT + +public: + KreAllIngredientsModels( RecipeDB * database ); + + QStandardItemModel * sourceModel(); + +private: + RecipeDB * m_database; + QStandardItemModel * m_sourceModel; + = +}; + +#endif