diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-04-11 15:13:51 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-04-12 09:36:04 +0000 |
commit | d1c3b5bd71fec9e6d7b14a8e1c2363c6eaafe8c2 (patch) | |
tree | f0e74b351937020fdae9eb63f925f504092118bf /src/plugins/projectexplorer/buildstep.h | |
parent | ca39832c5df3c92ac1544168fbd5655886ea6c1e (diff) |
ProjectExplorer: Remember build step expansion state
... when switching targets.
If a user expands a build step and then switches the target, it's
reasonable for them to assume that the step is still expanded when
switching back.
Ideally, we would also do this for aspects (if only for consistency),
but unlike for build steps there's no central code location, so let's
leave it at this for now.
Fixes: QTCREATORBUG-21343
Change-Id: Ic142ab5d676bf7d3b6aeabb6f7a26be7bd18f22c
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/buildstep.h')
-rw-r--r-- | src/plugins/projectexplorer/buildstep.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index 4d2cf7bea2..0abf7d5b78 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -28,6 +28,7 @@ #include "projectconfiguration.h" #include "projectexplorer_export.h" +#include <utils/optional.h> #include <utils/qtcassert.h> #include <QFutureInterface> @@ -88,6 +89,10 @@ public: bool widgetExpandedByDefault() const; void setWidgetExpandedByDefault(bool widgetExpandedByDefault); + bool hasUserExpansionState() const { return m_wasExpanded.has_value(); } + bool wasUserExpanded() const { return m_wasExpanded.value_or(false); } + void setUserExpanded(bool expanded) { m_wasExpanded = expanded; } + bool isImmutable() const { return m_immutable; } void setImmutable(bool immutable) { m_immutable = immutable; } @@ -123,6 +128,7 @@ private: bool m_immutable = false; bool m_widgetExpandedByDefault = true; bool m_runInGuiThread = true; + Utils::optional<bool> m_wasExpanded; }; class PROJECTEXPLORER_EXPORT BuildStepInfo |