From aad880454984b6a190f9a667619b2975dbd1b751 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 13 Mar 2021 11:46:49 +0100 Subject: [PATCH] Backport qSort deprecation fixes --- src/frontends/qt4/GuiBox.cpp | 2 +- src/frontends/qt4/GuiCharacter.cpp | 2 +- src/frontends/qt4/GuiExternal.cpp | 2 +- src/frontends/qt4/GuiPrefs.cpp | 2 +- src/frontends/qt4/GuiRef.cpp | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 6a991b5df5..67a1b0c52b 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -155,7 +155,7 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent) // the background can be uncolored while the frame cannot color_codes_ = colors(); - qSort(color_codes_.begin(), color_codes_.end(), ColorSorter); + sort(color_codes_.begin(), color_codes_.end(), ColorSorter); fillComboColor(backgroundColorCO, true); fillComboColor(frameColorCO, false); diff --git a/src/frontends/qt4/GuiCharacter.cpp b/src/frontends/qt4/GuiCharacter.cpp index 25a5db0109..23b43e0f5e 100644 --- a/src/frontends/qt4/GuiCharacter.cpp +++ b/src/frontends/qt4/GuiCharacter.cpp @@ -234,7 +234,7 @@ GuiCharacter::GuiCharacter(GuiView & lv) bar = barData(); strike = strikeData(); color = colorData(); - qSort(color.begin(), color.end(), ColorSorter); + sort(color.begin(), color.end(), ColorSorter); language = languageData(); language.prepend(LanguagePair(qt_("Default"), "reset")); diff --git a/src/frontends/qt4/GuiExternal.cpp b/src/frontends/qt4/GuiExternal.cpp index ba1c171ebf..70bfa1ea5e 100644 --- a/src/frontends/qt4/GuiExternal.cpp +++ b/src/frontends/qt4/GuiExternal.cpp @@ -207,7 +207,7 @@ GuiExternal::GuiExternal(GuiView & lv) localizedTemplates.insert(qt_(i1->second.guiName), toqstr(i1->second.lyxName)); // Sort alphabetically by (localized) GUI name QStringList keys = localizedTemplates.keys(); - qSort(keys.begin(), keys.end(), SortLocaleAware); + sort(keys.begin(), keys.end(), SortLocaleAware); for (QString & key : keys) { QString const value = localizedTemplates[key]; externalCO->addItem(key, value); diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index f40f8fc2c1..5e91c62fe6 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1204,7 +1204,7 @@ PrefColors::PrefColors(GuiPreferences * form) continue; lcolors_.push_back(lc); } - qSort(lcolors_.begin(), lcolors_.end(), ColorSorter); + sort(lcolors_.begin(), lcolors_.end(), ColorSorter); vector::const_iterator cit = lcolors_.begin(); vector::const_iterator const end = lcolors_.end(); for (; cit != end; ++cit) { diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 6dae4b16fb..554cd08264 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -471,19 +471,19 @@ void GuiRef::redoRefs() } } // sort categories case-intensively - qSort(refsCategories.begin(), refsCategories.end(), + sort(refsCategories.begin(), refsCategories.end(), caseInsensitiveLessThan /*defined above*/); if (noprefix) refsCategories.insert(0, qt_("")); - QString const sort = sortingCO->isEnabled() ? + QString const sort_method = sortingCO->isEnabled() ? sortingCO->itemData(sortingCO->currentIndex()).toString() : QString(); - if (sort == "nocase") - qSort(refsStrings.begin(), refsStrings.end(), + if (sort_method == "nocase") + sort(refsStrings.begin(), refsStrings.end(), caseInsensitiveLessThan /*defined above*/); - else if (sort == "case") - qSort(refsStrings.begin(), refsStrings.end()); + else if (sort_method == "case") + sort(refsStrings.begin(), refsStrings.end()); if (groupCB->isChecked()) { QList refsCats;