Skip to content

Commit

Permalink
Fix some Qt 5.15 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Oct 3, 2020
1 parent 005adac commit 1d3d029
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions libmscore/staff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void Staff::swapBracket(int oldIdx, int newIdx)
fillBrackets(idx);
_brackets[oldIdx]->setColumn(newIdx);
_brackets[newIdx]->setColumn(oldIdx);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
_brackets.swapItemsAt(oldIdx, newIdx);
#else
_brackets.swap(oldIdx, newIdx);
Expand All @@ -179,7 +179,7 @@ void Staff::changeBracketColumn(int oldColumn, int newColumn)
int newIdx = i + step;
_brackets[oldIdx]->setColumn(newIdx);
_brackets[newIdx]->setColumn(oldIdx);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
_brackets.swapItemsAt(oldIdx, newIdx);
#else
_brackets.swap(oldIdx, newIdx);
Expand Down
2 changes: 1 addition & 1 deletion libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ void RemoveExcerpt::redo(EditData*)

void SwapExcerpt::flip(EditData*)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
score->excerpts().swapItemsAt(pos1, pos2);
#else
score->excerpts().swap(pos1, pos2);
Expand Down
4 changes: 4 additions & 0 deletions mu4/instruments/view/instrumentlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ void InstrumentListModel::unselectInstrument(const QString& id)

void InstrumentListModel::swapSelectedInstruments(int firstIndex, int secondIndex)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
m_selectedInstruments.swapItemsAt(firstIndex, secondIndex);
#else
m_selectedInstruments.swap(firstIndex, secondIndex);
#endif
emit selectedInstrumentsChanged();
}

Expand Down
4 changes: 4 additions & 0 deletions mu4/plugins/view/pluginsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ QStringList PluginsModel::categories() const
result << plugin.category;
}

#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // ??
return result.values();
#else
return result.toList();
#endif
}

void PluginsModel::updatePlugin(const PluginInfo& plugin)
Expand Down
4 changes: 4 additions & 0 deletions mu4/userscores/view/templatesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ void TemplatesModel::load()

QStringList TemplatesModel::categoriesTitles() const
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // ??
return m_visibleCategoriesTitles.values();
#else
return m_visibleCategoriesTitles.toList();
#endif
}

QString TemplatesModel::currentTemplatePath() const
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/soloud/src/core/soloud_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace SoLoud

unsigned int BusInstance::getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize)
{
int handle = mParent->mChannelHandle;
if (handle == 0)
int _handle = mParent->mChannelHandle;
if (_handle == 0)
{
// Avoid reuse of scratch data if this bus hasn't played anything yet
unsigned int i;
Expand All @@ -58,7 +58,7 @@ namespace SoLoud
mScratch.init(mScratchSize * MAX_CHANNELS);
}

s->mixBus_internal(aBuffer, aSamplesToRead, aBufferSize, mScratch.mData, handle, mSamplerate, mChannels);
s->mixBus_internal(aBuffer, aSamplesToRead, aBufferSize, mScratch.mData, _handle, mSamplerate, mChannels);

int i;
if (mParent->mFlags & AudioSource::VISUALIZATION_DATA)
Expand Down

0 comments on commit 1d3d029

Please sign in to comment.