logic: Ask user before reparsing the project
While the message box with the question is visible the ui is blocked. A message appears when: * when project was edited * when preferences were edited * when project file has more recent changes than db * when db has a different version than Coati
This commit is contained in:
@@ -10,9 +10,10 @@
|
||||
#include "utility/utilityString.h"
|
||||
#include "utility/Version.h"
|
||||
|
||||
SqliteStorage::SqliteStorage(const std::string& dbFilePath)
|
||||
SqliteStorage::SqliteStorage(const FilePath& dbFilePath)
|
||||
: m_dbFilePath(dbFilePath)
|
||||
{
|
||||
m_database.open(dbFilePath.c_str());
|
||||
m_database.open(m_dbFilePath.str().c_str());
|
||||
|
||||
m_database.execDML("PRAGMA foreign_keys=ON;");
|
||||
}
|
||||
@@ -22,23 +23,17 @@ SqliteStorage::~SqliteStorage()
|
||||
m_database.close();
|
||||
}
|
||||
|
||||
bool SqliteStorage::init()
|
||||
void SqliteStorage::init()
|
||||
{
|
||||
Version version = getVersion();
|
||||
|
||||
if (version.isEmpty())
|
||||
{
|
||||
setup();
|
||||
return false;
|
||||
}
|
||||
else if (version.isDifferentStorageVersionThan(Version::getApplicationVersion()))
|
||||
{
|
||||
clear();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +66,11 @@ void SqliteStorage::rollbackTransaction()
|
||||
m_database.execDML("ROLLBACK TRANSACTION;");
|
||||
}
|
||||
|
||||
FilePath SqliteStorage::getDbFilePath() const
|
||||
{
|
||||
return m_dbFilePath;
|
||||
}
|
||||
|
||||
Version SqliteStorage::getVersion() const
|
||||
{
|
||||
std::string versionStr = getMetaValue("version");
|
||||
|
||||
Reference in New Issue
Block a user