forked from qt-creator/qt-creator
ProjectExplorer: Refactor file settings acessor
This is the first patch of a series. The final goal is to introduce shared settings into Creator. This particular patch shouldn't affect functionality, but it changes a bit the design of the settings acessor and prepares the code for the upcoming commits. In addition it also makes restoring the settings slightly more robust, since it will try to load a compatible "old" file from the quick check before it actually performs the more expensive check. NOTE: Files userfileacessor.* will be renamed in a following commit to settingsacessor.*. It's not done right now because I think it will make the review easier on gerrit. Reviewed-by: Tobias Hunger Change-Id: I950c813936afb6c55c770e0d6f061eb27b37c47b Reviewed-on: http://codereview.qt-project.org/5081 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
committed by
Leandro T. C. Melo
parent
d8dedb439c
commit
4c4b3be3e6
@@ -217,14 +217,12 @@ Target *Project::target(const QString &id) const
|
||||
void Project::saveSettings()
|
||||
{
|
||||
emit aboutToSaveSettings();
|
||||
UserFileAccessor accessor;
|
||||
accessor.saveSettings(this, toMap());
|
||||
SettingsAccessor::instance()->saveSettings(this, toMap());
|
||||
}
|
||||
|
||||
bool Project::restoreSettings()
|
||||
{
|
||||
UserFileAccessor accessor;
|
||||
QVariantMap map(accessor.restoreSettings(this));
|
||||
QVariantMap map(SettingsAccessor::instance()->restoreSettings(this));
|
||||
bool ok = fromMap(map);
|
||||
if (ok)
|
||||
emit settingsLoaded();
|
||||
|
||||
Reference in New Issue
Block a user