data: Still allow project refresh if database file can't be loaded

This commit is contained in:
Eberhard Graether
2018-01-12 19:57:11 +01:00
parent 05ff92fdea
commit 3f60f7a83c
3 changed files with 19 additions and 4 deletions
+17 -1
View File
@@ -121,7 +121,17 @@ void Project::load()
canLoad = true;
}
m_storage->setup();
try
{
m_storage->setup();
}
catch(...)
{
LOG_ERROR_STREAM(<< "Exception during storage loading.");
canLoad = false;
m_state = PROJECT_STATE_DB_CORRUPTED;
}
m_sourceGroups = SourceGroupFactory::getInstance()->createSourceGroups(m_settings->getAllSourceGroupSettings());
@@ -197,6 +207,12 @@ void Project::refresh(RefreshMode refreshMode, DialogView* dialogView)
"the project fully reindexed. Do you want to update the project file and reindex the project?";
needsFullRefresh = true;
case PROJECT_STATE_DB_CORRUPTED:
question =
"There was a problem loading the index of this project. The project needs to get fully reindexed. "
"Do you want to reindex the project?";
needsFullRefresh = true;
default:
break;
}