# HG changeset patch # User Chris Cannam # Date 1544009720 0 # Node ID c476db6cf3eb9138be7f9255a47aad62973eefec # Parent e0093740b194ec1a9da229afc0c6b49ba6c9d52f Seems to be some trouble with the function-pointer-based version of the connection here - recent-files menu isn't working on old systems with backward-compatible build - replace with an alternative mechanism again diff -r e0093740b194 -r c476db6cf3eb main/MainWindow.cpp --- a/main/MainWindow.cpp Wed Dec 05 11:34:35 2018 +0000 +++ b/main/MainWindow.cpp Wed Dec 05 11:35:20 2018 +0000 @@ -1943,11 +1943,10 @@ m_recentFilesMenu->clear(); vector files = m_recentFiles.getRecent(); for (size_t i = 0; i < files.size(); ++i) { - /* F. Nicol patch 13 Aug. 2016 */ - const QString& path = files[i]; + QString path = files[i]; QAction *action = new QAction(path, this); - connect(action, &QAction::triggered, [this, path] { openRecentFile(path);}); - /* end of patch */ + action->setObjectName(path); + connect(action, SIGNAL(triggered()), this, SLOT(openRecentFile())); if (i == 0) { action->setShortcut(tr("Ctrl+R")); m_keyReference->registerShortcut @@ -3397,24 +3396,24 @@ } void -MainWindow::openRecentFile(const QString& path) +MainWindow::openRecentFile() { - /* F. Nicol patch 13 Aug. 2016 */ -#if 0 QObject *obj = sender(); QAction *action = dynamic_cast(obj); if (!action) { cerr << "WARNING: MainWindow::openRecentFile: sender is not an action" - << endl; + << endl; return; } - QString path = action->text(); -#endif - /* End of F. Nicol patch 13 Aug. 2016 */ - - if (path == "") return; + QString path = action->objectName(); + + if (path == "") { + cerr << "WARNING: MainWindow::openRecentFile: action incorrectly named" + << endl; + return; + } FileOpenStatus status = openPath(path, ReplaceSession); diff -r e0093740b194 -r c476db6cf3eb main/MainWindow.h --- a/main/MainWindow.h Wed Dec 05 11:34:35 2018 +0000 +++ b/main/MainWindow.h Wed Dec 05 11:35:20 2018 +0000 @@ -54,9 +54,7 @@ virtual void replaceMainAudio(); virtual void openSomething(); virtual void openLocation(); - /* F. Nicol patch 13 Aug. 2016 */ - virtual void openRecentFile(const QString& ); - /* End of F. Nicol patch 13 Aug. 2016 */ + virtual void openRecentFile(); virtual void applyTemplate(); virtual void exportAudio(); virtual void exportAudioData();