Fix the open recent database menu.

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>
This commit is contained in:
Benjamin Robin 2015-08-28 20:01:09 +02:00 committed by Felix Geyer
parent 7fa0eddc5f
commit d84af2def0

View File

@ -222,6 +222,7 @@ void MainWindow::updateLastDatabasesMenu()
QStringList lastDatabases = config()->get("LastDatabases", QVariant()).toStringList(); QStringList lastDatabases = config()->get("LastDatabases", QVariant()).toStringList();
Q_FOREACH (const QString& database, lastDatabases) { Q_FOREACH (const QString& database, lastDatabases) {
QAction* action = m_ui->menuRecentDatabases->addAction(database); QAction* action = m_ui->menuRecentDatabases->addAction(database);
action->setData(database);
m_lastDatabasesActions->addAction(action); m_lastDatabasesActions->addAction(action);
} }
m_ui->menuRecentDatabases->addSeparator(); m_ui->menuRecentDatabases->addSeparator();
@ -252,7 +253,7 @@ void MainWindow::updateCopyAttributesMenu()
void MainWindow::openRecentDatabase(QAction* action) void MainWindow::openRecentDatabase(QAction* action)
{ {
openDatabase(action->text()); openDatabase(action->data().toString());
} }
void MainWindow::clearLastDatabases() void MainWindow::clearLastDatabases()