SettingsAccessor: Shed of UserFileAccessor

So far only instantiates the .user file specific upgraders.

Change-Id: I9a16dfe4c3c61093ea1231413495eec2e8fe648e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2014-02-25 17:49:57 +01:00
parent 7e64ecad2b
commit 8163d0bbd3
3 changed files with 41 additions and 30 deletions

View File

@@ -91,7 +91,7 @@ public:
Core::Context m_projectContext;
Core::Context m_projectLanguages;
QVariantMap m_pluginSettings;
SettingsAccessor *m_accessor;
Internal::UserFileAccessor *m_accessor;
};
ProjectPrivate::ProjectPrivate() :
@@ -302,14 +302,14 @@ void Project::saveSettings()
{
emit aboutToSaveSettings();
if (!d->m_accessor)
d->m_accessor = new SettingsAccessor(this);
d->m_accessor = new Internal::UserFileAccessor(this);
d->m_accessor->saveSettings(toMap());
}
bool Project::restoreSettings()
{
if (!d->m_accessor)
d->m_accessor = new SettingsAccessor(this);
d->m_accessor = new Internal::UserFileAccessor(this);
QVariantMap map(d->m_accessor->restoreSettings());
bool ok = fromMap(map);
if (ok)