mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-30 09:46:30 -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;
|
return indexDatabaseManagerStruct(index).readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DatabaseTabWidget::isModified(int index)
|
||||||
|
{
|
||||||
|
if (index == -1) {
|
||||||
|
index = currentIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
return indexDatabaseManagerStruct(index).modified;
|
||||||
|
}
|
||||||
|
|
||||||
void DatabaseTabWidget::updateTabName(Database* db)
|
void DatabaseTabWidget::updateTabName(Database* db)
|
||||||
{
|
{
|
||||||
int index = databaseIndex(db);
|
int index = databaseIndex(db);
|
||||||
|
@ -77,6 +77,7 @@ public slots:
|
|||||||
void changeMasterKey();
|
void changeMasterKey();
|
||||||
void changeDatabaseSettings();
|
void changeDatabaseSettings();
|
||||||
bool readOnly(int index = -1);
|
bool readOnly(int index = -1);
|
||||||
|
bool isModified(int index = -1);
|
||||||
void performGlobalAutoType();
|
void performGlobalAutoType();
|
||||||
void lockDatabases();
|
void lockDatabases();
|
||||||
|
|
||||||
|
@ -519,12 +519,13 @@ void MainWindow::updateWindowTitle()
|
|||||||
windowTitle = BaseWindowTitle;
|
windowTitle = BaseWindowTitle;
|
||||||
} else {
|
} else {
|
||||||
windowTitle = QString("%1 - %2").arg(customWindowTitlePart, BaseWindowTitle);
|
windowTitle = QString("%1 - %2").arg(customWindowTitlePart, BaseWindowTitle);
|
||||||
if (customWindowTitlePart.right(1) == "*") {
|
}
|
||||||
|
|
||||||
|
if (m_ui->tabWidget->isModified(tabWidgetIndex)) {
|
||||||
setWindowModified(true);
|
setWindowModified(true);
|
||||||
} else {
|
} else {
|
||||||
setWindowModified(false);
|
setWindowModified(false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
setWindowTitle(windowTitle);
|
setWindowTitle(windowTitle);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user