mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-06 21:44:32 -04:00
Check if a database is present before trying to create the CopyAttributesMenu.
Closes #50
This commit is contained in:
parent
e85dbda62a
commit
50148e9640
1 changed files with 7 additions and 4 deletions
|
@ -205,12 +205,15 @@ void MainWindow::updateLastDatabasesMenu()
|
||||||
|
|
||||||
void MainWindow::updateCopyAttributesMenu()
|
void MainWindow::updateCopyAttributesMenu()
|
||||||
{
|
{
|
||||||
m_ui->menuEntryCopyAttribute->clear();
|
|
||||||
|
|
||||||
DatabaseWidget* dbWidget = m_ui->tabWidget->currentDatabaseWidget();
|
DatabaseWidget* dbWidget = m_ui->tabWidget->currentDatabaseWidget();
|
||||||
Q_ASSERT(dbWidget);
|
if (!dbWidget) {
|
||||||
Q_ASSERT(dbWidget->entryView()->isSingleEntrySelected());
|
return;
|
||||||
|
}
|
||||||
|
if (!dbWidget->entryView()->isSingleEntrySelected()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->menuEntryCopyAttribute->clear();
|
||||||
Entry* entry = dbWidget->entryView()->currentEntry();
|
Entry* entry = dbWidget->entryView()->currentEntry();
|
||||||
|
|
||||||
Q_FOREACH (const QString& key, EntryAttributes::DefaultAttributes) {
|
Q_FOREACH (const QString& key, EntryAttributes::DefaultAttributes) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue