-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 setting window title as modified #11542
base: develop
Are you sure you want to change the base?
Fix setting window title as modified #11542
Conversation
Noticed that this fix works, but Qt gives a warning to the console: Even if |
if (isModified) { | ||
// remove asterisk '*' from title | ||
if (!isModified) { | ||
// Remove asterisk '*' from title | ||
customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1); |
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.
This line is not good because it assumes an asterisk is the very last character.
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.
Yes, I have already changed this to .replace()
in my test branch. That line also removed the last ]
in some cases even without this change.
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.
Perhaps an adjustment to the tab widget function is in order as well, I briefly looked at it and seemed too much
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.
Seems that we need a new can after the worms are all out.
if (isModified) { | ||
// remove asterisk '*' from title | ||
if (!isModified) { | ||
// Remove asterisk '*' from title | ||
customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1); | ||
} | ||
m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex)); |
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.
This should be handled within the action state function instead of here.
https://doc.qt.io/qt-5/qwidget.html#windowModified-prop
The placeholder should be in the window title no matter what. |
When creating a new entry to database, the window title does not include an asterisk character. When going to Settings / Password generator, the title appears correctly.
Fixes #11540
Testing strategy
Manually. Switching tab to a closed database, or Settings / Password generator removes the asterisk character from the title.
Type of change