mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-03-21 03:12:43 +01:00
Cleaned up Main initialization handling. This will need to be refactored into a builder class.
This commit is contained in:
@@ -58,14 +58,11 @@ bool CollectionDatabase::ResetDatabase()
|
||||
retVal = false;
|
||||
}
|
||||
|
||||
//CheckDatabase();
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool CollectionDatabase::CheckDatabase()
|
||||
bool CollectionDatabase::Initialize()
|
||||
{
|
||||
bool retVal = true;
|
||||
int rc;
|
||||
char *error = NULL;
|
||||
sqlite3 *handle = DBInstance->GetHandle();
|
||||
@@ -101,10 +98,10 @@ bool CollectionDatabase::CheckDatabase()
|
||||
ss << "Unable to create Configurations table. Error: " << error;
|
||||
Logger::Write(Logger::ZONE_ERROR, "Database", ss.str());
|
||||
|
||||
retVal = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ class CollectionDatabase
|
||||
public:
|
||||
CollectionDatabase(DB *db, Configuration *c);
|
||||
virtual ~CollectionDatabase();
|
||||
bool Initialize();
|
||||
bool Import();
|
||||
bool ResetDatabase();
|
||||
bool CheckDatabase();
|
||||
|
||||
|
||||
bool GetCollection(std::string collectionName, std::vector<Item *> &list);
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
* file 'LICENSE.txt', which is part of this source code package.
|
||||
*/
|
||||
#include "DB.h"
|
||||
#include "Configuration.h"
|
||||
#include "../Utility/Log.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
DB::DB()
|
||||
: Path(Configuration::GetAbsolutePath() + "/cache.db")
|
||||
DB::DB(std::string dbFile)
|
||||
: Path(dbFile)
|
||||
, Handle(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class DB
|
||||
{
|
||||
public:
|
||||
DB();
|
||||
DB(std::string dbFile);
|
||||
bool Initialize();
|
||||
void DeInitialize();
|
||||
virtual ~DB();
|
||||
|
||||
Reference in New Issue
Block a user