2018-02-02 12:27:57 +00:00
|
|
|
#include "userInterface/mainwindow.h"
|
2018-02-02 09:00:46 +00:00
|
|
|
#include <QApplication>
|
2018-02-02 10:41:36 +00:00
|
|
|
|
2018-02-12 13:24:11 +00:00
|
|
|
#include "model/database/database.h"
|
2018-03-01 16:19:13 +00:00
|
|
|
#include "model/database/recipedatabase.h"
|
2018-02-02 09:00:46 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
MainWindow w;
|
|
|
|
w.show();
|
|
|
|
|
2018-03-01 16:19:13 +00:00
|
|
|
//TESTING CODE
|
2018-03-02 08:32:40 +00:00
|
|
|
// Database db("test.db");
|
|
|
|
// printf("Table exists: %d\n", db.tableExists("ingredients"));
|
|
|
|
// db.executeSQL("SELECT * FROM ingredients;").printData();
|
|
|
|
// db.executeSQL("PRAGMA table_info('ingredients');").printData();
|
|
|
|
// db.executeSQL("SELECT name FROM ingredients WHERE foodGroup == 'fruit';").printData();
|
2018-02-02 10:41:36 +00:00
|
|
|
|
2018-03-01 16:19:13 +00:00
|
|
|
RecipeDatabase recipeDB("recipes");
|
2018-03-02 08:32:40 +00:00
|
|
|
recipeDB.storeIngredient(Ingredient("Apple", "Fruit"));
|
|
|
|
recipeDB.storeIngredient(Ingredient("Corn", "Vegetable"));
|
|
|
|
recipeDB.executeSQL("SELECT ingredientId FROM ingredient;").printData();
|
2018-03-01 16:19:13 +00:00
|
|
|
|
|
|
|
return a.exec();
|
2018-02-02 09:00:46 +00:00
|
|
|
}
|