From 63a58858e80d659f33c5975714b6e4e305429867 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 8 Sep 2020 16:23:55 -0700 Subject: [PATCH] Fix deprecation warnings in amuse-gui --- Editor/Common.cpp | 4 +- Editor/KeyboardWidget.cpp | 4 +- Editor/KeymapEditor.cpp | 4 +- Editor/MainWindow.cpp | 9 ++- Editor/MainWindow.hpp | 4 +- Editor/SoundMacroEditor.cpp | 2 +- Editor/StudioSetupWidget.cpp | 2 +- Editor/resources/lang_de.ts | 144 +++++++++++++++++------------------ 8 files changed, 87 insertions(+), 86 deletions(-) diff --git a/Editor/Common.cpp b/Editor/Common.cpp index 440d644..d3f6808 100644 --- a/Editor/Common.cpp +++ b/Editor/Common.cpp @@ -73,8 +73,8 @@ void ShowInGraphicalShell(QWidget* parent, const QString& pathIn) { // we cannot select a file here, because no file browser really supports it... const QString folder = fileInfo.isDir() ? fileInfo.absoluteFilePath() : fileInfo.filePath(); QProcess browserProc; - const QString browserArgs = QStringLiteral("xdg-open \"%1\"").arg(QFileInfo(folder).path()); - browserProc.startDetached(browserArgs); + const QStringList browserArgs = QStringList() << QStringLiteral("%1").arg(QFileInfo(folder).path()); + browserProc.startDetached(QStringLiteral("xdg-open"), browserArgs); #endif } diff --git a/Editor/KeyboardWidget.cpp b/Editor/KeyboardWidget.cpp index 41ec70e..b13ce4a 100644 --- a/Editor/KeyboardWidget.cpp +++ b/Editor/KeyboardWidget.cpp @@ -39,7 +39,7 @@ KeyboardOctave::KeyboardOctave(int octave, const QString& svgPath, QWidget* pare const auto& naturalKeyName = NaturalKeyNames[i]; if (renderer()->elementExists(naturalKeyName)) { - m_natural[i] = renderer()->matrixForElement(naturalKeyName).mapRect(renderer()->boundsOnElement(naturalKeyName)); + m_natural[i] = renderer()->transformForElement(naturalKeyName).mapRect(renderer()->boundsOnElement(naturalKeyName)); } } @@ -47,7 +47,7 @@ KeyboardOctave::KeyboardOctave(int octave, const QString& svgPath, QWidget* pare const auto& sharpKeyName = SharpKeyNames[i]; if (renderer()->elementExists(sharpKeyName)) { - m_sharp[i] = renderer()->matrixForElement(sharpKeyName).mapRect(renderer()->boundsOnElement(sharpKeyName)); + m_sharp[i] = renderer()->transformForElement(sharpKeyName).mapRect(renderer()->boundsOnElement(sharpKeyName)); } } diff --git a/Editor/KeymapEditor.cpp b/Editor/KeymapEditor.cpp index 274a189..9fb6b6e 100644 --- a/Editor/KeymapEditor.cpp +++ b/Editor/KeymapEditor.cpp @@ -174,7 +174,7 @@ KeymapView::KeymapView(QWidget* parent) if (m_octaveRenderer.elementExists(naturalKeyName)) { m_natural[i] = - m_octaveRenderer.matrixForElement(naturalKeyName).mapRect(m_octaveRenderer.boundsOnElement(naturalKeyName)); + m_octaveRenderer.transformForElement(naturalKeyName).mapRect(m_octaveRenderer.boundsOnElement(naturalKeyName)); } } @@ -183,7 +183,7 @@ KeymapView::KeymapView(QWidget* parent) if (m_octaveRenderer.elementExists(sharpKeyName)) { m_sharp[i] = - m_octaveRenderer.matrixForElement(sharpKeyName).mapRect(m_octaveRenderer.boundsOnElement(sharpKeyName)); + m_octaveRenderer.transformForElement(sharpKeyName).mapRect(m_octaveRenderer.boundsOnElement(sharpKeyName)); } } diff --git a/Editor/MainWindow.cpp b/Editor/MainWindow.cpp index 492f7bc..d38ec75 100644 --- a/Editor/MainWindow.cpp +++ b/Editor/MainWindow.cpp @@ -519,8 +519,9 @@ bool MainWindow::_setEditor(EditorWidget* editor, bool appendNav) { m_interactiveSeq.reset(); if (editor != m_ui.editorContents->currentWidget() && m_ui.editorContents->currentWidget() != m_faceSvg) getEditorWidget()->unloadData(); - if (appendNav && m_navIt != m_navList.end()) - m_navList.erase(m_navIt + 1, m_navList.end()); + if (appendNav && m_navIt != m_navList.end()) { + m_navList.erase(std::next(m_navIt, 1), m_navList.end()); + } if (!editor || !editor->valid()) { m_ui.editorContents->setCurrentWidget(m_faceSvg); updateWindowTitle(); @@ -1484,12 +1485,12 @@ void MainWindow::newLayersAction() { } void MainWindow::updateNavigationButtons() { - m_goForward->setDisabled(m_navIt == m_navList.end() || m_navIt + 1 == m_navList.end()); + m_goForward->setDisabled(m_navIt == m_navList.end() || std::next(m_navIt, 1) == m_navList.end()); m_goBack->setDisabled(m_navIt == m_navList.begin()); } void MainWindow::goForward() { - if (m_navIt == m_navList.end() || m_navIt + 1 == m_navList.end()) + if (m_navIt == m_navList.end() || std::next(m_navIt, 1) == m_navList.end()) return; ++m_navIt; openEditor(*m_navIt, false); diff --git a/Editor/MainWindow.hpp b/Editor/MainWindow.hpp index f9705b1..11f09c6 100644 --- a/Editor/MainWindow.hpp +++ b/Editor/MainWindow.hpp @@ -113,8 +113,8 @@ class MainWindow : public QMainWindow { Ui::MainWindow m_ui; QAction* m_goBack; QAction* m_goForward; - QLinkedList m_navList; - QLinkedList::iterator m_navIt; + std::list m_navList; + std::list::iterator m_navIt; QAction* m_clearRecentFileAct; QAction* m_recentFileActs[MaxRecentFiles]; TreeDelegate m_treeDelegate; diff --git a/Editor/SoundMacroEditor.cpp b/Editor/SoundMacroEditor.cpp index f963df2..c25d489 100644 --- a/Editor/SoundMacroEditor.cpp +++ b/Editor/SoundMacroEditor.cpp @@ -811,7 +811,7 @@ CatalogueItem::CatalogueItem(amuse::SoundMacro::CmdOp op, const QString& name, c CatalogueItem::CatalogueItem(const CatalogueItem& other, QWidget* parent) : QWidget(parent), m_op(other.getCmdOp()) { QHBoxLayout* layout = new QHBoxLayout; QHBoxLayout* oldLayout = static_cast(other.layout()); - m_iconLab.setPixmap(*static_cast(oldLayout->itemAt(0)->widget())->pixmap()); + m_iconLab.setPixmap(static_cast(oldLayout->itemAt(0)->widget())->pixmap(Qt::ReturnByValue)); layout->addWidget(&m_iconLab); m_label.setText(static_cast(oldLayout->itemAt(1)->widget())->text()); layout->addWidget(&m_label); diff --git a/Editor/StudioSetupWidget.cpp b/Editor/StudioSetupWidget.cpp index 6640bfa..52cc481 100644 --- a/Editor/StudioSetupWidget.cpp +++ b/Editor/StudioSetupWidget.cpp @@ -740,7 +740,7 @@ EffectCatalogueItem::EffectCatalogueItem(const EffectCatalogueItem& other, QWidg : QWidget(parent), m_type(other.getType()) { QHBoxLayout* layout = new QHBoxLayout; QHBoxLayout* oldLayout = static_cast(other.layout()); - m_iconLab.setPixmap(*static_cast(oldLayout->itemAt(0)->widget())->pixmap()); + m_iconLab.setPixmap(static_cast(oldLayout->itemAt(0)->widget())->pixmap(Qt::ReturnByValue)); layout->addWidget(&m_iconLab); m_label.setText(static_cast(oldLayout->itemAt(1)->widget())->text()); layout->addWidget(&m_label); diff --git a/Editor/resources/lang_de.ts b/Editor/resources/lang_de.ts index 2e3087c..7d10915 100644 --- a/Editor/resources/lang_de.ts +++ b/Editor/resources/lang_de.ts @@ -707,13 +707,13 @@ - + The directory at '%1' must not be empty. - + Directory empty @@ -763,257 +763,257 @@ - - + + Unsaved Changes - + Save Changes in %1? - + New Project - + The directory at '%1' does not exist. - + Bad Directory - + Opening - - - - - + + + + + Scanning Project - + Opening %1 - + Open Project - + Discard Changes in %1? - + Reloading Samples - + Scanning %1 - + Import Project - + The file at '%1' could not be interpreted as a MusyX container. - + Unsupported MusyX Container - + Sample Import Mode - + Amuse can import samples as WAV files for ease of editing, import original compressed data for lossless repacking, or both. Exporting the project will prefer whichever version was modified most recently. - + Import Compressed - + Import WAVs - + Import Both - + Raw Import Mode - + Would you like to scan for all MusyX group files in this directory? - + Project Name - + What should this project be named? - - + + Importing - - + + Importing %1 - + Import Songs - + Exporting - + Exporting %1 - - + + Import C Headers - + <p>Importing names from C headers depends on up-to-date, consistent names relative to the sound group data.</p><p>Headers are imported on a per-subproject basis from a single directory. Headers must be named with the form <code>&lt;subproject&gt;.h</code>.</p><p>Group, Song and SFX definitions are matched according to the following forms:<pre>#define GRP&lt;name&gt; &lt;id&gt; #define SNG&lt;name&gt; &lt;id&gt; #define SFX&lt;name> &lt;id&gt;</pre></p><p><strong>This operation cannot be undone! It is recommended to make a backup of the project directory before proceeding.</strong></p><p>Continue?</p> - + Export C Headers - + New Subproject - + What should this subproject be named? - + New SFX Group - + What should the new SFX group in %1 be named? - + New Song Group - + What should the new Song group in %1 be named? - + New ADSR - + What should the new ADSR in %1 be named? - + New Curve - + What should the new Curve in %1 be named? - + New Keymap - + What should the new Keymap in %1 be named? - + New Layers - + What should the new Layers in %1 be named? - + About Amuse - + Export Complete - + %1? @@ -1573,7 +1573,7 @@ QDialogButtonBox - + OK @@ -1581,12 +1581,12 @@ QMessageBox - + <h3>About Amuse</h3> - + <p>Amuse is an alternate editor and runtime library for MusyX sound groups.</p><p>MusyX originally served as a widely-deployed audio system for developing games on the Nintendo 64, GameCube, and GameBoy Advance.</p><p>Amuse is available under the MIT license.<br>Please see <a href="https://gitlab.axiodl.com/AxioDL/amuse/blob/master/LICENSE">https://gitlab.axiodl.com/AxioDL/amuse/blob/master/LICENSE</a> for futher information.</p><p>Copyright (C) 2015-2018 Antidote / Jackoalan.</p><p>MusyX is a trademark of Factor 5, LLC.</p><p>Nintendo 64, GameCube, and GameBoy Advance are trademarks of Nintendo Co., Ltd.</p> @@ -2041,52 +2041,52 @@ TreeDelegate - + Export GameCube Group - + Find Usages - + Cut - + Copy - + Paste - + Duplicate - + Delete - + Rename - + Exporting - + Exporting %1