mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
Get modified status directly from database object instead of using window title
This commit is contained in:
parent
a87fab8d18
commit
18b5b76a80
@ -526,6 +526,15 @@ bool DatabaseTabWidget::readOnly(int index)
|
||||
return indexDatabaseManagerStruct(index).readOnly;
|
||||
}
|
||||
|
||||
bool DatabaseTabWidget::isModified(int index)
|
||||
{
|
||||
if (index == -1) {
|
||||
index = currentIndex();
|
||||
}
|
||||
|
||||
return indexDatabaseManagerStruct(index).modified;
|
||||
}
|
||||
|
||||
void DatabaseTabWidget::updateTabName(Database* db)
|
||||
{
|
||||
int index = databaseIndex(db);
|
||||
|
@ -77,6 +77,7 @@ public slots:
|
||||
void changeMasterKey();
|
||||
void changeDatabaseSettings();
|
||||
bool readOnly(int index = -1);
|
||||
bool isModified(int index = -1);
|
||||
void performGlobalAutoType();
|
||||
void lockDatabases();
|
||||
|
||||
|
@ -519,11 +519,12 @@ void MainWindow::updateWindowTitle()
|
||||
windowTitle = BaseWindowTitle;
|
||||
} else {
|
||||
windowTitle = QString("%1 - %2").arg(customWindowTitlePart, BaseWindowTitle);
|
||||
if (customWindowTitlePart.right(1) == "*") {
|
||||
setWindowModified(true);
|
||||
} else {
|
||||
setWindowModified(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ui->tabWidget->isModified(tabWidgetIndex)) {
|
||||
setWindowModified(true);
|
||||
} else {
|
||||
setWindowModified(false);
|
||||
}
|
||||
|
||||
setWindowTitle(windowTitle);
|
||||
|
Loading…
Reference in New Issue
Block a user