# HG changeset patch # User Chris Cannam # Date 1471275917 -3600 # Node ID cc434d37a126b1cdcd824aa21c9444586089ef64 # Parent 8b89cefa84097ef9c5e9e2129fa7ee8e81441ad6 Patch from Fab Nicol to fix a problem with Recent Files menu: "Patch corrects a linux version bug already there in recent tags (at least 2.5, including in official Linux distros) and apparently remaining unnotices wrt open Recent Files submenu: an offending ampersand in paths (perhaps a Qt bug) makes the menu useless." diff -r 8b89cefa8409 -r cc434d37a126 main/MainWindow.cpp --- a/main/MainWindow.cpp Mon Aug 15 16:42:19 2016 +0100 +++ b/main/MainWindow.cpp Mon Aug 15 16:45:17 2016 +0100 @@ -1764,8 +1764,11 @@ m_recentFilesMenu->clear(); vector files = m_recentFiles.getRecent(); for (size_t i = 0; i < files.size(); ++i) { - QAction *action = new QAction(files[i], this); - connect(action, SIGNAL(triggered()), this, SLOT(openRecentFile())); + /* F. Nicol patch 13 Aug. 2016 */ + const QString& path = files[i]; + QAction *action = new QAction(path, this); + connect(action, &QAction::triggered, [this, path] { openRecentFile(path);}); + /* end of patch */ if (i == 0) { action->setShortcut(tr("Ctrl+R")); m_keyReference->registerShortcut @@ -3073,8 +3076,10 @@ } void -MainWindow::openRecentFile() +MainWindow::openRecentFile(const QString& path) { + /* F. Nicol patch 13 Aug. 2016 */ +#if 0 QObject *obj = sender(); QAction *action = dynamic_cast(obj); @@ -3085,6 +3090,9 @@ } QString path = action->text(); +#endif + /* End of F. Nicol patch 13 Aug. 2016 */ + if (path == "") return; FileOpenStatus status = openPath(path, ReplaceSession); diff -r 8b89cefa8409 -r cc434d37a126 main/MainWindow.h --- a/main/MainWindow.h Mon Aug 15 16:42:19 2016 +0100 +++ b/main/MainWindow.h Mon Aug 15 16:45:17 2016 +0100 @@ -52,7 +52,9 @@ virtual void replaceMainAudio(); virtual void openSomething(); virtual void openLocation(); - virtual void openRecentFile(); + /* F. Nicol patch 13 Aug. 2016 */ + virtual void openRecentFile(const QString& ); + /* End of F. Nicol patch 13 Aug. 2016 */ virtual void applyTemplate(); virtual void exportAudio(); virtual void exportAudioData();