mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-14 18:16:38 -04:00
Show database public icon on tab when visible
This commit is contained in:
parent
15ac8ac4f8
commit
ee320aa202
@ -25,6 +25,7 @@
|
||||
#include "core/Tools.h"
|
||||
#include "format/CsvExporter.h"
|
||||
#include "gui/Clipboard.h"
|
||||
#include "gui/DatabaseIcons.h"
|
||||
#include "gui/DatabaseOpenDialog.h"
|
||||
#include "gui/DatabaseWidget.h"
|
||||
#include "gui/DatabaseWidgetStateSync.h"
|
||||
@ -675,6 +676,12 @@ void DatabaseTabWidget::updateTabName(int index)
|
||||
index = indexOf(dbWidget);
|
||||
setTabText(index, tabName(index));
|
||||
setTabToolTip(index, dbWidget->displayFilePath());
|
||||
auto iconIndex = dbWidget->database()->publicIcon();
|
||||
if (iconIndex >= 0 && iconIndex < databaseIcons()->count()) {
|
||||
setTabIcon(index, databaseIcons()->icon(iconIndex));
|
||||
} else {
|
||||
setTabIcon(index, {});
|
||||
}
|
||||
emit tabNameChanged();
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,11 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
|
||||
{
|
||||
Q_ASSERT(m_db);
|
||||
|
||||
// Read public headers if the database hasn't been opened yet
|
||||
if (!m_db->isInitialized()) {
|
||||
m_db->open(nullptr);
|
||||
}
|
||||
|
||||
m_messageWidget->setHidden(true);
|
||||
|
||||
auto mainLayout = new QVBoxLayout();
|
||||
@ -2095,6 +2100,7 @@ bool DatabaseWidget::lock()
|
||||
switchToOpenDatabase(m_db->filePath());
|
||||
|
||||
auto newDb = QSharedPointer<Database>::create(m_db->filePath());
|
||||
newDb->open(nullptr);
|
||||
replaceDatabase(newDb);
|
||||
|
||||
m_attemptingLock = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user