Hello community, here is the log from the commit of package cantata for openSUSE:Factory checked in at 2020-02-22 19:08:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cantata (Old) and /work/SRC/openSUSE:Factory/.cantata.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cantata" Sat Feb 22 19:08:52 2020 rev:13 rq:778205 version:2.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/cantata/cantata.changes 2020-02-18 10:36:11.552428763 +0100 +++ /work/SRC/openSUSE:Factory/.cantata.new.26092/cantata.changes 2020-02-22 19:08:59.842652492 +0100 @@ -1,0 +2,24 @@ +Sat Feb 22 14:31:01 UTC 2020 - Cor Blom <corne...@solcon.nl> + +- Add fix-tranlations-with-qt5.diff again and update it. Cantata + only finds the 64bits lrelease. + +------------------------------------------------------------------- +Sat Feb 22 12:31:45 UTC 2020 - Cor Blom <corne...@solcon.nl> + +- Remove no longer necessary fix-translations-with-qt5.diff + +------------------------------------------------------------------- +Sat Feb 22 11:50:56 UTC 2020 - Cor Blom <corne...@solcon.nl> + +- Update to 2.4.1: + * Re-enable custom playqueue background. This is broken for 5.12, + but that's a Qt bug. So it is not enabled for 5.12 (and Leap) + * Look in /usr/lib64/qt5/bin for lrelease + * Fix deprecation warnings. + * Enable catagorized view by default, might also be a Qt issue? + Because it can crash (cantata bug #1530) we keep this disabled. + * Remove Encyclopaedia Metallum from lyrics providers, as does + not work. + +------------------------------------------------------------------- Old: ---- cantata-2.4.0.tar.gz New: ---- cantata-2.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cantata.spec ++++++ --- /var/tmp/diff_new_pack.BYHSZ7/_old 2020-02-22 19:09:00.826654452 +0100 +++ /var/tmp/diff_new_pack.BYHSZ7/_new 2020-02-22 19:09:00.826654452 +0100 @@ -17,15 +17,15 @@ Name: cantata -Version: 2.4.0 +Version: 2.4.1 Release: 0 Summary: Client for the Music Player Daemon (MPD) License: GPL-3.0-only Group: Productivity/Multimedia/Sound/Players URL: https://github.com/CDrummond/cantata/ Source0: https://github.com/CDrummond/cantata/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -# PATCH-FIX-OPENSUSE fix-translations-with-qt5.diff -- Make sure that it finds the right lrelease and lconvert binaries with Qt5 -Patch1: fix-translations-with-qt5.diff +# PATCH-FIX-OPENSUSE fix-translations-with-qt5.diff -- Make sure that it finds the right lrelease and lconvert binaries with Qt5 (cantata only find the 64bits lrelease). +Patch0: fix-translations-with-qt5.diff BuildRequires: fdupes BuildRequires: media-player-info BuildRequires: cmake(Qt5LinguistTools) @@ -95,10 +95,11 @@ %prep %setup -q -%patch1 -p0 +%patch0 -p1 %build -%cmake -DENABLE_REMOTE_DEVICES=OFF +%cmake -DENABLE_REMOTE_DEVICES=OFF \ + -DENABLE_CATEGORIZED_VIEW=OFF %make_jobs %install ++++++ cantata-2.4.0.tar.gz -> cantata-2.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/3rdparty/kcategorizedview/kcategorizedview.cpp new/cantata-2.4.1/3rdparty/kcategorizedview/kcategorizedview.cpp --- old/cantata-2.4.0/3rdparty/kcategorizedview/kcategorizedview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/3rdparty/kcategorizedview/kcategorizedview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -35,6 +35,7 @@ #include <QPainter> #include <QScrollBar> #include <QPaintEvent> +#include <algorithm> #include "kcategorydrawer.h" #include "kcategorizedsortfilterproxymodel.h" @@ -308,7 +309,7 @@ const QModelIndex firstAffectedCategory = blocks[category].firstIndex; //BEGIN: order for marking as alternate those blocks that are alternate QList<Block> blockList = blocks.values(); - qSort(blockList.begin(), blockList.end(), Block::lessThan); + std::sort(blockList.begin(), blockList.end(), Block::lessThan); QList<int> firstIndexesRows; foreach (const Block &block, blockList) { firstIndexesRows << block.firstIndex.row(); @@ -1317,7 +1318,7 @@ { //BEGIN: order for marking as alternate those blocks that are alternate QList<Private::Block> blockList = d->blocks.values(); - qSort(blockList.begin(), blockList.end(), Private::Block::lessThan); + std::sort(blockList.begin(), blockList.end(), Private::Block::lessThan); QList<int> firstIndexesRows; foreach (const Private::Block &block, blockList) { firstIndexesRows << block.firstIndex.row(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/3rdparty/solid-lite/backends/udisks2/udisksdevice.cpp new/cantata-2.4.1/3rdparty/solid-lite/backends/udisks2/udisksdevice.cpp --- old/cantata-2.4.0/3rdparty/solid-lite/backends/udisks2/udisksdevice.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/3rdparty/solid-lite/backends/udisks2/udisksdevice.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -297,16 +297,16 @@ if ((mediumTypes & Solid::OpticalDrive::Dvdr) && (mediumTypes & Solid::OpticalDrive::Dvdplusr)) { if(mediumTypes & Solid::OpticalDrive::Dvdplusdl) - second = QObject::trUtf8("/DVD±R DL", "Second item of %1%2 Drive sentence"); + second = QObject::tr("/DVD±R DL", "Second item of %1%2 Drive sentence"); else - second = QObject::trUtf8("/DVD±R", "Second item of %1%2 Drive sentence"); + second = QObject::tr("/DVD±R", "Second item of %1%2 Drive sentence"); } if ((mediumTypes & Solid::OpticalDrive::Dvdrw) && (mediumTypes & Solid::OpticalDrive::Dvdplusrw)) { if((mediumTypes & Solid::OpticalDrive::Dvdplusdl) || (mediumTypes & Solid::OpticalDrive::Dvdplusdlrw)) - second = QObject::trUtf8("/DVD±RW DL", "Second item of %1%2 Drive sentence"); + second = QObject::tr("/DVD±RW DL", "Second item of %1%2 Drive sentence"); else - second = QObject::trUtf8("/DVD±RW", "Second item of %1%2 Drive sentence"); + second = QObject::tr("/DVD±RW", "Second item of %1%2 Drive sentence"); } if (mediumTypes & Solid::OpticalDrive::Bd) second = QCoreApplication::translate("", "/BD-ROM", "Second item of %1%2 Drive sentence"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/CMakeLists.txt new/cantata-2.4.1/CMakeLists.txt --- old/cantata-2.4.0/CMakeLists.txt 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/CMakeLists.txt 2020-02-22 11:24:03.000000000 +0100 @@ -28,7 +28,7 @@ set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "4") -set(CPACK_PACKAGE_VERSION_PATCH "0") +set(CPACK_PACKAGE_VERSION_PATCH "1") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_PACKAGE_VERSION_SPIN "") # Use ".$number" - e.g. ".1" set(CPACK_PACKAGE_CONTACT "Craig Drummond <craig.p.drumm...@gmail.com>") @@ -48,7 +48,7 @@ option(ENABLE_PROXY_CONFIG "Enable proxy config in settings dialog" ON) option(ENABLE_HTTP_SERVER "Enable internal HTTP server to play non-MPD files" ON) option(ENABLE_LIBVLC "Use libVLC for MPD HTTP stream playback (if ENABLE_HTTP_STREAM_PLAYBACK=ON)" OFF) -option(ENABLE_CATEGORIZED_VIEW "Enable support for categorised view" OFF) +option(ENABLE_CATEGORIZED_VIEW "Enable support for categorised view" ON) if (WIN32 OR APPLE OR HAIKU) option(ENABLE_DEVICES_SUPPORT "Enable suport for external devices" OFF) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/ChangeLog new/cantata-2.4.1/ChangeLog --- old/cantata-2.4.0/ChangeLog 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/ChangeLog 2020-02-22 11:24:03.000000000 +0100 @@ -1,3 +1,12 @@ +2.4.1 +----- +1. Re-enable custom playqueue background. This is broken for 5.12, but that's a + Qt bug. +2. Look in /usr/lib64/qt5/bin for lrelease +3. Fix deprecation warnings. +4. Enable catagorized view by default, might also be a Qt issue? +5. Remove Encyclopaedia Metallum from lyrics providers, as does not work. + 2.4.0 ----- 1. Add 'Read offset' setting for AudioCDs. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/INSTALL new/cantata-2.4.1/INSTALL --- old/cantata-2.4.0/INSTALL 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/INSTALL 2020-02-22 11:24:03.000000000 +0100 @@ -25,9 +25,9 @@ Specify which type of build. Debug builds will be *much* larger, as they will contain extra debugging information. - -ENABLE_CATEGORIZED_VIEW=ON - Enable categorized view. Disabled as known to crash - #1530 - Default: OFF + -ENABLE_CATEGORIZED_VIEW=OFF + Enable categorized view. Can be disabled due to reported crash - #1530 + Default: ON -DENABLE_HTTP_STREAM_PLAYBACK=ON Enable support for playing back MPD HTTP streams via QtMultiMedia or diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/README.md new/cantata-2.4.1/README.md --- old/cantata-2.4.0/README.md 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/README.md 2020-02-22 11:24:03.000000000 +0100 @@ -1,7 +1,7 @@ Cantata ======= -**NOTE** Cantata is now in a bug-fix only state. Therefore, new features are unlikly to be implemented unless pull requests are submitted. The next release, 2.4.0, is likely to be the last feature release. +**NOTE** Cantata is now in a bug-fix only state. Therefore, new features are unlikly to be implemented unless pull requests are submitted. The current release, 2.4.0, is likely to be the last feature release. ![ScreenShot](screenshots/mainwindow.png) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/config.h.cmake new/cantata-2.4.1/config.h.cmake --- old/cantata-2.4.0/config.h.cmake 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/config.h.cmake 2020-02-22 11:24:03.000000000 +0100 @@ -45,7 +45,7 @@ #cmakedefine QT_MAC_EXTRAS_FOUND 1 #cmakedefine ENABLE_SIMPLE_MPD_SUPPORT 1 #cmakedefine AVAHI_FOUND -#cmakedefine ENABLE_CATEGORIZED_VIEW +#cmakedefine ENABLE_CATEGORIZED_VIEW 1 #cmakedefine HAVE_CDIO_PARANOIA_H 1 #cmakedefine HAVE_CDIO_PARANOIA_PARANOIA_H 1 @@ -64,6 +64,4 @@ #define CANTATA_ICON_THEME "@CANTATA_ICON_THEME@" -#define ENABLE_VIEW_BACKGROUND (QT_VERSION < QT_VERSION_CHECK(5, 12, 0)) - #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/context/artistview.cpp new/cantata-2.4.1/context/artistview.cpp --- old/cantata-2.4.0/context/artistview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/context/artistview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -43,6 +43,7 @@ #include <QMenu> #include <QTimer> #include <QDesktopServices> +#include <algorithm> static const char *constNameKey="name"; @@ -416,7 +417,7 @@ } } - qSort(artists); + std::sort(artists.begin(), artists.end()); return artists; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/context/contextwidget.cpp new/cantata-2.4.1/context/contextwidget.cpp --- old/cantata-2.4.0/context/contextwidget.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/context/contextwidget.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -95,7 +95,7 @@ f.setBold(true); } QFontMetrics fm(f); - if (fm.width(txt)>rect().width()) { + if (fm.horizontalAdvance(txt)>rect().width()) { txt=fm.elidedText(txt, isRightToLeft() ? Qt::ElideLeft : Qt::ElideRight, rect().width()); } @@ -504,7 +504,7 @@ QRect r(rect()); if (darkBackground) { - p.fillRect(r, palette().background().color()); + p.fillRect(r, palette().window().color()); } else { QColor col = palette().windowText().color(); col.setAlphaF(0.15); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/context/lyrics_providers.xml new/cantata-2.4.1/context/lyrics_providers.xml --- old/cantata-2.4.0/context/lyrics_providers.xml 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/context/lyrics_providers.xml 2020-02-22 11:24:03.000000000 +0100 @@ -81,6 +81,7 @@ </exclude> <invalidIndicator value="Couldn't find that page."/> </provider> +<!-- Issue #1571 <provider name="Encyclopaedia Metallum" charset="utf-8" url="https://www.metal-archives.com/search/ajax-advanced/searching/songs/?songTitle={title}&bandName={artist}&ExactBandMatch=1"> <extract> <item url="http://www.metal-archives.com/release/ajax-view-lyrics/id/{id}"/> @@ -89,6 +90,7 @@ <invalidIndicator value=""iTotalRecords": 0"/> <invalidIndicator value="lyrics not available"/> </provider> +--> <provider name="letras.mus.br" charset="utf-8" url="https://www.letras.mus.br/winamp.php?musica={title}&artista={artist}"> <urlFormat replace="_@,;&\/"" with="_"/> <urlFormat replace=" " with="+"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/context/othersettings.cpp new/cantata-2.4.1/context/othersettings.cpp --- old/cantata-2.4.0/context/othersettings.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/context/othersettings.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -39,7 +39,7 @@ contextBackdrop_custom->setProperty(constValueProperty, PlayQueueView::BI_Custom); contextBackdropFile->setDirMode(false); contextBackdropFile->setFilter(tr("Images (*.png *.jpg)")); - int labelWidth=qMax(fontMetrics().width(QLatin1String("100%")), fontMetrics().width(tr("10px", "pixels"))); + int labelWidth=qMax(fontMetrics().horizontalAdvance(QLatin1String("100%")), fontMetrics().horizontalAdvance(tr("10px", "pixels"))); contextBackdropOpacityLabel->setFixedWidth(labelWidth); contextBackdropBlurLabel->setFixedWidth(labelWidth); connect(contextBackdropOpacity, SIGNAL(valueChanged(int)), SLOT(setContextBackdropOpacityLabel())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/context/ultimatelyrics.cpp new/cantata-2.4.1/context/ultimatelyrics.cpp --- old/cantata-2.4.0/context/ultimatelyrics.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/context/ultimatelyrics.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -30,6 +30,7 @@ #include <QFileInfoList> #include <QXmlStreamReader> #include <QSet> +#include <algorithm> GLOBAL_STATIC(UltimateLyrics, instance) @@ -205,7 +206,7 @@ provider->setRelevance(relevance++); } } - qSort(providers.begin(), providers.end(), compareLyricProviders); + std::sort(providers.begin(), providers.end(), compareLyricProviders); Settings::self()->saveLyricProviders(enabled); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/db/librarydb.cpp new/cantata-2.4.1/db/librarydb.cpp --- old/cantata-2.4.0/db/librarydb.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/db/librarydb.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -29,6 +29,7 @@ #include <QFile> #include <QRegExp> #include <QDebug> +#include <algorithm> static const int constSchemaVersion=5; @@ -704,7 +705,7 @@ DBUG << it.key(); genres.append(Genre(it.key(), it.value().size())); } - qSort(genres); + std::sort(genres.begin(), genres.end()); return genres; } @@ -737,7 +738,7 @@ // DBUG << it.key(); artists.append(Artist(it.key(), sortMap[it.key()], it.value())); } - qSort(artists); + std::sort(artists.begin(), artists.end()); return artists; } @@ -852,25 +853,25 @@ DBUG << "After select" << timer.elapsed(); switch(sort) { case AS_AlArYr: - qSort(albums.begin(), albums.end(), albumsSortAlArYr); + std::sort(albums.begin(), albums.end(), albumsSortAlArYr); break; case AS_AlYrAr: - qSort(albums.begin(), albums.end(), albumsSortAlYrAr); + std::sort(albums.begin(), albums.end(), albumsSortAlYrAr); break; case AS_ArAlYr: - qSort(albums.begin(), albums.end(), albumsSortArAlYr); + std::sort(albums.begin(), albums.end(), albumsSortArAlYr); break; case AS_ArYrAl: - qSort(albums.begin(), albums.end(), albumsSortArYrAl); + std::sort(albums.begin(), albums.end(), albumsSortArYrAl); break; case AS_YrAlAr: - qSort(albums.begin(), albums.end(), albumsSortYrAlAr); + std::sort(albums.begin(), albums.end(), albumsSortYrAlAr); break; case AS_YrArAl: - qSort(albums.begin(), albums.end(), albumsSortYrArAl); + std::sort(albums.begin(), albums.end(), albumsSortYrArAl); break; case AS_Modified: - qSort(albums.begin(), albums.end(), albumsSortModified); + std::sort(albums.begin(), albums.end(), albumsSortModified); break; default: break; @@ -908,19 +909,19 @@ switch(sort) { case AS_AlArYr: - qSort(songs.begin(), songs.end(), songsSortAlAr); + std::sort(songs.begin(), songs.end(), songsSortAlAr); break; case AS_ArAlYr: - qSort(songs.begin(), songs.end(), songsSortArAl); + std::sort(songs.begin(), songs.end(), songsSortArAl); break; // case AS_Year: -// qSort(songs.begin(), songs.end(), songsSortYrAlAr); +// std::sort(songs.begin(), songs.end(), songsSortYrAlAr); // break; // case AS_Modified: -// qSort(songs.begin(), songs.end(), songsSortModified); +// std::sort(songs.begin(), songs.end(), songsSortModified); // break; default: - qSort(songs.begin(), songs.end(), songSort); + std::sort(songs.begin(), songs.end(), songSort); break; } return songs; @@ -1006,7 +1007,7 @@ } } - qSort(albums.begin(), albums.end(), albumsSortArAlYr); + std::sort(albums.begin(), albums.end(), albumsSortArAlYr); return albums; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/dbus/notify.cpp new/cantata-2.4.1/dbus/notify.cpp --- old/cantata-2.4.0/dbus/notify.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/dbus/notify.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -66,7 +66,7 @@ int channels = /*i.isGrayscale() ? 1 : */ (i.hasAlphaChannel() ? 4 : 3); arg << i.depth() / channels; arg << channels; - arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.byteCount()); + arg << QByteArray(reinterpret_cast<const char*>(i.bits()), i.sizeInBytes()); arg.endStructure(); return arg; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/devices/actiondialog.cpp new/cantata-2.4.1/devices/actiondialog.cpp --- old/cantata-2.4.0/devices/actiondialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/devices/actiondialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -51,6 +51,7 @@ #ifdef QT_QTDBUS_FOUND #include <QDBusConnection> #endif +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -386,7 +387,7 @@ songsToAction=songs; mode=m; setCaption(Copy==mode || Sync==mode ? tr("Copy Songs") : tr("Delete Songs")); - qSort(songsToAction); + std::sort(songsToAction.begin(), songsToAction.end()); progressLabel->setText(QString()); progressBar->setValue(0); progressBar->setRange(0, (Copy==mode || Sync==mode ? songsToAction.count() : (songsToAction.count()+1))*100); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/devices/albumdetailsdialog.cpp new/cantata-2.4.1/devices/albumdetailsdialog.cpp --- old/cantata-2.4.0/devices/albumdetailsdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/devices/albumdetailsdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -37,6 +37,7 @@ #include <QStyledItemDelegate> #include <QMouseEvent> #include <QSpinBox> +#include <algorithm> enum Columns { COL_TRACK, @@ -174,7 +175,7 @@ for (const MusicLibraryItem *i: dev->childItems()) { songs.append(static_cast<const MusicLibraryItemSong *>(i)->song()); } - qSort(songs); + std::sort(songs.begin(), songs.end()); for (const Song &s: songs) { QTreeWidgetItem *item=new QTreeWidgetItem(tracks); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/devices/encoders.cpp new/cantata-2.4.1/devices/encoders.cpp --- old/cantata-2.4.0/devices/encoders.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/devices/encoders.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -26,6 +26,7 @@ #include "support/utils.h" #include <QRegExp> #include <QProcess> +#include <algorithm> namespace Encoders { @@ -371,7 +372,7 @@ insertCodec(QLatin1String("lame"), QLatin1String("-V"), QString(), lame); insertCodec(QLatin1String("oggenc"), QLatin1String("-q"), QLatin1String("-o"), ogg); insertCodec(QLatin1String("opusenc"), QLatin1String("--bitrate"), QString(), opus); - qSort(installedEncoders); + std::sort(installedEncoders.begin(), installedEncoders.end()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/devices/synccollectionwidget.cpp new/cantata-2.4.1/devices/synccollectionwidget.cpp --- old/cantata-2.4.0/devices/synccollectionwidget.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/devices/synccollectionwidget.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -32,6 +32,7 @@ #include "support/actioncollection.h" #include <QTimer> #include <QAction> +#include <algorithm> SyncCollectionWidget::SyncCollectionWidget(QWidget *parent, const QString &title) : QWidget(parent) @@ -93,7 +94,7 @@ for (const Song *s: checked) { songs.append(*s); } - qSort(songs); + std::sort(songs.begin(), songs.end()); return songs; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/devices/transcodingjob.cpp new/cantata-2.4.1/devices/transcodingjob.cpp --- old/cantata-2.4.0/devices/transcodingjob.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/devices/transcodingjob.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -50,7 +50,7 @@ } else { QStringList parameters=encoder.params(value, src, destFile); process = new QProcess; - process->setReadChannelMode(QProcess::MergedChannels); + process->setProcessChannelMode(QProcess::MergedChannels); process->setReadChannel(QProcess::StandardOutput); connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(processOutput())); connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(finished(int, QProcess::ExitStatus))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/apikeyssettings.cpp new/cantata-2.4.1/gui/apikeyssettings.cpp --- old/cantata-2.4.0/gui/apikeyssettings.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/apikeyssettings.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -56,7 +56,7 @@ painter->setPen(opt.palette.color(opt.state&QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Link)); QRect r=opt.rect; int pad=3; - int w = qMin(r.width()-(2*pad), opt.fontMetrics.width(index.data().toString())); + int w = qMin(r.width()-(2*pad), opt.fontMetrics.horizontalAdvance(index.data().toString())); painter->drawLine(r.x()+pad, r.y()+r.height()-2, r.x()+w-1, r.y()+r.height()-2); } else { BasicItemDelegate::paint(painter, option, index); @@ -100,8 +100,8 @@ for (const auto &k: keys) { QTreeWidgetItem *item=new QTreeWidgetItem(tree, QStringList() << k.name << k.url << k.key); item->setFlags(item->flags() | Qt::ItemIsEditable); - nameWidth=qMax(nameWidth, fm.width(k.name)+padding); - urlWidth=qMax(urlWidth, fm.width(k.url)+padding); + nameWidth=qMax(nameWidth, fm.horizontalAdvance(k.name)+padding); + urlWidth=qMax(urlWidth, fm.horizontalAdvance(k.url)+padding); } tree->setColumnWidth(0, nameWidth); tree->setColumnWidth(1, urlWidth); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/coverdialog.cpp new/cantata-2.4.1/gui/coverdialog.cpp --- old/cantata-2.4.0/gui/coverdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/coverdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -518,7 +518,7 @@ list->addItem(item); if (item->isLocal()) { list->scrollToItem(item); - list->setItemSelected(item, true); + item->setSelected(true); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/customactions.cpp new/cantata-2.4.1/gui/customactions.cpp --- old/cantata-2.4.0/gui/customactions.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/customactions.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -27,6 +27,7 @@ #include "support/configuration.h" #include <QMenu> #include <QProcess> +#include <algorithm> GLOBAL_STATIC(CustomActions, instance) @@ -74,7 +75,7 @@ void CustomActions::set(QList<Command> cmds) { - qSort(cmds); + std::sort(cmds.begin(), cmds.end()); bool diff=cmds.length()!=commands.length(); if (!diff) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/interfacesettings.cpp new/cantata-2.4.1/gui/interfacesettings.cpp --- old/cantata-2.4.0/gui/interfacesettings.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/interfacesettings.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -43,6 +43,7 @@ #include <QSystemTrayIcon> #include <QSysInfo> #include <QStyleFactory> +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -172,13 +173,12 @@ sbPosition->addItem(tr("Bottom"), FancyTabWidget::Bot); connect(sbAutoHide, SIGNAL(toggled(bool)), SLOT(sbAutoHideChanged())); views->setItemDelegate(new BasicItemDelegate(views)); - #if ENABLE_VIEW_BACKGROUND playQueueBackground_none->setProperty(constValueProperty, PlayQueueView::BI_None); playQueueBackground_cover->setProperty(constValueProperty, PlayQueueView::BI_Cover); playQueueBackground_custom->setProperty(constValueProperty, PlayQueueView::BI_Custom); playQueueBackgroundFile->setDirMode(false); playQueueBackgroundFile->setFilter(tr("Images (*.png *.jpg)")); - int labelWidth=qMax(fontMetrics().width(QLatin1String("100%")), fontMetrics().width(tr("10px", "pixels"))); + int labelWidth=qMax(fontMetrics().horizontalAdvance(QLatin1String("100%")), fontMetrics().horizontalAdvance(tr("10px", "pixels"))); playQueueBackgroundOpacityLabel->setFixedWidth(labelWidth); playQueueBackgroundBlurLabel->setFixedWidth(labelWidth); connect(playQueueBackgroundOpacity, SIGNAL(valueChanged(int)), SLOT(setPlayQueueBackgroundOpacityLabel())); @@ -186,7 +186,6 @@ connect(playQueueBackground_none, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions())); connect(playQueueBackground_cover, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions())); connect(playQueueBackground_custom, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions())); - #endif connect(storeCoversInMpdDir, SIGNAL(toggled(bool)), this, SLOT(storeCoversInMpdDirToggled())); if (!enableNotifications) { REMOVE(systemTrayPopup) @@ -250,7 +249,6 @@ playQueueStartClosed->setChecked(Settings::self()->playQueueStartClosed()); playQueueScroll->setChecked(Settings::self()->playQueueScroll()); - #if ENABLE_VIEW_BACKGROUND int pqBgnd=Settings::self()->playQueueBackground(); playQueueBackground_none->setChecked(pqBgnd==playQueueBackground_none->property(constValueProperty).toInt()); playQueueBackground_cover->setChecked(pqBgnd==playQueueBackground_cover->property(constValueProperty).toInt()); @@ -258,7 +256,6 @@ playQueueBackgroundOpacity->setValue(Settings::self()->playQueueBackgroundOpacity()); playQueueBackgroundBlur->setValue(Settings::self()->playQueueBackgroundBlur()); playQueueBackgroundFile->setText(Utils::convertPathForDisplay(Settings::self()->playQueueBackgroundFile(), false)); - #endif playQueueConfirmClear->setChecked(Settings::self()->playQueueConfirmClear()); playQueueSearch->setChecked(Settings::self()->playQueueSearch()); @@ -305,16 +302,12 @@ sbAutoHideChanged(); responsiveSidebar->setChecked(Settings::self()->responsiveSidebar()); viewItemChanged(views->item(0)); - #if ENABLE_VIEW_BACKGROUND setPlayQueueBackgroundOpacityLabel(); setPlayQueueBackgroundBlurLabel(); enablePlayQueueBackgroundOptions(); if (enableMpris) { enableMpris->setChecked(Settings::self()->mpris()); } - #else - playQueueBackgroundOptions->setVisible(false); - #endif } static QSet<QString> toSet(const QString &str) @@ -342,7 +335,6 @@ Settings::self()->savePlayQueueStartClosed(playQueueStartClosed->isChecked()); Settings::self()->savePlayQueueScroll(playQueueScroll->isChecked()); - #if ENABLE_VIEW_BACKGROUND if (playQueueBackground_none->isChecked()) { Settings::self()->savePlayQueueBackground(playQueueBackground_none->property(constValueProperty).toInt()); } else if (playQueueBackground_cover->isChecked()) { @@ -353,7 +345,6 @@ Settings::self()->savePlayQueueBackgroundOpacity(playQueueBackgroundOpacity->value()); Settings::self()->savePlayQueueBackgroundBlur(playQueueBackgroundBlur->value()); Settings::self()->savePlayQueueBackgroundFile(Utils::convertPathFromDisplay(playQueueBackgroundFile->text(), false)); - #endif Settings::self()->savePlayQueueConfirmClear(playQueueConfirmClear->isChecked()); Settings::self()->savePlayQueueSearch(playQueueSearch->isChecked()); @@ -448,7 +439,7 @@ QString current = Settings::self()->lang(); QStringList names = langMap.keys(); - qStableSort(names.begin(), names.end(), localeAwareCompare); + std::stable_sort(names.begin(), names.end(), localeAwareCompare); lang->addItem(tr("System default"), QString()); lang->setCurrentIndex(0); for (const QString &name: names) { @@ -572,26 +563,20 @@ void InterfaceSettings::setPlayQueueBackgroundOpacityLabel() { - #if ENABLE_VIEW_BACKGROUND playQueueBackgroundOpacityLabel->setText(tr("%1%", "value%").arg(playQueueBackgroundOpacity->value())); - #endif } void InterfaceSettings::setPlayQueueBackgroundBlurLabel() { - #if ENABLE_VIEW_BACKGROUND playQueueBackgroundBlurLabel->setText(tr("%1 px", "pixels").arg(playQueueBackgroundBlur->value())); - #endif } void InterfaceSettings::enablePlayQueueBackgroundOptions() { - #if ENABLE_VIEW_BACKGROUND playQueueBackgroundOpacity->setEnabled(!playQueueBackground_none->isChecked()); playQueueBackgroundOpacityLabel->setEnabled(playQueueBackgroundOpacity->isEnabled()); playQueueBackgroundBlur->setEnabled(playQueueBackgroundOpacity->isEnabled()); playQueueBackgroundBlurLabel->setEnabled(playQueueBackgroundOpacity->isEnabled()); - #endif } void InterfaceSettings::systemTrayCheckBoxToggled() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/mainwindow.cpp new/cantata-2.4.1/gui/mainwindow.cpp --- old/cantata-2.4.0/gui/mainwindow.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/mainwindow.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -119,6 +119,7 @@ #include <QFileDialog> #include "mediakeys.h" #include <cstdlib> +#include <algorithm> static int nextKey(int &key) { @@ -1360,7 +1361,7 @@ if (menuItems!=mpd) { menu->clear(); QList<Output> out=outputs; - qSort(out); + std::sort(out.begin(), out.end()); int i=Qt::Key_1; for (const Output &o: out) { QAction *act=menu->addAction(o.name, this, SLOT(toggleOutput())); @@ -1386,17 +1387,17 @@ if (!switchedOn.isEmpty() && switchedOff.isEmpty()) { QStringList names=switchedOn.toList(); - qSort(names); + std::sort(names.begin(), names.end()); trayItem->showMessage(tr("Outputs"), tr("Enabled: %1").arg(names.join(QLatin1String(", ")))); } else if (!switchedOff.isEmpty() && switchedOn.isEmpty()) { QStringList names=switchedOff.toList(); - qSort(names); + std::sort(names.begin(), names.end()); trayItem->showMessage(tr("Outputs"), tr("Disabled: %1").arg(names.join(QLatin1String(", ")))); } else if (!switchedOn.isEmpty() && !switchedOff.isEmpty()) { QStringList on=switchedOn.toList(); - qSort(on); + std::sort(on.begin(), on.end()); QStringList off=switchedOff.toList(); - qSort(off); + std::sort(off.begin(), off.end()); trayItem->showMessage(tr("Outputs"), tr("Enabled: %1").arg(on.join(QLatin1String(", ")))+QLatin1Char('\n')+ tr("Disabled: %1").arg(off.join(QLatin1String(", ")))); @@ -1429,7 +1430,7 @@ if (menuItems!=cfg) { menu->clear(); - qSort(connections); + std::sort(connections.begin(), connections.end()); int i=Qt::Key_1; for (const MPDConnectionDetails &d: connections) { QAction *act=menu->addAction(d.getName(), this, SLOT(changeConnection())); @@ -1614,8 +1615,8 @@ { QStringList handlers=MPDConnection::self()->urlHandlers().toList(); QStringList tags=MPDConnection::self()->tags().toList(); - qSort(handlers); - qSort(tags); + std::sort(handlers.begin(), handlers.end()); + std::sort(tags.begin(), tags.end()); long version=MPDConnection::self()->version(); QDateTime dbUpdate; dbUpdate.setTime_t(MPDStats::self()->dbUpdate()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/gui/serversettings.cpp new/cantata-2.4.1/gui/serversettings.cpp --- old/cantata-2.4.0/gui/serversettings.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/gui/serversettings.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -40,6 +40,7 @@ #include <QValidator> #include <QStyle> #include <QStandardPaths> +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -129,7 +130,7 @@ QList<MPDConnectionDetails> all=Settings::self()->allConnections(); QString currentCon=Settings::self()->currentConnection(); - qSort(all); + std::sort(all.begin(), all.end()); combo->clear(); int idx=0; haveBasicCollection=false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/models/devicesmodel.cpp new/cantata-2.4.1/models/devicesmodel.cpp --- old/cantata-2.4.0/models/devicesmodel.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/models/devicesmodel.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -54,6 +54,7 @@ #include "solid-lite/storagedrive.h" #include "solid-lite/storagevolume.h" #include "solid-lite/opticaldisc.h" +#include <algorithm> #include <QDebug> static bool debugIsEnabled=false; @@ -208,13 +209,13 @@ break; } - qSort(artists.begin(), artists.end(), MusicLibraryItemArtist::lessThan); + std::sort(artists.begin(), artists.end(), MusicLibraryItemArtist::lessThan); for (MusicLibraryItem *a: artists) { const MusicLibraryItemContainer *artist=static_cast<const MusicLibraryItemContainer *>(a); // Now sort all albums as they would appear in UI... QList<MusicLibraryItem *> artistAlbums=artist->childItems(); - qSort(artistAlbums.begin(), artistAlbums.end(), MusicLibraryItemAlbum::lessThan); + std::sort(artistAlbums.begin(), artistAlbums.end(), MusicLibraryItemAlbum::lessThan); for (MusicLibraryItem *i: artistAlbums) { const MusicLibraryItemContainer *album=static_cast<const MusicLibraryItemContainer *>(i); for (const MusicLibraryItem *song: album->childItems()) { @@ -231,7 +232,7 @@ case MusicLibraryItem::Type_Artist: { // First, sort all albums as they would appear in UI... QList<MusicLibraryItem *> artistAlbums=static_cast<const MusicLibraryItemContainer *>(item)->childItems(); - qSort(artistAlbums.begin(), artistAlbums.end(), MusicLibraryItemAlbum::lessThan); + std::sort(artistAlbums.begin(), artistAlbums.end(), MusicLibraryItemAlbum::lessThan); for (MusicLibraryItem *i: artistAlbums) { const MusicLibraryItemContainer *album=static_cast<const MusicLibraryItemContainer *>(i); @@ -904,7 +905,7 @@ } QStringList keys=items.keys(); - qSort(keys.begin(), keys.end(), lessThan); + std::sort(keys.begin(), keys.end(), lessThan); for (const QString &k: keys) { const MusicLibraryItemRoot *d=items[k]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/models/playlistsmodel.cpp new/cantata-2.4.1/models/playlistsmodel.cpp --- old/cantata-2.4.0/models/playlistsmodel.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/models/playlistsmodel.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -47,6 +47,7 @@ #ifdef ENABLE_HTTP_SERVER #include "http/httpserver.h" #endif +#include <algorithm> QString PlaylistsModel::headerText(int col) { @@ -959,7 +960,7 @@ names << p->name; } } - qSort(names.begin(), names.end(), PlaylistsProxyModel::compareNames); + std::sort(names.begin(), names.end(), PlaylistsProxyModel::compareNames); for (const QString &n: names) { itemMenu->addAction(n, this, SLOT(emitAddToExisting())); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/models/playqueuemodel.cpp new/cantata-2.4.1/models/playqueuemodel.cpp --- old/cantata-2.4.0/models/playqueuemodel.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/models/playqueuemodel.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -63,6 +63,7 @@ #include <QApplication> #include <QMenu> #include <QXmlStreamReader> +#include <algorithm> GLOBAL_STATIC(PlayQueueModel, instance) @@ -1467,23 +1468,23 @@ } if (constSortByArtistKey==key) { - qSort(copy.begin(), copy.end(), artistSort); + std::sort(copy.begin(), copy.end(), artistSort); } else if (constSortByAlbumArtistKey==key) { - qSort(copy.begin(), copy.end(), albumArtistSort); + std::sort(copy.begin(), copy.end(), albumArtistSort); } else if (constSortByAlbumKey==key) { - qSort(copy.begin(), copy.end(), albumSort); + std::sort(copy.begin(), copy.end(), albumSort); } else if (constSortByGenreKey==key) { - qSort(copy.begin(), copy.end(), genreSort); + std::sort(copy.begin(), copy.end(), genreSort); } else if (constSortByYearKey==key) { - qSort(copy.begin(), copy.end(), yearSort); + std::sort(copy.begin(), copy.end(), yearSort); } else if (constSortByComposerKey==key) { - qSort(copy.begin(), copy.end(), composerSort); + std::sort(copy.begin(), copy.end(), composerSort); } else if (constSortByPerformerKey==key) { - qSort(copy.begin(), copy.end(), performerSort); + std::sort(copy.begin(), copy.end(), performerSort); } else if (constSortByTitleKey==key) { - qSort(copy.begin(), copy.end(), titleSort); + std::sort(copy.begin(), copy.end(), titleSort); } else if (constSortByNumberKey==key) { - qSort(copy.begin(), copy.end(), trackSort); + std::sort(copy.begin(), copy.end(), trackSort); } QList<quint32> positions; for (const Song *s: copy) { @@ -1611,7 +1612,7 @@ while (!keys.isEmpty()) { quint32 key=keys.takeAt(Utils::random(keys.count())); QList<const Song *> albumSongs=albums[key]; - qSort(albumSongs.begin(), albumSongs.end(), songSort); + std::sort(albumSongs.begin(), albumSongs.end(), songSort); for (const Song *song: albumSongs) { positions.append(getRowById(song->id)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/models/streamsmodel.cpp new/cantata-2.4.1/models/streamsmodel.cpp --- old/cantata-2.4.0/models/streamsmodel.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/models/streamsmodel.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -58,6 +58,7 @@ #endif #include <stdio.h> #include <time.h> +#include <algorithm> #include <QDebug> GLOBAL_STATIC(StreamsModel, instance) @@ -1516,7 +1517,7 @@ } } else if ("</tr>"==line) { if (entry.streams.count()) { - qSort(entry.streams); + std::sort(entry.streams.begin(), entry.streams.end()); QString name; QString url=entry.streams.at(0).url; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/mpd-interface/mpdconnection.cpp new/cantata-2.4.1/mpd-interface/mpdconnection.cpp --- old/cantata-2.4.0/mpd-interface/mpdconnection.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/mpd-interface/mpdconnection.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -49,6 +49,7 @@ #elif defined Q_OS_MAC && defined IOKIT_FOUND #include "mac/powermanagement.h" #endif +#include <algorithm> #include <QDebug> static bool debugEnabled=false; #define DBUG if (debugEnabled) qWarning() << "MPDConnection" << QThread::currentThreadId() @@ -980,7 +981,7 @@ QList<quint32> moveItems; moveItems.append(items); - qSort(moveItems); + std::sort(moveItems.begin(), moveItems.end()); int posOffset = 0; @@ -1876,7 +1877,7 @@ QList<quint32> sorted=positions; QList<quint32> removed; - qSort(sorted); + std::sort(sorted.begin(), sorted.end()); for (int i=sorted.count()-1; i>=0; --i) { quint32 idx=sorted.at(i); @@ -1964,7 +1965,7 @@ } } } - qSort(songs); + std::sort(songs.begin(), songs.end()); } } emit searchResponse(id, songs); @@ -2049,7 +2050,7 @@ QList<quint32> sorted=positions; QList<quint32> removed; - qSort(sorted); + std::sort(sorted.begin(), sorted.end()); for (int i=sorted.count()-1; i>=0; --i) { quint32 idx=sorted.at(i); @@ -2134,7 +2135,7 @@ QList<quint32> moveItems=items; int posOffset = 0; - qSort(moveItems); + std::sort(moveItems.begin(), moveItems.end()); //first move all items (starting with the biggest) to the end so we don't have to deal with changing rownums for (int i = moveItems.size() - 1; i >= 0; i--) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/mpd-interface/mpdparseutils.cpp new/cantata-2.4.1/mpd-interface/mpdparseutils.cpp --- old/cantata-2.4.0/mpd-interface/mpdparseutils.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/mpd-interface/mpdparseutils.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -43,6 +43,7 @@ #include "support/utils.h" #include "cuefile.h" #include "mpdconnection.h" +#include <algorithm> #include <QDebug> static bool debugEnabled=false; @@ -751,7 +752,7 @@ sngs.append(s); } } - qSort(playlists); + std::sort(playlists.begin(), playlists.end()); songs=sngs; songs+=playlists; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/mpd-interface/song.cpp new/cantata-2.4.1/mpd-interface/song.cpp --- old/cantata-2.4.0/mpd-interface/song.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/mpd-interface/song.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -39,6 +39,7 @@ #include <QUrl> #include <QMutex> #include <QMutexLocker> +#include <algorithm> //static const quint8 constOnlineDiscId=0xEE; @@ -129,7 +130,7 @@ void Song::sortViaType(QList<Song> &songs) { - qSort(songs.begin(), songs.end(), songTypeSort); + std::sort(songs.begin(), songs.end(), songTypeSort); } QString Song::decodePath(const QString &file, bool cdda) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/online/podcastsearchdialog.cpp new/cantata-2.4.1/online/podcastsearchdialog.cpp --- old/cantata-2.4.0/online/podcastsearchdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/online/podcastsearchdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -316,7 +316,7 @@ if (img.width()>maxImageSize || img.height()>maxImageSize) { img=img.scaled(maxImageSize, maxImageSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } - imageCache.insert(imageJob->property(constOrigUrlProperty).toUrl(), new QImage(img), img.byteCount()); + imageCache.insert(imageJob->property(constOrigUrlProperty).toUrl(), new QImage(img), img.sizeInBytes()); updateText(); } imageJob=nullptr; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/playlists/dynamicplaylists.cpp new/cantata-2.4.1/playlists/dynamicplaylists.cpp --- old/cantata-2.4.0/playlists/dynamicplaylists.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/playlists/dynamicplaylists.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -580,7 +580,7 @@ QFileInfo inf(Utils::cacheDir(rulesDir, false)+constActiveRules); if (inf.exists() && inf.isSymLink()) { - QString link=inf.readLink(); + QString link=inf.symLinkTarget(); if (!link.isEmpty()) { QString fname=QFileInfo(link).fileName(); if (fname.endsWith(constExtension)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/playlists/playlistrulesdialog.cpp new/cantata-2.4.1/playlists/playlistrulesdialog.cpp --- old/cantata-2.4.0/playlists/playlistrulesdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/playlists/playlistrulesdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -32,6 +32,7 @@ #include <QSortFilterProxyModel> #include <QSpinBox> #include <QStyle> +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -341,7 +342,7 @@ for (const QModelIndex &i: items) { rows.append(proxy->mapToSource(i).row()); } - qSort(rows); + std::sort(rows.begin(), rows.end()); while (rows.count()) { model->removeRow(rows.takeLast()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/playlists/smartplaylistspage.cpp new/cantata-2.4.1/playlists/smartplaylistspage.cpp --- old/cantata-2.4.0/playlists/smartplaylistspage.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/playlists/smartplaylistspage.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -31,6 +31,7 @@ #include "support/messagebox.h" #include "gui/stdactions.h" #include "models/mpdlibrarymodel.h" +#include <algorithm> SmartPlaylistsPage::SmartPlaylistsPage(QWidget *p) : SinglePageWidget(p) @@ -323,31 +324,31 @@ sortAscending = command.orderAscending; switch(command.order) { case RulesPlaylists::Order_AlbumArtist: - qSort(songs.begin(), songs.end(), albumArtistSort); + std::sort(songs.begin(), songs.end(), albumArtistSort); break; case RulesPlaylists::Order_Artist: - qSort(songs.begin(), songs.end(), artistSort); + std::sort(songs.begin(), songs.end(), artistSort); break; case RulesPlaylists::Order_Album: - qSort(songs.begin(), songs.end(), albumSort); + std::sort(songs.begin(), songs.end(), albumSort); break; case RulesPlaylists::Order_Composer: - qSort(songs.begin(), songs.end(), composerSort); + std::sort(songs.begin(), songs.end(), composerSort); break; case RulesPlaylists::Order_Date: - qSort(songs.begin(), songs.end(), dateSort); + std::sort(songs.begin(), songs.end(), dateSort); break; case RulesPlaylists::Order_Genre: - qSort(songs.begin(), songs.end(), genreSort); + std::sort(songs.begin(), songs.end(), genreSort); break; case RulesPlaylists::Order_Rating: - qSort(songs.begin(), songs.end(), ratingSort); + std::sort(songs.begin(), songs.end(), ratingSort); break; case RulesPlaylists::Order_Title: - qSort(songs.begin(), songs.end(), titleSort); + std::sort(songs.begin(), songs.end(), titleSort); break; case RulesPlaylists::Order_Age: - qSort(songs.begin(), songs.end(), ageSort); + std::sort(songs.begin(), songs.end(), ageSort); break; default: case RulesPlaylists::Order_Random: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/playlists/storedplaylistspage.cpp new/cantata-2.4.1/playlists/storedplaylistspage.cpp --- old/cantata-2.4.0/playlists/storedplaylistspage.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/playlists/storedplaylistspage.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -45,7 +45,7 @@ : TableView(QLatin1String("playlist"), p) { setUseSimpleDelegate(); - setIndentation(fontMetrics().width(QLatin1String("XX"))); + setIndentation(fontMetrics().horizontalAdvance(QLatin1String("XX"))); } ~PlaylistTableView() override { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/replaygain/albumscanner.cpp new/cantata-2.4.1/replaygain/albumscanner.cpp --- old/cantata-2.4.0/replaygain/albumscanner.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/replaygain/albumscanner.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -47,7 +47,7 @@ { if (!proc) { proc=new QProcess(this); - proc->setReadChannelMode(QProcess::MergedChannels); + proc->setProcessChannelMode(QProcess::MergedChannels); proc->setReadChannel(QProcess::StandardOutput); connect(proc, SIGNAL(finished(int)), this, SLOT(procFinished())); connect(proc, SIGNAL(readyReadStandardOutput()), this, SLOT(read())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/replaygain/rgdialog.cpp new/cantata-2.4.1/replaygain/rgdialog.cpp --- old/cantata-2.4.0/replaygain/rgdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/replaygain/rgdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -45,6 +45,7 @@ #include <QCloseEvent> #include <QCoreApplication> #include <QEventLoop> +#include <algorithm> enum Columns { @@ -164,7 +165,7 @@ } autoScanTags=autoScan; - qSort(origSongs); + std::sort(origSongs.begin(), origSongs.end()); #ifdef ENABLE_DEVICES_SUPPORT if (udi.isEmpty()) { @@ -625,7 +626,7 @@ for (int i=0; i<view->topLevelItemCount(); ++i) { QTreeWidgetItem *item=view->topLevelItem(i); if (!removedItems.contains(view->indexOfTopLevelItem(item))) { - view->setItemHidden(item, showAll ? false : origTags.contains(i)); + item->setHidden(showAll ? false : origTags.contains(i)); } } } @@ -646,7 +647,7 @@ QList<QTreeWidgetItem *> selection=view->selectedItems(); for (QTreeWidgetItem *item: selection) { int index=view->indexOfTopLevelItem(item); - view->setItemHidden(item, true); + item->setHidden(true); removedItems.insert(index); if (tagsToSave.contains(index)) { tagsToSave.remove(index); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/support/fancytabwidget.cpp new/cantata-2.4.1/support/fancytabwidget.cpp --- old/cantata-2.4.0/support/fancytabwidget.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/support/fancytabwidget.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -163,11 +163,11 @@ int textFlags = Qt::AlignTop | Qt::AlignVCenter; #ifdef Q_OS_MAC - p->setPen(selected && active ? OSXStyle::self()->viewPalette().highlightedText().color() : OSXStyle::self()->viewPalette().foreground().color()); + p->setPen(selected && active ? OSXStyle::self()->viewPalette().highlightedText().color() : OSXStyle::self()->viewPalette().windowText().color()); #elif defined Q_OS_WIN - p->setPen(QApplication::palette().foreground().color()); + p->setPen(QApplication::palette().windowText().color()); #else - p->setPen(selected && active ? QApplication::palette().highlightedText().color() : QApplication::palette().foreground().color()); + p->setPen(selected && active ? QApplication::palette().highlightedText().color() : QApplication::palette().windowText().color()); #endif drawIcon(tabOpt->icon, iconRect, p, tabOpt->iconSize, selected && active); @@ -269,7 +269,7 @@ int padding = FancyTabBar::Side==tabbar->position() ? Utils::scaleForDpi(12) : 0; if (withText) { QFontMetrics fm(font()); - int textWidth = fm.width(text)*1.1; + int textWidth = fm.horizontalAdvance(text)*1.1; int width = qMax(iconSize, qMin(3*iconSize, textWidth)) + spacing; return QSize(width, iconSize + spacing + fm.height() + padding); } else { @@ -456,11 +456,11 @@ tabTextRect.translate(0, -2); #ifdef Q_OS_MAC - painter->setPen(selected ? OSXStyle::self()->viewPalette().highlightedText().color() : OSXStyle::self()->viewPalette().foreground().color()); + painter->setPen(selected ? OSXStyle::self()->viewPalette().highlightedText().color() : OSXStyle::self()->viewPalette().windowText().color()); #elif defined Q_OS_WIN - painter->setPen(QApplication::palette().foreground().color()); + painter->setPen(QApplication::palette().windowText().color()); #else - painter->setPen(selected ? QApplication::palette().highlightedText().color() : QApplication::palette().foreground().color()); + painter->setPen(selected ? QApplication::palette().highlightedText().color() : QApplication::palette().windowText().color()); #endif int textFlags = Qt::AlignCenter | Qt::AlignBottom; painter->drawText(tabTextRect, textFlags, tabText); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/support/inputdialog.cpp new/cantata-2.4.1/support/inputdialog.cpp --- old/cantata-2.4.0/support/inputdialog.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/support/inputdialog.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -29,6 +29,7 @@ #include <QLabel> #include <QFormLayout> #include <QSpinBox> +#include <algorithm> enum InputType { Int, @@ -52,7 +53,7 @@ if (!value.isEmpty() && -1==items.indexOf(value)) { items.append(value); } - qSort(items); + std::sort(items.begin(), items.end()); combo->addItems(items); combo->setCurrentText(value.isEmpty() ? QString() : value); connect(combo, SIGNAL(editTextChanged(QString)), this, SLOT(enableOkButton())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/support/squeezedtextlabel.cpp new/cantata-2.4.1/support/squeezedtextlabel.cpp --- old/cantata-2.4.0/support/squeezedtextlabel.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/support/squeezedtextlabel.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -40,7 +40,7 @@ { QFontMetrics fm(fontMetrics()); int labelWidth = size().width(); - int lineWidth = fm.width(originalText); + int lineWidth = fm.horizontalAdvance(originalText); if (lineWidth > labelWidth) { QLabel::setText(fm.elidedText(originalText, elideMode, labelWidth)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/support/squeezedtextlabel.h new/cantata-2.4.1/support/squeezedtextlabel.h --- old/cantata-2.4.0/support/squeezedtextlabel.h 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/support/squeezedtextlabel.h 2020-02-22 11:24:03.000000000 +0100 @@ -43,7 +43,7 @@ return sh; } - QSize sizeHint() const override { return QSize(fontMetrics().width(originalText), QLabel::sizeHint().height()); } + QSize sizeHint() const override { return QSize(fontMetrics().horizontalAdvance(originalText), QLabel::sizeHint().height()); } void resizeEvent(QResizeEvent *) override { elideText(); } private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/tags/tageditor.cpp new/cantata-2.4.1/tags/tageditor.cpp --- old/cantata-2.4.0/tags/tageditor.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/tags/tageditor.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -42,6 +42,7 @@ #include <QEventLoop> #include <QDir> #include <QTimer> +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -175,7 +176,7 @@ deleteLater(); return; } - qSort(original); + std::sort(original.begin(), original.end()); if (!songsOk(original, baseDir, udi.isEmpty())) { return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/tags/trackorganiser.cpp new/cantata-2.4.1/tags/trackorganiser.cpp --- old/cantata-2.4.0/tags/trackorganiser.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/tags/trackorganiser.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -41,6 +41,7 @@ #include <QTimer> #include <QFile> #include <QDir> +#include <algorithm> #define REMOVE(w) \ w->setVisible(false); \ @@ -129,7 +130,7 @@ opts.load(MPDConnectionDetails::configGroupName(MPDConnection::self()->getDetails().name), true); musicFolder=MPDConnection::self()->getDetails().dir; #endif - qSort(origSongs); + std::sort(origSongs.begin(), origSongs.end()); filenameScheme->setText(opts.scheme); vfatSafe->setChecked(opts.vfatSafe); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/translations/CMakeLists.txt new/cantata-2.4.1/translations/CMakeLists.txt --- old/cantata-2.4.0/translations/CMakeLists.txt 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/translations/CMakeLists.txt 2020-02-22 11:24:03.000000000 +0100 @@ -4,7 +4,7 @@ list(APPEND CANTATA_TRANS "${TRANS}") endforeach () -find_program(LRELEASE_EXECUTABLE lrelease) +find_program(LRELEASE_EXECUTABLE lrelease PATHS /usr/lib64/qt5/bin/) if (LRELEASE_EXECUTABLE) set(catalogname cantata) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/actionitemdelegate.cpp new/cantata-2.4.1/widgets/actionitemdelegate.cpp --- old/cantata-2.4.0/widgets/actionitemdelegate.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/actionitemdelegate.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -175,7 +175,7 @@ bool rtl = QApplication::isRightToLeft(); QListView *lv=qobject_cast<QListView *>(view); GroupedView *gv=lv ? nullptr : qobject_cast<GroupedView *>(view); - ActionPos actionPos=gv ? AP_HBottom : (lv && QListView::ListMode!=lv->viewMode() && (index.child(0, 0).isValid() || index.model()->canFetchMore(index)) ? AP_VTop : AP_HMiddle); + ActionPos actionPos=gv ? AP_HBottom : (lv && QListView::ListMode!=lv->viewMode() && (index.model()->index(0, 0, index).isValid() || index.model()->canFetchMore(index)) ? AP_VTop : AP_HMiddle); QRect rect = view->visualRect(index); rect.moveTo(view->viewport()->mapToGlobal(QPoint(rect.x(), rect.y()))); // Adjust position side to take into account the fact that layout is dynamic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/categorizedview.cpp new/cantata-2.4.1/widgets/categorizedview.cpp --- old/cantata-2.4.0/widgets/categorizedview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/categorizedview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -36,6 +36,7 @@ #include <QModelIndex> #include <QApplication> #include <QLinearGradient> +#include <algorithm> class CategoryDrawer : public KCategoryDrawer { @@ -156,7 +157,7 @@ } if (sorted) { - qSort(actual); + std::sort(actual.begin(), actual.end()); } return actual; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/genrecombo.cpp new/cantata-2.4.1/widgets/genrecombo.cpp --- old/cantata-2.4.0/widgets/genrecombo.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/genrecombo.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -26,6 +26,7 @@ #include "support/actioncollection.h" #include "support/action.h" #include <QEvent> +#include <algorithm> static Action *action=nullptr; @@ -58,7 +59,7 @@ genres=mg; QStringList entries=g.toList(); - qSort(entries); + std::sort(entries.begin(), entries.end()); entries.prepend(tr("All Genres")); if (count()==entries.count()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/groupedview.cpp new/cantata-2.4.1/widgets/groupedview.cpp --- old/cantata-2.4.0/widgets/groupedview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/groupedview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -383,7 +383,7 @@ int td=index.data(Cantata::Role_AlbumDuration).toUInt(); QString totalDuration=td>0 && td!=song.time ? Utils::formatTime(td) : QString(); QRect duratioRect(r.x(), r.y(), r.width(), textHeight); - int totalDurationWidth=fm.width(totalDuration)+8; + int totalDurationWidth=fm.horizontalAdvance(totalDuration)+8; QRect textRect(r.x(), r.y(), r.width()-(rtl ? (4*constBorder) : totalDurationWidth), textHeight); QFont tf(f); tf.setBold(true); @@ -420,7 +420,7 @@ int ratingsStart=rtl ? 0 : drawRatings(painter, song, r, fm, option.palette.color(QPalette::Active, QPalette::Text)); // TODO!!! - int durationWidth=showTrackDuration ? fm.width(duration)+8 : 0; + int durationWidth=showTrackDuration ? fm.horizontalAdvance(duration)+8 : 0; QRect duratioRect(r.x(), r.y(), r.width(), textHeight); QRect textRect(r.x(), r.y(), r.width()-durationWidth, textHeight); if (ratingsStart>0) { @@ -451,7 +451,7 @@ painter->setOpacity(painter->opacity()*0.75); const QSize &ratingSize=ratingPainter->size(); int spacing=constBorder*2; - int durationWidth=fm.width("0:00:00")+spacing; + int durationWidth=fm.horizontalAdvance("0:00:00")+spacing; QRect ratingRect(r.x()+r.width()-(durationWidth+ratingSize.width()+spacing), r.y()+(r.height()-ratingSize.height())/2, ratingSize.width(), ratingSize.height()); @@ -847,7 +847,7 @@ if (!singleOnly) { quint32 count=model()->rowCount(idx); for (quint32 i=0; i<count; ++i) { - expand(idx.child(i, 0)); + expand(model()->index(i, 0, idx)); } } } else if (AlbumHeader==getType(idx)) { @@ -868,7 +868,7 @@ if (!singleOnly) { quint32 count=model()->rowCount(idx); for (quint32 i=0; i<count; ++i) { - collapse(idx.child(i, 0)); + collapse(model()->index(i, 0, idx)); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/itemview.cpp new/cantata-2.4.1/widgets/itemview.cpp --- old/cantata-2.4.0/widgets/itemview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/itemview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -600,7 +600,7 @@ painter->drawText(textRect, str, textOpt); if (text.count()>1) { - int mainWidth=textMetrics.width(str); + int mainWidth=textMetrics.horizontalAdvance(str); text.takeFirst(); str=text.join(Song::constSep); textRect=QRect(r.x()+(mainWidth+8), r.y()+((r.height()-textHeight)/2), r.width()-(mainWidth+8), textHeight); @@ -1703,7 +1703,7 @@ if (itemModel->canFetchMore(index)) { itemModel->fetchMore(index); } - QModelIndex fistChild=index.child(0, 0); + QModelIndex fistChild=itemModel->index(0, 0, index); if (!fistChild.isValid()) { return; } @@ -1714,7 +1714,7 @@ //} prevTopIndex.append(curTop); bool haveChildren=itemModel->canFetchMore(fistChild); - setLevel(currentLevel+1, haveChildren || fistChild.child(0, 0).isValid()); + setLevel(currentLevel+1, haveChildren || itemModel->index(0, 0, fistChild).isValid()); categorizedView->setPlain(!haveChildren); categorizedView->setRootIndex(index); setTitle(); @@ -1727,11 +1727,11 @@ } categorizedView->scrollToTop(); #endif - } else if (usingListView() && (index.isValid() && (index.child(0, 0).isValid() || itemModel->canFetchMore(index)) && index!=listView->rootIndex())) { + } else if (usingListView() && (index.isValid() && (itemModel->index(0, 0, index).isValid() || itemModel->canFetchMore(index)) && index!=listView->rootIndex())) { if (itemModel->canFetchMore(index)) { itemModel->fetchMore(index); } - QModelIndex fistChild=index.child(0, 0); + QModelIndex fistChild=itemModel->index(0, 0, index); if (!fistChild.isValid()) { return; } @@ -1741,7 +1741,7 @@ curTop=static_cast<QSortFilterProxyModel *>(listView->model())->mapToSource(curTop); } prevTopIndex.append(curTop); - setLevel(currentLevel+1, itemModel->canFetchMore(fistChild) || fistChild.child(0, 0).isValid()); + setLevel(currentLevel+1, itemModel->canFetchMore(fistChild) || itemModel->index(0, 0, fistChild).isValid()); listView->setRootIndex(index); setTitle(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/listview.cpp new/cantata-2.4.1/widgets/listview.cpp --- old/cantata-2.4.0/widgets/listview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/listview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -34,6 +34,7 @@ #include <QPainter> #include <QPaintEvent> #include <QModelIndex> +#include <algorithm> ListView::ListView(QWidget *parent) : QListView(parent) @@ -89,7 +90,7 @@ { QModelIndexList indexes=selectionModel() ? selectionModel()->selectedIndexes() : QModelIndexList(); if (sorted) { - qSort(indexes); + std::sort(indexes.begin(), indexes.end()); } return indexes; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/multipagewidget.cpp new/cantata-2.4.1/widgets/multipagewidget.cpp --- old/cantata-2.4.0/widgets/multipagewidget.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/multipagewidget.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -39,6 +39,7 @@ #include <QVBoxLayout> #include <QScrollArea> #include <QStylePainter> +#include <algorithm> class SelectorButton : public ToolButton { @@ -270,7 +271,7 @@ void MultiPageWidget::sortItems() { QList<QString> keys=entries.keys(); - qSort(keys); + std::sort(keys.begin(), keys.end()); infoLabel->setVisible(0==entries.count()); QVBoxLayout *layout=static_cast<QVBoxLayout *>(view->layout()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/playqueueview.cpp new/cantata-2.4.1/widgets/playqueueview.cpp --- old/cantata-2.4.0/widgets/playqueueview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/playqueueview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -113,9 +113,7 @@ setMode(ItemView::Mode_GroupedTree); animator.setPropertyName("fade"); animator.setTargetObject(this); - #if ENABLE_VIEW_BACKGROUND connect(CurrentCover::self(), SIGNAL(coverImage(QImage)), this, SLOT(setImage(QImage))); - #endif } PlayQueueView::~PlayQueueView() @@ -127,7 +125,7 @@ setAutoExpand(Settings::self()->playQueueAutoExpand()); setStartClosed(Settings::self()->playQueueStartClosed()); setMode((ItemView::Mode)Settings::self()->playQueueView()); - #if ENABLE_VIEW_BACKGROUND + int origOpacity=backgroundOpacity; int origBlur=backgroundBlur; QString origCustomBackgroundFile=customBackgroundFile; @@ -164,7 +162,6 @@ } break; } - #endif } void PlayQueueView::saveConfig() @@ -430,7 +427,6 @@ void PlayQueueView::setImage(const QImage &img) { - #if ENABLE_VIEW_BACKGROUND if (BI_None==backgroundImageType || (sender() && BI_Custom==backgroundImageType)) { return; } @@ -465,7 +461,6 @@ animator.setEndValue(1.0); animator.start(); } - #endif } void PlayQueueView::streamFetchStatus(const QString &msg) @@ -486,7 +481,6 @@ void PlayQueueView::drawBackdrop(QWidget *widget, const QSize &size) { - #if ENABLE_VIEW_BACKGROUND if (BI_None==backgroundImageType) { return; } @@ -511,7 +505,6 @@ p.drawPixmap((size.width()-curentBackground.width())/2, (size.height()-curentBackground.height())/2, curentBackground); } } - #endif } #include "moc_playqueueview.cpp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cantata-2.4.0/widgets/treeview.cpp new/cantata-2.4.1/widgets/treeview.cpp --- old/cantata-2.4.0/widgets/treeview.cpp 2020-01-31 09:18:31.000000000 +0100 +++ new/cantata-2.4.1/widgets/treeview.cpp 2020-02-22 11:24:03.000000000 +0100 @@ -38,6 +38,7 @@ #include <QList> #include <QApplication> #include <QHeaderView> +#include <algorithm> #define SINGLE_CLICK style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this) @@ -55,7 +56,6 @@ QPixmap TreeView::createBgndPixmap(const QIcon &icon) { - #if ENABLE_VIEW_BACKGROUND if (icon.isNull()) { return QPixmap(); } @@ -69,9 +69,6 @@ img=img.scaled(bgndSize, bgndSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } return QPixmap::fromImage(setOpacity(img, 0.075)); - #else - return QPixmap(); - #endif } static bool forceSingleClick=true; @@ -164,7 +161,7 @@ drag->setMimeData(data); int pixSize=Icon::stdSize(Utils::scaleForDpi(32)); drag->setPixmap(Icons::self()->audioListIcon.pixmap(pixSize, pixSize)); - drag->start(supportedActions); + drag->exec(supportedActions); } } @@ -243,8 +240,8 @@ toSort.append(Index(i)); } } - // Call qSort on these - this will use operator< - qSort(toSort); + // Call std::sort on these - this will use operator< + std::sort(toSort.begin(), toSort.end()); // Now convert the QList<Index> into a QModelIndexList QModelIndexList sorted; @@ -283,7 +280,7 @@ if (!singleOnly) { quint32 count=model()->rowCount(idx); for (quint32 i=0; i<count; ++i) { - expand(idx.child(i, 0)); + expand(model()->index(i, 0, idx)); } } } @@ -296,7 +293,7 @@ if (!singleOnly) { quint32 count=model()->rowCount(idx); for (quint32 i=0; i<count; ++i) { - collapse(idx.child(i, 0)); + collapse(model()->index(i, 0, idx)); } } } @@ -318,7 +315,6 @@ void TreeView::setBackgroundImage(const QIcon &icon) { - #if ENABLE_VIEW_BACKGROUND QPalette pal=parentWidget()->palette(); // if (!icon.isNull()) { // pal.setColor(QPalette::Base, Qt::transparent); @@ -328,19 +324,16 @@ #endif viewport()->setPalette(pal); bgnd=createBgndPixmap(icon); - #endif } void TreeView::paintEvent(QPaintEvent *e) { - #if ENABLE_VIEW_BACKGROUND if (!bgnd.isNull()) { QPainter p(viewport()); QSize sz=size(); p.fillRect(0, 0, sz.width(), sz.height(), QApplication::palette().color(QPalette::Base)); p.drawPixmap((sz.width()-bgnd.width())/2, (sz.height()-bgnd.height())/2, bgnd); } - #endif if (!info.isEmpty() && model() && 0==model()->rowCount()) { QPainter p(viewport()); QColor col(palette().text().color()); ++++++ fix-translations-with-qt5.diff ++++++ --- /var/tmp/diff_new_pack.BYHSZ7/_old 2020-02-22 19:09:01.274655345 +0100 +++ /var/tmp/diff_new_pack.BYHSZ7/_new 2020-02-22 19:09:01.274655345 +0100 @@ -1,10 +1,11 @@ ---- translations/CMakeLists.txt.orig 2017-08-01 00:15:09.325243508 +0200 -+++ translations/CMakeLists.txt 2017-08-01 00:15:09.357242950 +0200 +diff -ur a/translations/CMakeLists.txt b/translations/CMakeLists.txt +--- a/translations/CMakeLists.txt 2020-02-22 11:24:03.000000000 +0100 ++++ b/translations/CMakeLists.txt 2020-02-22 15:26:32.378741878 +0100 @@ -4,7 +4,7 @@ list(APPEND CANTATA_TRANS "${TRANS}") endforeach () --find_program(LRELEASE_EXECUTABLE lrelease) +-find_program(LRELEASE_EXECUTABLE lrelease PATHS /usr/lib64/qt5/bin/) +find_program(LRELEASE_EXECUTABLE lrelease-qt5) if (LRELEASE_EXECUTABLE)