Fix deprecation warnings in amuse-gui

This commit is contained in:
Phillip Stephens 2020-09-08 16:23:55 -07:00
parent f172427991
commit 63a58858e8
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
8 changed files with 87 additions and 86 deletions

View File

@ -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
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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);

View File

@ -113,8 +113,8 @@ class MainWindow : public QMainWindow {
Ui::MainWindow m_ui;
QAction* m_goBack;
QAction* m_goForward;
QLinkedList<ProjectModel::INode*> m_navList;
QLinkedList<ProjectModel::INode*>::iterator m_navIt;
std::list<ProjectModel::INode*> m_navList;
std::list<ProjectModel::INode*>::iterator m_navIt;
QAction* m_clearRecentFileAct;
QAction* m_recentFileActs[MaxRecentFiles];
TreeDelegate m_treeDelegate;

View File

@ -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<QHBoxLayout*>(other.layout());
m_iconLab.setPixmap(*static_cast<QLabel*>(oldLayout->itemAt(0)->widget())->pixmap());
m_iconLab.setPixmap(static_cast<QLabel*>(oldLayout->itemAt(0)->widget())->pixmap(Qt::ReturnByValue));
layout->addWidget(&m_iconLab);
m_label.setText(static_cast<QLabel*>(oldLayout->itemAt(1)->widget())->text());
layout->addWidget(&m_label);

View File

@ -740,7 +740,7 @@ EffectCatalogueItem::EffectCatalogueItem(const EffectCatalogueItem& other, QWidg
: QWidget(parent), m_type(other.getType()) {
QHBoxLayout* layout = new QHBoxLayout;
QHBoxLayout* oldLayout = static_cast<QHBoxLayout*>(other.layout());
m_iconLab.setPixmap(*static_cast<QLabel*>(oldLayout->itemAt(0)->widget())->pixmap());
m_iconLab.setPixmap(static_cast<QLabel*>(oldLayout->itemAt(0)->widget())->pixmap(Qt::ReturnByValue));
layout->addWidget(&m_iconLab);
m_label.setText(static_cast<QLabel*>(oldLayout->itemAt(1)->widget())->text());
layout->addWidget(&m_label);

View File

@ -707,13 +707,13 @@
</message>
<message>
<location filename="../MainWindow.cpp" line="282"/>
<location filename="../MainWindow.cpp" line="758"/>
<location filename="../MainWindow.cpp" line="759"/>
<source>The directory at &apos;%1&apos; must not be empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="283"/>
<location filename="../MainWindow.cpp" line="759"/>
<location filename="../MainWindow.cpp" line="760"/>
<source>Directory empty</source>
<translation type="unfinished"></translation>
</message>
@ -763,257 +763,257 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="711"/>
<location filename="../MainWindow.cpp" line="852"/>
<location filename="../MainWindow.cpp" line="712"/>
<location filename="../MainWindow.cpp" line="853"/>
<source>Unsaved Changes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="711"/>
<location filename="../MainWindow.cpp" line="712"/>
<source>Save Changes in %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="736"/>
<location filename="../MainWindow.cpp" line="737"/>
<source>New Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="762"/>
<location filename="../MainWindow.cpp" line="763"/>
<source>The directory at &apos;%1&apos; does not exist.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="763"/>
<location filename="../MainWindow.cpp" line="764"/>
<source>Bad Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="777"/>
<location filename="../MainWindow.cpp" line="778"/>
<source>Opening</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="777"/>
<location filename="../MainWindow.cpp" line="880"/>
<location filename="../MainWindow.cpp" line="961"/>
<location filename="../MainWindow.cpp" line="998"/>
<location filename="../MainWindow.cpp" line="1043"/>
<location filename="../MainWindow.cpp" line="778"/>
<location filename="../MainWindow.cpp" line="881"/>
<location filename="../MainWindow.cpp" line="962"/>
<location filename="../MainWindow.cpp" line="999"/>
<location filename="../MainWindow.cpp" line="1044"/>
<source>Scanning Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="787"/>
<location filename="../MainWindow.cpp" line="788"/>
<source>Opening %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="802"/>
<location filename="../MainWindow.cpp" line="803"/>
<source>Open Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="852"/>
<location filename="../MainWindow.cpp" line="853"/>
<source>Discard Changes in %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="880"/>
<location filename="../MainWindow.cpp" line="881"/>
<source>Reloading Samples</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="891"/>
<location filename="../MainWindow.cpp" line="892"/>
<source>Scanning %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="900"/>
<location filename="../MainWindow.cpp" line="901"/>
<source>Import Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="912"/>
<location filename="../MainWindow.cpp" line="913"/>
<source>The file at &apos;%1&apos; could not be interpreted as a MusyX container.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="913"/>
<location filename="../MainWindow.cpp" line="914"/>
<source>Unsupported MusyX Container</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="918"/>
<location filename="../MainWindow.cpp" line="919"/>
<source>Sample Import Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="919"/>
<location filename="../MainWindow.cpp" line="920"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="923"/>
<location filename="../MainWindow.cpp" line="924"/>
<source>Import Compressed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="923"/>
<location filename="../MainWindow.cpp" line="924"/>
<source>Import WAVs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="923"/>
<location filename="../MainWindow.cpp" line="924"/>
<source>Import Both</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="937"/>
<location filename="../MainWindow.cpp" line="938"/>
<source>Raw Import Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="938"/>
<location filename="../MainWindow.cpp" line="939"/>
<source>Would you like to scan for all MusyX group files in this directory?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="946"/>
<location filename="../MainWindow.cpp" line="947"/>
<source>Project Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="946"/>
<location filename="../MainWindow.cpp" line="947"/>
<source>What should this project be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="961"/>
<location filename="../MainWindow.cpp" line="998"/>
<location filename="../MainWindow.cpp" line="962"/>
<location filename="../MainWindow.cpp" line="999"/>
<source>Importing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="969"/>
<location filename="../MainWindow.cpp" line="1004"/>
<location filename="../MainWindow.cpp" line="970"/>
<location filename="../MainWindow.cpp" line="1005"/>
<source>Importing %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1019"/>
<location filename="../MainWindow.cpp" line="1020"/>
<source>Import Songs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1043"/>
<location filename="../MainWindow.cpp" line="1044"/>
<source>Exporting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1049"/>
<location filename="../MainWindow.cpp" line="1050"/>
<source>Exporting %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1064"/>
<location filename="../MainWindow.cpp" line="1080"/>
<location filename="../MainWindow.cpp" line="1065"/>
<location filename="../MainWindow.cpp" line="1081"/>
<source>Import C Headers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1065"/>
<location filename="../MainWindow.cpp" line="1066"/>
<source>&lt;p&gt;Importing names from C headers depends on up-to-date, consistent names relative to the sound group data.&lt;/p&gt;&lt;p&gt;Headers are imported on a per-subproject basis from a single directory. Headers must be named with the form &lt;code&gt;&amp;lt;subproject&amp;gt;.h&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Group, Song and SFX definitions are matched according to the following forms:&lt;pre&gt;#define GRP&amp;lt;name&amp;gt; &amp;lt;id&amp;gt;
#define SNG&amp;lt;name&amp;gt; &amp;lt;id&amp;gt;
#define SFX&amp;lt;name&gt; &amp;lt;id&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;This operation cannot be undone! It is recommended to make a backup of the project directory before proceeding.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Continue?&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1103"/>
<location filename="../MainWindow.cpp" line="1104"/>
<source>Export C Headers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1309"/>
<location filename="../MainWindow.cpp" line="1310"/>
<source>New Subproject</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1309"/>
<location filename="../MainWindow.cpp" line="1310"/>
<source>What should this subproject be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1329"/>
<location filename="../MainWindow.cpp" line="1330"/>
<source>New SFX Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1329"/>
<location filename="../MainWindow.cpp" line="1330"/>
<source>What should the new SFX group in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1353"/>
<location filename="../MainWindow.cpp" line="1354"/>
<source>New Song Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1353"/>
<location filename="../MainWindow.cpp" line="1354"/>
<source>What should the new Song group in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1403"/>
<location filename="../MainWindow.cpp" line="1404"/>
<source>New ADSR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1403"/>
<location filename="../MainWindow.cpp" line="1404"/>
<source>What should the new ADSR in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1426"/>
<location filename="../MainWindow.cpp" line="1427"/>
<source>New Curve</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1426"/>
<location filename="../MainWindow.cpp" line="1427"/>
<source>What should the new Curve in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1449"/>
<location filename="../MainWindow.cpp" line="1450"/>
<source>New Keymap</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1449"/>
<location filename="../MainWindow.cpp" line="1450"/>
<source>What should the new Keymap in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1472"/>
<location filename="../MainWindow.cpp" line="1473"/>
<source>New Layers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1472"/>
<location filename="../MainWindow.cpp" line="1473"/>
<source>What should the new Layers in %1 be named?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1566"/>
<location filename="../MainWindow.cpp" line="1567"/>
<source>About Amuse</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1805"/>
<location filename="../MainWindow.cpp" line="1806"/>
<source>Export Complete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1805"/>
<location filename="../MainWindow.cpp" line="1806"/>
<source>%1?</source>
<translation type="unfinished"></translation>
</message>
@ -1573,7 +1573,7 @@
<context>
<name>QDialogButtonBox</name>
<message>
<location filename="../MainWindow.cpp" line="1828"/>
<location filename="../MainWindow.cpp" line="1829"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
@ -1581,12 +1581,12 @@
<context>
<name>QMessageBox</name>
<message>
<location filename="../MainWindow.cpp" line="1552"/>
<location filename="../MainWindow.cpp" line="1553"/>
<source>&lt;h3&gt;About Amuse&lt;/h3&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1554"/>
<location filename="../MainWindow.cpp" line="1555"/>
<source>&lt;p&gt;Amuse is an alternate editor and runtime library for MusyX sound groups.&lt;/p&gt;&lt;p&gt;MusyX originally served as a widely-deployed audio system for developing games on the Nintendo 64, GameCube, and GameBoy Advance.&lt;/p&gt;&lt;p&gt;Amuse is available under the MIT license.&lt;br&gt;Please see &lt;a href=&quot;https://gitlab.axiodl.com/AxioDL/amuse/blob/master/LICENSE&quot;&gt;https://gitlab.axiodl.com/AxioDL/amuse/blob/master/LICENSE&lt;/a&gt; for futher information.&lt;/p&gt;&lt;p&gt;Copyright (C) 2015-2018 Antidote / Jackoalan.&lt;/p&gt;&lt;p&gt;MusyX is a trademark of Factor 5, LLC.&lt;/p&gt;&lt;p&gt;Nintendo 64, GameCube, and GameBoy Advance are trademarks of Nintendo Co., Ltd.&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
@ -2041,52 +2041,52 @@
<context>
<name>TreeDelegate</name>
<message>
<location filename="../MainWindow.cpp" line="1133"/>
<location filename="../MainWindow.cpp" line="1134"/>
<source>Export GameCube Group</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1141"/>
<location filename="../MainWindow.cpp" line="1142"/>
<source>Find Usages</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1149"/>
<location filename="../MainWindow.cpp" line="1150"/>
<source>Cut</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1157"/>
<location filename="../MainWindow.cpp" line="1158"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1165"/>
<location filename="../MainWindow.cpp" line="1166"/>
<source>Paste</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1173"/>
<location filename="../MainWindow.cpp" line="1174"/>
<source>Duplicate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1178"/>
<location filename="../MainWindow.cpp" line="1179"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1186"/>
<location filename="../MainWindow.cpp" line="1187"/>
<source>Rename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1215"/>
<location filename="../MainWindow.cpp" line="1216"/>
<source>Exporting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../MainWindow.cpp" line="1215"/>
<location filename="../MainWindow.cpp" line="1216"/>
<source>Exporting %1</source>
<translation type="unfinished"></translation>
</message>