-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #24678: Remember which tab was last open within a session #24999
base: master
Are you sure you want to change the base?
Fix #24678: Remember which tab was last open within a session #24999
Conversation
|
||
void AppShellConfiguration::setPreferencesDialogLastOpenedPageId(QString lastOpenedPageId) | ||
{ | ||
LOGI() << "tpacebes nuevo lastOpenedPageId" << lastOpenedPageId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this before we merge the PR; if all temporary debug log messages would be kept, then the logs would become a bit too cluttered :)
a946d0d
to
8560e29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final comments already!
virtual QString preferencesDialogLastOpenedPageId() const = 0; | ||
virtual void setPreferencesDialogLastOpenedPageId(QString lastOpenedPageId) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, a "const reference" can be used in both methods, to prevent unnecessarily creating a copy of the QString:
virtual QString preferencesDialogLastOpenedPageId() const = 0; | |
virtual void setPreferencesDialogLastOpenedPageId(QString lastOpenedPageId) = 0; | |
virtual const QString& preferencesDialogLastOpenedPageId() const = 0; | |
virtual void setPreferencesDialogLastOpenedPageId(const QString& lastOpenedPageId) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if (configuration()->preferencesDialogLastOpenedPageId().isEmpty()) { | ||
setCurrentPageId("general"); | ||
} else { | ||
setCurrentPageId(configuration()->preferencesDialogLastOpenedPageId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's prevent calling configuration()->preferencesDialogLastOpenedPageId()
twice:
if (configuration()->preferencesDialogLastOpenedPageId().isEmpty()) { | |
setCurrentPageId("general"); | |
} else { | |
setCurrentPageId(configuration()->preferencesDialogLastOpenedPageId()); | |
const QString& lastOpenedPageId = configuration()->preferencesDialogLastOpenedPageId(); | |
if (lastOpenedPageId.isEmpty()) { | |
setCurrentPageId("general"); | |
} else { | |
setCurrentPageId(lastOpenedPageId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
8560e29
to
27b18da
Compare
27b18da
to
5a69765
Compare
Resolves: #24678
This change remembers the tab you where within the Preferences window when opening the window again within the same session.