utility: loading project via commanlineargument
loading a project via commanline with --project or -p argument
This commit is contained in:
@@ -91,6 +91,7 @@ void Application::loadProject(const FilePath& projectSettingsFilePath)
|
||||
m_project->loadProject(projectSettingsFilePath);
|
||||
|
||||
m_mainView->updateRecentProjectMenu();
|
||||
m_mainView->hideStartScreen();
|
||||
}
|
||||
|
||||
void Application::refreshProject()
|
||||
|
||||
@@ -215,7 +215,7 @@ void ConfigManager::setValues(const std::string& key, const std::vector<bool>& v
|
||||
setValues(key, stringValues);
|
||||
}
|
||||
|
||||
void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
|
||||
bool ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
|
||||
{
|
||||
std::string text = textAccess->getText();
|
||||
|
||||
@@ -225,6 +225,11 @@ void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
|
||||
{
|
||||
TiXmlHandle docHandle(&doc);
|
||||
TiXmlNode *rootNode = docHandle.FirstChild("config").ToNode();
|
||||
if(rootNode == nullptr)
|
||||
{
|
||||
LOG_ERROR("No rootelement 'config' in the configfile");
|
||||
return false;
|
||||
}
|
||||
for (TiXmlNode *childNode = rootNode->FirstChild(); childNode; childNode = childNode->NextSibling())
|
||||
{
|
||||
parseSubtree(childNode, "");
|
||||
@@ -233,7 +238,9 @@ void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
|
||||
else
|
||||
{
|
||||
LOG_ERROR("Unable to load file.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigManager::save(const std::string filepath)
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
void setValues(const std::string& key, const std::vector<float>& values);
|
||||
void setValues(const std::string& key, const std::vector<bool>& values);
|
||||
|
||||
void load(const std::shared_ptr<TextAccess> textAccess);
|
||||
bool load(const std::shared_ptr<TextAccess> textAccess);
|
||||
void save(const std::string filepath);
|
||||
std::string toString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user