logic: Don't set project state outdated if only source group name changed (issue #700)

This commit is contained in:
Eberhard Graether
2019-05-27 18:04:29 +02:00
parent b6a39a2d66
commit 150240a9af
4 changed files with 22 additions and 9 deletions
+11 -8
View File
@@ -179,16 +179,19 @@ void Project::load(std::shared_ptr<DialogView> dialogView)
{
m_state = PROJECT_STATE_OUTVERSIONED;
}
else if (utility::replace(TextAccess::createFromFile(projectSettingsPath)->getText(), "\r", "") !=
utility::replace(TextAccess::createFromString(m_storage->getProjectSettingsText())->getText(), "\r", ""))
{
m_state = PROJECT_STATE_OUTDATED;
canLoad = true;
}
else
{
m_state = PROJECT_STATE_LOADED;
canLoad = true;
ProjectSettings storedSettings;
if (storedSettings.loadFromString(m_storage->getProjectSettingsText()) && m_settings->equalsExceptNameAndLocation(storedSettings))
{
m_state = PROJECT_STATE_LOADED;
canLoad = true;
}
else
{
m_state = PROJECT_STATE_OUTDATED;
canLoad = true;
}
}
try
+9
View File
@@ -44,6 +44,15 @@ bool Settings::load(const FilePath& filePath, bool readOnly)
}
}
bool Settings::loadFromString(const std::string& text, bool readOnly)
{
m_readOnly = readOnly;
m_config = ConfigManager::createAndLoad(TextAccess::createFromString(text));
m_filePath = FilePath();
return true;
}
void Settings::save()
{
if (m_readOnly)
+1
View File
@@ -18,6 +18,7 @@ public:
virtual ~Settings();
bool load(const FilePath& filePath, bool readOnly = false);
bool loadFromString(const std::string& text, bool readOnly = false);
void save();
void save(const FilePath& filePath);
+1 -1
View File
@@ -42,7 +42,7 @@ bool SourceGroupSettings::equals(std::shared_ptr<SourceGroupSettings> other) con
{
return (
m_id == other->m_id &&
m_name == other->m_name &&
// m_name == other->m_name && // Ignore name, since not significant regarding index state
m_type == other->m_type &&
m_status == other->m_status
);