Replace typedef with using

This commit is contained in:
Jonas Kvinge
2022-10-13 22:39:31 +02:00
parent 61204e8d35
commit b22320c48f
62 changed files with 90 additions and 116 deletions

View File

@@ -71,13 +71,7 @@ struct tag_by_pointer {};
class MergedProxyModelPrivate {
private:
typedef multi_index_container<
Mapping*,
indexed_by<
hashed_unique<tag<tag_by_source>,
member<Mapping, QModelIndex, &Mapping::source_index> >,
ordered_unique<tag<tag_by_pointer>, identity<Mapping*> > > >
MappingContainer;
using MappingContainer = multi_index_container<Mapping *, indexed_by<hashed_unique<tag<tag_by_source>, member<Mapping, QModelIndex, &Mapping::source_index>>, ordered_unique<tag<tag_by_pointer>, identity<Mapping *>>>>;
public:
MappingContainer mappings_;

View File

@@ -45,8 +45,8 @@ class Application;
class Song;
class Playlist;
typedef QList<QVariantMap> TrackMetadata;
typedef QList<QDBusObjectPath> Track_Ids;
using TrackMetadata = QList<QVariantMap>;
using Track_Ids = QList<QDBusObjectPath>;
Q_DECLARE_METATYPE(TrackMetadata)
struct MprisPlaylist {
@@ -54,7 +54,7 @@ struct MprisPlaylist {
QString name;
QString icon; // Uri
};
typedef QList<MprisPlaylist> MprisPlaylistList;
using MprisPlaylistList = QList<MprisPlaylist>;
Q_DECLARE_METATYPE(MprisPlaylist)
Q_DECLARE_METATYPE(MprisPlaylistList)

View File

@@ -44,7 +44,7 @@ class MultiSortFilterProxy : public QSortFilterProxyModel {
private:
int Compare(const QVariant &left, const QVariant &right) const;
typedef QPair<int, Qt::SortOrder> SortSpec;
using SortSpec = QPair<int, Qt::SortOrder>;
QList<SortSpec> sorting_;
};

View File

@@ -55,7 +55,7 @@ class MusicStorage {
Transcode_Unsupported = 3,
};
typedef std::function<void(float progress)> ProgressFunction;
using ProgressFunction = std::function<void(float progress)>;
struct CopyJob {
CopyJob() : overwrite_(false), remove_original_(false), albumcover_(false) {}

View File

@@ -20,7 +20,7 @@
template<typename CFT>
class ScopedCFTypeRef {
public:
typedef CFT element_type;
using element_type = CFT;
explicit ScopedCFTypeRef(CFT object = nullptr) : object_(object) {}

View File

@@ -405,8 +405,8 @@ class Song {
QSharedDataPointer<Private> d;
};
typedef QList<Song> SongList;
typedef QMap<QString, Song> SongMap;
using SongList = QList<Song>;
using SongMap = QMap<QString, Song>;
Q_DECLARE_METATYPE(Song)
Q_DECLARE_METATYPE(SongList)

View File

@@ -53,6 +53,6 @@ class SqlRow {
};
typedef QList<SqlRow> SqlRowList;
using SqlRowList = QList<SqlRow>;
#endif // SQLROW_H

View File

@@ -45,8 +45,8 @@ class TagReaderClient : public QObject {
public:
explicit TagReaderClient(QObject *parent = nullptr);
typedef AbstractMessageHandler<spb::tagreader::Message> HandlerType;
typedef HandlerType::ReplyType ReplyType;
using HandlerType = AbstractMessageHandler<spb::tagreader::Message>;
using ReplyType = HandlerType::ReplyType;
static const char *kWorkerExecutableName;
@@ -94,6 +94,6 @@ class TagReaderClient : public QObject {
QThread *original_thread_;
};
typedef TagReaderClient::ReplyType TagReaderReply;
using TagReaderReply = TagReaderClient::ReplyType;
#endif // TAGREADERCLIENT_H