Skip to content

Commit

Permalink
Fix the open recent database menu.
Browse files Browse the repository at this point in the history
With at least Qt 5.5 the action text is automatically modified from
/home/ben/db.kdbx to /&home/ben/db.kdbx

So add the path of the database to the action using setData

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
  • Loading branch information
benjarobin authored and debfx committed Sep 12, 2015
1 parent 7fa0edd commit d84af2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ void MainWindow::updateLastDatabasesMenu()
QStringList lastDatabases = config()->get("LastDatabases", QVariant()).toStringList();
Q_FOREACH (const QString& database, lastDatabases) {
QAction* action = m_ui->menuRecentDatabases->addAction(database);
action->setData(database);
m_lastDatabasesActions->addAction(action);
}
m_ui->menuRecentDatabases->addSeparator();
Expand Down Expand Up @@ -252,7 +253,7 @@ void MainWindow::updateCopyAttributesMenu()

void MainWindow::openRecentDatabase(QAction* action)
{
openDatabase(action->text());
openDatabase(action->data().toString());
}

void MainWindow::clearLastDatabases()
Expand Down

0 comments on commit d84af2d

Please sign in to comment.