Drop Qt 5 support
Qt 6 has been available for almost 4 years. Qt 5 is no longer officially supported by Qt for opensource, it's time to drop Qt 5.
This commit is contained in:
@@ -507,11 +507,7 @@ void AlbumCoverChoiceController::ShowCover(const Song &song, const QPixmap &pixm
|
||||
}
|
||||
|
||||
dialog->setWindowTitle(title_text);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
dialog->setFixedSize(label->pixmap(Qt::ReturnByValue).size() / pixmap.devicePixelRatioF());
|
||||
#else
|
||||
dialog->setFixedSize(label->pixmap()->size() / pixmap.devicePixelRatioF());
|
||||
#endif
|
||||
dialog->show();
|
||||
|
||||
}
|
||||
@@ -721,11 +717,7 @@ void AlbumCoverChoiceController::SaveCoverEmbeddedToCollectionSongs(const Song &
|
||||
|
||||
void AlbumCoverChoiceController::SaveCoverEmbeddedToCollectionSongs(const QString &effective_albumartist, const QString &effective_album, const QString &cover_filename, const QByteArray &image_data, const QString &mime_type) {
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<SongList> future = QtConcurrent::run(&CollectionBackend::GetAlbumSongs, app_->collection_backend(), effective_albumartist, effective_album, CollectionFilterOptions());
|
||||
#else
|
||||
QFuture<SongList> future = QtConcurrent::run(&*app_->collection_backend(), &CollectionBackend::GetAlbumSongs, effective_albumartist, effective_album, CollectionFilterOptions());
|
||||
#endif
|
||||
QFutureWatcher<SongList> *watcher = new QFutureWatcher<SongList>();
|
||||
QObject::connect(watcher, &QFutureWatcher<SongList>::finished, this, [this, watcher, cover_filename, image_data, mime_type]() {
|
||||
const SongList collection_songs = watcher->result();
|
||||
|
||||
@@ -408,11 +408,7 @@ void AlbumCoverLoader::LoadRemoteImageFinished(QNetworkReply *reply, TaskPtr tas
|
||||
reply->deleteLater();
|
||||
|
||||
QVariant redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
if (redirect.isValid() && redirect.metaType().id() == QMetaType::QUrl) {
|
||||
#else
|
||||
if (redirect.isValid() && redirect.type() == QVariant::Url) {
|
||||
#endif
|
||||
if (task->redirects++ >= kMaxRedirects) {
|
||||
ProcessTask(task);
|
||||
return;
|
||||
|
||||
@@ -319,11 +319,7 @@ void AlbumCoverManager::SaveSettings() {
|
||||
|
||||
void AlbumCoverManager::CancelRequests() {
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
app_->album_cover_loader()->CancelTasks(QSet<quint64>(cover_loading_tasks_.keyBegin(), cover_loading_tasks_.keyEnd()));
|
||||
#else
|
||||
app_->album_cover_loader()->CancelTasks(QSet<quint64>::fromList(cover_loading_tasks_.keys()));
|
||||
#endif
|
||||
cover_loading_pending_.clear();
|
||||
cover_loading_tasks_.clear();
|
||||
cover_save_tasks_.clear();
|
||||
|
||||
@@ -42,11 +42,7 @@
|
||||
|
||||
AlbumCoverManagerList::AlbumCoverManagerList(QWidget *parent) : QListWidget(parent), manager_(nullptr) {}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QMimeData *AlbumCoverManagerList::mimeData(const QList<QListWidgetItem*> &items) const {
|
||||
#else
|
||||
QMimeData *AlbumCoverManagerList::mimeData(const QList<QListWidgetItem*> items) const {
|
||||
#endif
|
||||
|
||||
// Get songs
|
||||
SongList songs;
|
||||
|
||||
@@ -44,11 +44,7 @@ class AlbumCoverManagerList : public QListWidget {
|
||||
void set_cover_manager(AlbumCoverManager *manager) { manager_ = manager; }
|
||||
|
||||
protected:
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QMimeData *mimeData(const QList<QListWidgetItem*> &items) const override;
|
||||
#else
|
||||
QMimeData *mimeData(const QList<QListWidgetItem*> items) const override;
|
||||
#endif
|
||||
|
||||
void dropEvent(QDropEvent*) override {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user