Outline: Redo save/restore of settings

The OutlineStackWidget stored its position in the outline to be able
to save/restore settings specific to the sub-widget (IOutlineWidget).
However, the index can get out sync if another NavigationWidget
with a lower index number is split, and the relative position changes.

The change therefore avoids saving an index, and rather keeps the sum
of all sub-widget settings in a QVariantMap, only reading and writing
to the global settings object if necessary.

The settings are also not stored in the [General] section anymore,
but in a subgroup [Sidebar.Outline.X], where X is the index of the
outline in the view. This avoids having to always iterate over all
keys. No effort has been made to take over the old settings. I doubt
anyone will notice, though.

Change-Id: I85017cbb3e32b0a16da43ce6339deb7a053d6b09
Task-number: QTCREATORBUG-13614
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Kai Koehne
2014-12-09 11:12:17 +01:00
parent 036f4f00eb
commit 32fa850a6d
5 changed files with 37 additions and 34 deletions

View File

@@ -74,8 +74,8 @@ public:
// IOutlineWidget
virtual QList<QAction*> filterMenuActions() const;
virtual void setCursorSynchronization(bool syncWithCursor);
virtual void restoreSettings(int position);
virtual void saveSettings(int position);
virtual void restoreSettings(const QVariantMap &map);
virtual QVariantMap settings() const;
private slots:
void modelUpdated();