diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2010-01-19 16:33:44 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2010-02-01 12:23:14 +0100 |
commit | 788b294a30c1066da01cda7b37b573ef28a2e50a (patch) | |
tree | 248560aace7e46e721f23e247d146d0a923d3689 /src/plugins/projectexplorer/project.h | |
parent | 4ee223d45d1d2afb465ee6f0a0c65c928c01204b (diff) | |
download | qt-creator-788b294a30c1066da01cda7b37b573ef28a2e50a.tar.gz |
Make project use toMap/fromMap to save state
* That is what everybody else is using now.
Reviewed-by: dt
Diffstat (limited to 'src/plugins/projectexplorer/project.h')
-rw-r--r-- | src/plugins/projectexplorer/project.h | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index eb9d29520b..3d163912b1 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -124,12 +124,22 @@ public: virtual QStringList frameworkPaths(const QString &fileName) const; static QString makeUnique(const QString &preferedName, const QStringList &usedNames); + + // Serialize all data into a QVariantMap. This map is then saved + // in the .user file of the project. + // + // Just put all your data into the map. + // + // Note: Do not forget to call your base class' toMap method. + // Note: Do not forget to call setActiveBuildConfiguration when + // creating new BuilConfigurations. + virtual QVariantMap toMap() const; + signals: void fileListChanged(); // TODO clean up signal names // might be better to also have aboutToRemove signals -// a runconfiguration display name changed is missing void activeBuildConfigurationChanged(); void activeRunConfigurationChanged(); void runConfigurationsEnabledStateChanged(); @@ -141,23 +151,10 @@ signals: void addedBuildConfiguration(ProjectExplorer::BuildConfiguration *bc); protected: - /* This method is called when the project .user file is saved. Simply call - * writer.saveValue() for each value you want to save. Make sure to always - * call your base class implementation. - * - * Note: All the values from the project/buildsteps and buildconfigurations - * are automatically stored. - */ - virtual void saveSettingsImpl(PersistentSettingsWriter &writer); - - /* This method is called when the project is opened. You can retrieve all - * the values you saved in saveSettingsImpl() in this method. - * - * Note: This function is also called if there is no .user file. You should - * probably add some default build and run settings to the project so that - * it can be build and run. - */ - virtual bool restoreSettingsImpl(PersistentSettingsReader &reader); + // restore all data from the map. + // + // Note: Do not forget to call your base class' fromMap method! + virtual bool fromMap(const QVariantMap &map); private: QList<BuildConfiguration *> m_buildConfigurations; |