On 30/03/2019 14:17, David Faure wrote: > On samedi 30 mars 2019 14:54:31 CET Colin Fletcher wrote: >> On 30/03/2019 12:09, David Faure wrote: >>> On samedi 30 mars 2019 13:05:13 CET Colin Fletcher wrote: >>>> On 30/03/2019 11:41, David Faure wrote: >>>>> On samedi 30 mars 2019 12:37:57 CET Colin Fletcher via Rosegarden-devel >>> >>> wrote: >>>>>> no known conversion for argument 2 from ‘std::nullptr_t’ >>>>>> to ‘QSharedPointer<Rosegarden::AudioPluginManager>’ >>>>> >>>>> QSharedPtr only gained support for nullptr_t in Qt 5.8. >>>>> >>>>> Is your Qt version older than that? >>>> >>>> Ah, yes, debian stable here has Qt 5.7.1. That explains it: thank you! >>>> >>>> I'll be a little sad if it turns out that building Rosegarden on debian >>>> stable isn't possible any more, but if I'm the last one left trying to >>>> build it on a distro that doesn't have Qt 5.8, I'm willing to concede >>>> that I'm just an old stick-in-the-mud and patch it myself locally. >>> >>> Nah, just change the code to use {} instead of nullptr. >> >> For the record, here's the patch of what I've done to get it to build: >> feel free to apply it if anyone else is interested in keeping Qt 5.7 >> compatibility; otherwise, don't worry about it. > > For my own curiosity: just writing {} didn't work? At least in the function > calls, maybe not in the assignment. > > Like this: > return {}; > or > RosegardenDocument doc(nullptr, {}, true /*skip autoload*/, true, false > /*no sound*/); > > Then the patch is less intrusive/verbose and can be pushed, IMHO.
I didn't even know you could do that! I assume it's a C++11ism. I saw that you wrote it above, but I just assumed you meant it as some shorthand, and that I was just too dim to work out how you meant it to be interpreted... So I've learned something new, too, which is always a bonus: thank you! Updated patch with {} attached. Cheers, Colin. >
From fe5a134c824fae887981f9f2ddac909ce01b1648 Mon Sep 17 00:00:00 2001 From: Colin Fletcher <colin.m.fletc...@googlemail.com> Date: Sat, 30 Mar 2019 13:00:05 +0000 Subject: Fix build with Qt 5.7.1 (use {} instead of nullptr for QSharedPointer<>) diff --git a/rosegarden/src/gui/application/RosegardenMainWindow.cpp b/rosegarden/src/gui/application/RosegardenMainWindow.cpp index ec830d8a7..c0f85bb91 100644 --- a/rosegarden/src/gui/application/RosegardenMainWindow.cpp +++ b/rosegarden/src/gui/application/RosegardenMainWindow.cpp @@ -7945,7 +7945,7 @@ RosegardenMainWindow::slotImportStudioFromFile(const QString &file) // We're only using this document temporarily, so we don't want to let it // obliterate the command history! bool clearCommandHistory = false, skipAutoload = true; - RosegardenDocument *doc = new RosegardenDocument(this, nullptr, skipAutoload, clearCommandHistory, m_useSequencer); + RosegardenDocument *doc = new RosegardenDocument(this, {}, skipAutoload, clearCommandHistory, m_useSequencer); Studio &oldStudio = m_doc->getStudio(); Studio &newStudio = doc->getStudio(); diff --git a/rosegarden/src/gui/dialogs/ImportDeviceDialog.cpp b/rosegarden/src/gui/dialogs/ImportDeviceDialog.cpp index 179cc3a9e..bec1fc7a7 100644 --- a/rosegarden/src/gui/dialogs/ImportDeviceDialog.cpp +++ b/rosegarden/src/gui/dialogs/ImportDeviceDialog.cpp @@ -341,7 +341,7 @@ bool ImportDeviceDialog::importFromRG(QString fileName) { bool skipAutoload = true, clearCommandHistory = false; - RosegardenDocument fileDoc(RosegardenMainWindow::self(), nullptr, + RosegardenDocument fileDoc(RosegardenMainWindow::self(), {}, skipAutoload, clearCommandHistory); if (!fileDoc.openDocument(fileName, false)) { diff --git a/rosegarden/src/gui/editors/notation/SystemFont.cpp b/rosegarden/src/gui/editors/notation/SystemFont.cpp index 582ad718e..20f58d5d2 100644 --- a/rosegarden/src/gui/editors/notation/SystemFont.cpp +++ b/rosegarden/src/gui/editors/notation/SystemFont.cpp @@ -101,7 +101,7 @@ SystemFont::loadSystemFont(const SystemFontSpec &spec) } NOTATION_DEBUG << "SystemFont::loadSystemFont[Qt]: Wrong family returned, failing"; - qFontMap[name] = nullptr; + qFontMap[name] = {}; return nullptr; } diff --git a/rosegarden/src/gui/studio/AudioPluginManager.cpp b/rosegarden/src/gui/studio/AudioPluginManager.cpp index ad0f9a3df..26b72f91c 100644 --- a/rosegarden/src/gui/studio/AudioPluginManager.cpp +++ b/rosegarden/src/gui/studio/AudioPluginManager.cpp @@ -197,7 +197,7 @@ AudioPluginManager::getPlugin(int number) awaitEnumeration(); if (number < 0 || number > (int(m_plugins.size()) - 1)) - return nullptr; + return {}; return m_plugins[number]; } @@ -246,7 +246,7 @@ AudioPluginManager::getPluginByIdentifier(QString identifier) return (*it); } - return nullptr; + return {}; } QSharedPointer<AudioPlugin> @@ -260,7 +260,7 @@ AudioPluginManager::getPluginByUniqueId(unsigned long uniqueId) return (*it); } - return nullptr; + return {}; } AudioPluginManager::iterator diff --git a/rosegarden/test/lilypond/lilypond_export_test.cpp b/rosegarden/test/lilypond/lilypond_export_test.cpp index c29acc98a..360ad99ef 100644 --- a/rosegarden/test/lilypond/lilypond_export_test.cpp +++ b/rosegarden/test/lilypond/lilypond_export_test.cpp @@ -86,7 +86,7 @@ void TestLilypondExport::init() void TestLilypondExport::testEmptyDocument() { // GIVEN a document and a lilypond exporter - RosegardenDocument doc(nullptr, nullptr, true /*skip autoload*/, true, false /*no sound*/); + RosegardenDocument doc(nullptr, {}, true /*skip autoload*/, true, false /*no sound*/); const QString fileName = "out.ly"; LilyPondExporter exporter(&doc, SegmentSelection(), qstrtostr(fileName)); @@ -188,7 +188,7 @@ void TestLilypondExport::testExamples() settings.setValue("lilyexportbeamings", (options & ExportBeaming) ? true : false); settings.endGroup(); - RosegardenDocument doc(nullptr, nullptr, true /*skip autoload*/, true, false /*no sequencer*/); + RosegardenDocument doc(nullptr, {}, true /*skip autoload*/, true, false /*no sequencer*/); doc.openDocument(input, false /*not permanent, i.e. don't create midi devices*/, true /*no progress dlg*/); LilyPondExporter exporter(&doc, SegmentSelection(), qstrtostr(fileName)); diff --git a/rosegarden/test/test_notationview_selection.cpp b/rosegarden/test/test_notationview_selection.cpp index 426ee4065..c521feeae 100644 --- a/rosegarden/test/test_notationview_selection.cpp +++ b/rosegarden/test/test_notationview_selection.cpp @@ -22,7 +22,7 @@ class TestNotationViewSelection : public QObject public: TestNotationViewSelection() - : m_doc(nullptr, nullptr, true /*skip autoload*/, true, false /*no sound*/), + : m_doc(nullptr, {}, true /*skip autoload*/, true, false /*no sound*/), m_view(nullptr) {} private Q_SLOTS:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Rosegarden-devel mailing list Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel