logic: Don't set project state outdated if only source group name changed (issue #700)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user