Replace QList<QByteArray> with QByteArrayList
This commit is contained in:
parent
16b4f5d065
commit
394955a03f
@ -2,13 +2,13 @@
|
|||||||
#define DBUS_METATYPES_H
|
#define DBUS_METATYPES_H
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QList>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDBusObjectPath>
|
#include <QDBusObjectPath>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QList<QByteArray>)
|
Q_DECLARE_METATYPE(QByteArrayList)
|
||||||
|
|
||||||
using InterfacesAndProperties = QMap<QString, QVariantMap>;
|
using InterfacesAndProperties = QMap<QString, QVariantMap>;
|
||||||
using ManagedObjectList = QMap<QDBusObjectPath, InterfacesAndProperties>;
|
using ManagedObjectList = QMap<QDBusObjectPath, InterfacesAndProperties>;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
@ -377,7 +378,7 @@ void LocalRedirectServer::WriteTemplate() const {
|
|||||||
|
|
||||||
QUrl LocalRedirectServer::ParseUrlFromRequest(const QByteArray &request) const {
|
QUrl LocalRedirectServer::ParseUrlFromRequest(const QByteArray &request) const {
|
||||||
|
|
||||||
QList<QByteArray> lines = request.split('\r');
|
const QByteArrayList lines = request.split('\r');
|
||||||
const QByteArray &request_line = lines[0];
|
const QByteArray &request_line = lines[0];
|
||||||
QByteArray path = request_line.split(' ')[1];
|
QByteArray path = request_line.split(' ')[1];
|
||||||
QUrl base_url = url_;
|
QUrl base_url = url_;
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QList>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
@ -1349,7 +1351,7 @@ void QobuzRequest::AlbumCoverReceived(QNetworkReply *reply, const QUrl &cover_ur
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
QByteArrayList format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
||||||
char *format = nullptr;
|
char *format = nullptr;
|
||||||
if (!format_list.isEmpty()) {
|
if (!format_list.isEmpty()) {
|
||||||
format = format_list.first().data();
|
format = format_list.first().data();
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
@ -818,7 +819,7 @@ void SubsonicRequest::AlbumCoverReceived(QNetworkReply *reply, const AlbumCoverR
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
QByteArrayList format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
||||||
char *format = nullptr;
|
char *format = nullptr;
|
||||||
if (!format_list.isEmpty()) {
|
if (!format_list.isEmpty()) {
|
||||||
format = format_list.first().data();
|
format = format_list.first().data();
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QList>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
@ -1291,7 +1293,7 @@ void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
QByteArrayList format_list = ImageUtils::ImageFormatsForMimeType(mimetype.toUtf8());
|
||||||
char *format = nullptr;
|
char *format = nullptr;
|
||||||
if (!format_list.isEmpty()) {
|
if (!format_list.isEmpty()) {
|
||||||
format = format_list.first().data();
|
format = format_list.first().data();
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QBuffer>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QBuffer>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@ -61,16 +61,16 @@ QStringList ImageUtils::SupportedImageFormats() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> ImageUtils::ImageFormatsForMimeType(const QByteArray &mimetype) {
|
QByteArrayList ImageUtils::ImageFormatsForMimeType(const QByteArray &mimetype) {
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
||||||
return QImageReader::imageFormatsForMimeType(mimetype);
|
return QImageReader::imageFormatsForMimeType(mimetype);
|
||||||
#else
|
#else
|
||||||
if (mimetype == "image/bmp") return QList<QByteArray>() << "BMP";
|
if (mimetype == "image/bmp") return QByteArrayList() << "BMP";
|
||||||
else if (mimetype == "image/gif") return QList<QByteArray>() << "GIF";
|
else if (mimetype == "image/gif") return QByteArrayList() << "GIF";
|
||||||
else if (mimetype == "image/jpeg") return QList<QByteArray>() << "JPG";
|
else if (mimetype == "image/jpeg") return QByteArrayList() << "JPG";
|
||||||
else if (mimetype == "image/png") return QList<QByteArray>() << "PNG";
|
else if (mimetype == "image/png") return QByteArrayList() << "PNG";
|
||||||
else return QList<QByteArray>();
|
else return QByteArrayList();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
#ifndef IMAGEUTILS_H
|
#ifndef IMAGEUTILS_H
|
||||||
#define IMAGEUTILS_H
|
#define IMAGEUTILS_H
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QByteArrayList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
@ -37,7 +37,7 @@ class ImageUtils {
|
|||||||
public:
|
public:
|
||||||
static QStringList SupportedImageMimeTypes();
|
static QStringList SupportedImageMimeTypes();
|
||||||
static QStringList SupportedImageFormats();
|
static QStringList SupportedImageFormats();
|
||||||
static QList<QByteArray> ImageFormatsForMimeType(const QByteArray &mimetype);
|
static QByteArrayList ImageFormatsForMimeType(const QByteArray &mimetype);
|
||||||
static QByteArray SaveImageToJpegData(const QImage &image = QImage());
|
static QByteArray SaveImageToJpegData(const QImage &image = QImage());
|
||||||
static QByteArray FileToJpegData(const QString &filename);
|
static QByteArray FileToJpegData(const QString &filename);
|
||||||
static QPixmap TryLoadPixmap(const QUrl &automatic, const QUrl &manual, const QUrl &url = QUrl());
|
static QPixmap TryLoadPixmap(const QUrl &automatic, const QUrl &manual, const QUrl &url = QUrl());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user