Make static
This commit is contained in:
parent
e3ab0c0192
commit
8c2b907ff5
@ -80,7 +80,7 @@ class SingleApplicationPrivate : public QObject {
|
||||
explicit SingleApplicationPrivate(SingleApplication *ptr);
|
||||
~SingleApplicationPrivate() override;
|
||||
|
||||
QString getUsername();
|
||||
static QString getUsername();
|
||||
void genBlockServerName();
|
||||
void initializeMemoryBlock();
|
||||
void startPrimary();
|
||||
@ -91,7 +91,7 @@ class SingleApplicationPrivate : public QObject {
|
||||
QString primaryUser();
|
||||
void readInitMessageHeader(QLocalSocket *socket);
|
||||
void readInitMessageBody(QLocalSocket *socket);
|
||||
void randomSleep();
|
||||
static void randomSleep();
|
||||
|
||||
SingleApplication *q_ptr;
|
||||
QSharedMemory *memory_;
|
||||
|
@ -80,7 +80,7 @@ class SingleCoreApplicationPrivate : public QObject {
|
||||
explicit SingleCoreApplicationPrivate(SingleCoreApplication *ptr);
|
||||
~SingleCoreApplicationPrivate() override;
|
||||
|
||||
QString getUsername();
|
||||
static QString getUsername();
|
||||
void genBlockServerName();
|
||||
void initializeMemoryBlock();
|
||||
void startPrimary();
|
||||
@ -91,7 +91,7 @@ class SingleCoreApplicationPrivate : public QObject {
|
||||
QString primaryUser();
|
||||
void readInitMessageHeader(QLocalSocket *socket);
|
||||
void readInitMessageBody(QLocalSocket *socket);
|
||||
void randomSleep();
|
||||
static void randomSleep();
|
||||
|
||||
SingleCoreApplication *q_ptr;
|
||||
QSharedMemory *memory_;
|
||||
|
@ -117,7 +117,7 @@ class FHT {
|
||||
/**
|
||||
* Discrete Hartley transform of data sets with 8 values.
|
||||
*/
|
||||
void transform8(float*);
|
||||
static void transform8(float*);
|
||||
|
||||
void transform(float*);
|
||||
};
|
||||
|
@ -306,7 +306,7 @@ CollectionItem *CollectionModel::CreateCompilationArtistNode(const bool signal,
|
||||
|
||||
}
|
||||
|
||||
QString CollectionModel::ContainerKey(const GroupBy type, const Song &song) const {
|
||||
QString CollectionModel::ContainerKey(const GroupBy type, const Song &song) {
|
||||
|
||||
QString key;
|
||||
|
||||
@ -397,7 +397,7 @@ QString CollectionModel::ContainerKey(const GroupBy type, const Song &song) cons
|
||||
|
||||
}
|
||||
|
||||
QString CollectionModel::DividerKey(const GroupBy type, CollectionItem *item) const {
|
||||
QString CollectionModel::DividerKey(const GroupBy type, CollectionItem *item) {
|
||||
|
||||
// Items which are to be grouped under the same divider must produce the same divider key. This will only get called for top-level items.
|
||||
|
||||
@ -455,7 +455,7 @@ QString CollectionModel::DividerKey(const GroupBy type, CollectionItem *item) co
|
||||
|
||||
}
|
||||
|
||||
QString CollectionModel::DividerDisplayText(const GroupBy type, const QString &key) const {
|
||||
QString CollectionModel::DividerDisplayText(const GroupBy type, const QString &key) {
|
||||
|
||||
// Pretty display text for the dividers.
|
||||
|
||||
@ -1754,7 +1754,7 @@ bool CollectionModel::CompareItems(const CollectionItem *a, const CollectionItem
|
||||
|
||||
}
|
||||
|
||||
qint64 CollectionModel::MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default) const {
|
||||
qint64 CollectionModel::MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default) {
|
||||
|
||||
qint64 size = s->value(size_id, cache_size_default).toInt();
|
||||
int unit = s->value(size_unit_id, CollectionSettingsPage::CacheSizeUnit::CacheSizeUnit_MB).toInt() + 1;
|
||||
|
@ -226,7 +226,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
void TotalSongCountUpdatedSlot(const int count);
|
||||
void TotalArtistCountUpdatedSlot(const int count);
|
||||
void TotalAlbumCountUpdatedSlot(const int count);
|
||||
void ClearDiskCache();
|
||||
static void ClearDiskCache();
|
||||
|
||||
// Called after ResetAsync
|
||||
void ResetAsyncQueryFinished();
|
||||
@ -247,7 +247,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
// When the model is reset or when a node is lazy-loaded the Collection constructs a database query to populate the items.
|
||||
// Filters are added for each parent item, restricting the songs returned to a particular album or artist for example.
|
||||
static void InitQuery(const GroupBy type, CollectionQuery *q);
|
||||
void FilterQuery(const GroupBy type, CollectionItem *item, CollectionQuery *q);
|
||||
static void FilterQuery(const GroupBy type, CollectionItem *item, CollectionQuery *q);
|
||||
|
||||
// Items can be created either from a query that's been run to populate a node, or by a spontaneous SongsDiscovered emission from the backend.
|
||||
CollectionItem *ItemFromQuery(const GroupBy type, const bool signal, const bool create_divider, CollectionItem *parent, const SqlRow &row, const int container_level);
|
||||
@ -260,9 +260,9 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
CollectionItem *InitItem(const GroupBy type, const bool signal, CollectionItem *parent, const int container_level);
|
||||
void FinishItem(const GroupBy type, const bool signal, const bool create_divider, CollectionItem *parent, CollectionItem *item);
|
||||
|
||||
QString ContainerKey(const GroupBy type, const Song &song) const;
|
||||
QString DividerKey(const GroupBy type, CollectionItem *item) const;
|
||||
QString DividerDisplayText(const GroupBy type, const QString &key) const;
|
||||
static QString ContainerKey(const GroupBy type, const Song &song) ;
|
||||
static QString DividerKey(const GroupBy type, CollectionItem *item) ;
|
||||
static QString DividerDisplayText(const GroupBy type, const QString &key) ;
|
||||
|
||||
// Helpers
|
||||
static bool IsCompilationArtistNode(const CollectionItem *node) { return node == node->parent->compilation_artist_node_; }
|
||||
@ -270,7 +270,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
||||
QVariant AlbumIcon(const QModelIndex &idx);
|
||||
QVariant data(const CollectionItem *item, const int role) const;
|
||||
bool CompareItems(const CollectionItem *a, const CollectionItem *b) const;
|
||||
qint64 MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default) const;
|
||||
static qint64 MaximumCacheSize(QSettings *s, const char *size_id, const char *size_unit_id, const qint64 cache_size_default) ;
|
||||
|
||||
private:
|
||||
CollectionBackend *backend_;
|
||||
|
@ -168,7 +168,7 @@ class CollectionWatcher : public QObject {
|
||||
void ScanSubdirectory(const QString &path, const Subdirectory &subdir, const quint64 files_count, CollectionWatcher::ScanTransaction *t, const bool force_noincremental = false);
|
||||
|
||||
private:
|
||||
static bool FindSongsByPath(const SongList &list, const QString &path, SongList *out);
|
||||
static bool FindSongsByPath(const SongList &songs, const QString &path, SongList *out);
|
||||
bool FindSongsByFingerprint(const QString &file, const QString &fingerprint, SongList *out);
|
||||
static bool FindSongsByFingerprint(const QString &file, const SongList &songs, const QString &fingerprint, SongList *out);
|
||||
inline static QString NoExtensionPart(const QString &fileName);
|
||||
@ -178,7 +178,7 @@ class CollectionWatcher : public QObject {
|
||||
QUrl ImageForSong(const QString &path, QMap<QString, QStringList> &album_art);
|
||||
void AddWatch(const Directory &dir, const QString &path);
|
||||
void RemoveWatch(const Directory &dir, const Subdirectory &subdir);
|
||||
quint64 GetMtimeForCue(const QString &cue_path);
|
||||
static quint64 GetMtimeForCue(const QString &cue_path);
|
||||
void PerformScan(const bool incremental, const bool ignore_mtimes);
|
||||
|
||||
// Updates the sections of a cue associated and altered (according to mtime) media file during a scan.
|
||||
@ -189,7 +189,7 @@ class CollectionWatcher : public QObject {
|
||||
// It may result in a multiple files added to the collection when the media file has many sections (like a CUE related media file).
|
||||
SongList ScanNewFile(const QString &file, const QString &path, const QString &fingerprint, const QString &matching_cue, QSet<QString> *cues_processed);
|
||||
|
||||
void AddChangedSong(const QString &file, const Song &matching_song, const Song &new_song, ScanTransaction *t);
|
||||
static void AddChangedSong(const QString &file, const Song &matching_song, const Song &new_song, ScanTransaction *t);
|
||||
|
||||
quint64 FilesCountForPath(ScanTransaction *t, const QString &path);
|
||||
quint64 FilesCountForSubdirs(ScanTransaction *t, const SubdirectoryList &subdirs, QMap<QString, quint64> &subdir_files_count);
|
||||
|
@ -103,7 +103,7 @@ void ContextAlbumsModel::AddSongs(const SongList &songs) {
|
||||
|
||||
}
|
||||
|
||||
QString ContextAlbumsModel::AlbumIconPixmapCacheKey(const QModelIndex &idx) const {
|
||||
QString ContextAlbumsModel::AlbumIconPixmapCacheKey(const QModelIndex &idx) {
|
||||
|
||||
QStringList path;
|
||||
QModelIndex index_copy(idx);
|
||||
|
@ -107,7 +107,7 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
|
||||
void PostQuery(CollectionItem *parent, const QueryResult &result, bool signal);
|
||||
CollectionItem *ItemFromSong(CollectionItem::Type item_type, bool signal, CollectionItem *parent, const Song &s, int container_level);
|
||||
|
||||
QString AlbumIconPixmapCacheKey(const QModelIndex &idx) const;
|
||||
static QString AlbumIconPixmapCacheKey(const QModelIndex &idx) ;
|
||||
QVariant AlbumIcon(const QModelIndex &idx);
|
||||
QVariant data(const CollectionItem *item, int role) const;
|
||||
bool CompareItems(const CollectionItem *a, const CollectionItem *b) const;
|
||||
|
@ -72,7 +72,7 @@ class ContextView : public QWidget {
|
||||
|
||||
private:
|
||||
void AddActions();
|
||||
void SetLabelText(QLabel *label, int value, const QString &suffix, const QString &def = QString());
|
||||
static void SetLabelText(QLabel *label, int value, const QString &suffix, const QString &def = QString());
|
||||
void NoSong();
|
||||
void SetSong();
|
||||
void UpdateSong(const Song &song);
|
||||
|
@ -36,7 +36,7 @@ class Appearance : public QObject {
|
||||
static const QPalette kDefaultPalette;
|
||||
|
||||
void LoadUserTheme();
|
||||
void ResetToSystemDefaultTheme();
|
||||
static void ResetToSystemDefaultTheme();
|
||||
void ChangeForegroundColor(const QColor &color);
|
||||
void ChangeBackgroundColor(const QColor &color);
|
||||
|
||||
|
@ -106,7 +106,7 @@ class Application : public QObject {
|
||||
void Exit();
|
||||
|
||||
QThread *MoveToNewThread(QObject *object);
|
||||
void MoveToThread(QObject *object, QThread *thread);
|
||||
static void MoveToThread(QObject *object, QThread *thread);
|
||||
|
||||
private slots:
|
||||
void ExitReceived();
|
||||
|
@ -100,7 +100,7 @@ class CommandlineOptions {
|
||||
RestartOrPrevious
|
||||
};
|
||||
|
||||
QString tr(const char *source_text);
|
||||
static QString tr(const char *source_text);
|
||||
void RemoveArg(const QString &starts_with, int count);
|
||||
|
||||
private:
|
||||
|
@ -533,7 +533,7 @@ void Database::DoBackup() {
|
||||
|
||||
}
|
||||
|
||||
bool Database::OpenDatabase(const QString &filename, sqlite3 **connection) const {
|
||||
bool Database::OpenDatabase(const QString &filename, sqlite3 **connection) {
|
||||
|
||||
int ret = sqlite3_open(filename.toUtf8(), connection);
|
||||
if (ret != 0) {
|
||||
|
@ -65,7 +65,7 @@ class Database : public QObject {
|
||||
void ExitAsync();
|
||||
QSqlDatabase Connect();
|
||||
void Close();
|
||||
bool CheckErrors(const QSqlQuery &query);
|
||||
static bool CheckErrors(const QSqlQuery &query);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QRecursiveMutex *Mutex() { return &mutex_; }
|
||||
@ -94,18 +94,18 @@ class Database : public QObject {
|
||||
void DoBackup();
|
||||
|
||||
private:
|
||||
int SchemaVersion(QSqlDatabase *db);
|
||||
static int SchemaVersion(QSqlDatabase *db);
|
||||
void UpdateMainSchema(QSqlDatabase *db);
|
||||
|
||||
void ExecSchemaCommandsFromFile(QSqlDatabase &db, const QString &filename, int schema_version, bool in_transaction = false);
|
||||
void ExecSongTablesCommands(QSqlDatabase &db, const QStringList &song_tables, const QStringList &commands);
|
||||
static void ExecSongTablesCommands(QSqlDatabase &db, const QStringList &song_tables, const QStringList &commands);
|
||||
|
||||
void UpdateDatabaseSchema(int version, QSqlDatabase &db);
|
||||
void UrlEncodeFilenameColumn(const QString &table, QSqlDatabase &db);
|
||||
static void UrlEncodeFilenameColumn(const QString &table, QSqlDatabase &db);
|
||||
QStringList SongsTables(QSqlDatabase &db, int schema_version) const;
|
||||
bool IntegrityCheck(const QSqlDatabase &db);
|
||||
void BackupFile(const QString &filename);
|
||||
bool OpenDatabase(const QString &filename, sqlite3 **connection) const;
|
||||
static bool OpenDatabase(const QString &filename, sqlite3 **connection) ;
|
||||
|
||||
Application *app_;
|
||||
|
||||
|
@ -1633,7 +1633,7 @@ void MainWindow::UpdateTrackSliderPosition() {
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) const {
|
||||
void MainWindow::ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) {
|
||||
|
||||
switch (b) {
|
||||
case BehaviourSettingsPage::AddBehaviour_Append:
|
||||
|
@ -279,7 +279,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
||||
|
||||
void SaveSettings();
|
||||
|
||||
void ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) const;
|
||||
static void ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) ;
|
||||
void ApplyPlayBehaviour(const BehaviourSettingsPage::PlayBehaviour b, MimeData *mimedata) const;
|
||||
|
||||
void CheckFullRescanRevisions();
|
||||
|
@ -226,11 +226,11 @@ void Mpris2::EmitNotification(const QString &name) {
|
||||
|
||||
//------------------Root Interface--------------------------//
|
||||
|
||||
bool Mpris2::CanQuit() const { return true; }
|
||||
bool Mpris2::CanQuit() { return true; }
|
||||
|
||||
bool Mpris2::CanRaise() const { return true; }
|
||||
bool Mpris2::CanRaise() { return true; }
|
||||
|
||||
bool Mpris2::HasTrackList() const { return true; }
|
||||
bool Mpris2::HasTrackList() { return true; }
|
||||
|
||||
QString Mpris2::Identity() const { return app_name_; }
|
||||
|
||||
@ -250,7 +250,7 @@ QString Mpris2::DesktopEntryAbsolutePath() const {
|
||||
|
||||
QString Mpris2::DesktopEntry() const { return desktop_file_; }
|
||||
|
||||
QStringList Mpris2::SupportedUriSchemes() const {
|
||||
QStringList Mpris2::SupportedUriSchemes() {
|
||||
|
||||
static QStringList res = QStringList() << "file"
|
||||
<< "http"
|
||||
@ -261,7 +261,7 @@ QStringList Mpris2::SupportedUriSchemes() const {
|
||||
|
||||
}
|
||||
|
||||
QStringList Mpris2::SupportedMimeTypes() const {
|
||||
QStringList Mpris2::SupportedMimeTypes() {
|
||||
|
||||
static QStringList res = QStringList() << "x-content/audio-player"
|
||||
<< "application/ogg"
|
||||
@ -304,7 +304,7 @@ QString Mpris2::PlaybackStatus() const {
|
||||
return PlaybackStatus(app_->player()->GetState());
|
||||
}
|
||||
|
||||
QString Mpris2::PlaybackStatus(Engine::State state) const {
|
||||
QString Mpris2::PlaybackStatus(Engine::State state) {
|
||||
|
||||
switch (state) {
|
||||
case Engine::Playing: return "Playing";
|
||||
@ -347,7 +347,7 @@ void Mpris2::SetLoopStatus(const QString &value) {
|
||||
|
||||
}
|
||||
|
||||
double Mpris2::Rate() const { return 1.0; }
|
||||
double Mpris2::Rate() { return 1.0; }
|
||||
|
||||
void Mpris2::SetRate(double rate) {
|
||||
|
||||
@ -418,9 +418,9 @@ qint64 Mpris2::Position() const {
|
||||
return app_->player()->engine()->position_nanosec() / kNsecPerUsec;
|
||||
}
|
||||
|
||||
double Mpris2::MaximumRate() const { return 1.0; }
|
||||
double Mpris2::MaximumRate() { return 1.0; }
|
||||
|
||||
double Mpris2::MinimumRate() const { return 1.0; }
|
||||
double Mpris2::MinimumRate() { return 1.0; }
|
||||
|
||||
bool Mpris2::CanGoNext() const {
|
||||
return app_->playlist_manager()->active() && app_->playlist_manager()->active()->next_row() != -1;
|
||||
@ -445,7 +445,7 @@ bool Mpris2::CanSeek(Engine::State state) const {
|
||||
return app_->player()->GetCurrentItem() && state != Engine::Empty && !app_->player()->GetCurrentItem()->Metadata().is_stream();
|
||||
}
|
||||
|
||||
bool Mpris2::CanControl() const { return true; }
|
||||
bool Mpris2::CanControl() { return true; }
|
||||
|
||||
void Mpris2::Next() {
|
||||
if (CanGoNext()) {
|
||||
@ -503,14 +503,14 @@ void Mpris2::OpenUri(const QString &uri) {
|
||||
app_->playlist_manager()->active()->InsertUrls(QList<QUrl>() << QUrl(uri), -1, true);
|
||||
}
|
||||
|
||||
Track_Ids Mpris2::Tracks() const {
|
||||
Track_Ids Mpris2::Tracks() {
|
||||
// TODO
|
||||
return Track_Ids();
|
||||
}
|
||||
|
||||
bool Mpris2::CanEditTracks() const { return false; }
|
||||
bool Mpris2::CanEditTracks() { return false; }
|
||||
|
||||
TrackMetadata Mpris2::GetTracksMetadata(const Track_Ids &tracks) const {
|
||||
TrackMetadata Mpris2::GetTracksMetadata(const Track_Ids &tracks) {
|
||||
|
||||
Q_UNUSED(tracks);
|
||||
|
||||
@ -543,7 +543,7 @@ quint32 Mpris2::PlaylistCount() const {
|
||||
return app_->playlist_manager()->GetAllPlaylists().size();
|
||||
}
|
||||
|
||||
QStringList Mpris2::Orderings() const { return QStringList() << "User"; }
|
||||
QStringList Mpris2::Orderings() { return QStringList() << "User"; }
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -118,13 +118,13 @@ class Mpris2 : public QObject {
|
||||
Q_PROPERTY(MaybePlaylist ActivePlaylist READ ActivePlaylist)
|
||||
|
||||
// Root Properties
|
||||
bool CanQuit() const;
|
||||
bool CanRaise() const;
|
||||
bool HasTrackList() const;
|
||||
static bool CanQuit();
|
||||
static bool CanRaise();
|
||||
static bool HasTrackList();
|
||||
QString Identity() const;
|
||||
QString DesktopEntry() const;
|
||||
QStringList SupportedUriSchemes() const;
|
||||
QStringList SupportedMimeTypes() const;
|
||||
static QStringList SupportedUriSchemes();
|
||||
static QStringList SupportedMimeTypes();
|
||||
|
||||
// Root Properties added in MPRIS 2.2
|
||||
bool CanSetFullscreen() const { return false; }
|
||||
@ -133,13 +133,13 @@ class Mpris2 : public QObject {
|
||||
|
||||
// Methods
|
||||
void Raise();
|
||||
void Quit();
|
||||
static void Quit();
|
||||
|
||||
// Player Properties
|
||||
QString PlaybackStatus() const;
|
||||
QString LoopStatus() const;
|
||||
void SetLoopStatus(const QString &value);
|
||||
double Rate() const;
|
||||
static double Rate();
|
||||
void SetRate(double rate);
|
||||
bool Shuffle() const;
|
||||
void SetShuffle(bool enable);
|
||||
@ -147,14 +147,14 @@ class Mpris2 : public QObject {
|
||||
double Volume() const;
|
||||
void SetVolume(double value);
|
||||
qint64 Position() const;
|
||||
double MaximumRate() const;
|
||||
double MinimumRate() const;
|
||||
static double MaximumRate();
|
||||
static double MinimumRate();
|
||||
bool CanGoNext() const;
|
||||
bool CanGoPrevious() const;
|
||||
bool CanPlay() const;
|
||||
bool CanPause() const;
|
||||
bool CanSeek() const;
|
||||
bool CanControl() const;
|
||||
static bool CanControl();
|
||||
|
||||
// Methods
|
||||
void Next();
|
||||
@ -168,18 +168,18 @@ class Mpris2 : public QObject {
|
||||
void OpenUri(const QString &uri);
|
||||
|
||||
// TrackList Properties
|
||||
Track_Ids Tracks() const;
|
||||
bool CanEditTracks() const;
|
||||
static Track_Ids Tracks();
|
||||
static bool CanEditTracks();
|
||||
|
||||
// Methods
|
||||
TrackMetadata GetTracksMetadata(const Track_Ids &tracks) const;
|
||||
void AddTrack(const QString &uri, const QDBusObjectPath &afterTrack, bool setAsCurrent);
|
||||
void RemoveTrack(const QDBusObjectPath &trackId);
|
||||
void GoTo(const QDBusObjectPath &trackId);
|
||||
static TrackMetadata GetTracksMetadata(const Track_Ids &tracks) ;
|
||||
static void AddTrack(const QString &uri, const QDBusObjectPath &afterTrack, bool setAsCurrent);
|
||||
static void RemoveTrack(const QDBusObjectPath &trackId);
|
||||
static void GoTo(const QDBusObjectPath &trackId);
|
||||
|
||||
// Playlist Properties
|
||||
quint32 PlaylistCount() const;
|
||||
QStringList Orderings() const;
|
||||
static QStringList Orderings();
|
||||
MaybePlaylist ActivePlaylist() const;
|
||||
|
||||
// Methods
|
||||
@ -215,10 +215,10 @@ class Mpris2 : public QObject {
|
||||
|
||||
private:
|
||||
void EmitNotification(const QString &name);
|
||||
void EmitNotification(const QString &name, const QVariant &val);
|
||||
void EmitNotification(const QString &name, const QVariant &val, const QString &mprisEntity);
|
||||
static void EmitNotification(const QString &name, const QVariant &val);
|
||||
static void EmitNotification(const QString &name, const QVariant &val, const QString &mprisEntity);
|
||||
|
||||
QString PlaybackStatus(Engine::State state) const;
|
||||
static QString PlaybackStatus(Engine::State state) ;
|
||||
|
||||
QString current_track_id() const;
|
||||
|
||||
|
@ -414,7 +414,7 @@ void Song::set_artist_id(const QString &v) { d->artist_id_ = v; }
|
||||
void Song::set_album_id(const QString &v) { d->album_id_ = v; }
|
||||
void Song::set_song_id(const QString &v) { d->song_id_ = v; }
|
||||
|
||||
QString Song::sortable(const QString &v) const {
|
||||
QString Song::sortable(const QString &v) {
|
||||
|
||||
QString copy = v.toLower();
|
||||
|
||||
|
@ -388,7 +388,7 @@ class Song {
|
||||
private:
|
||||
struct Private;
|
||||
|
||||
QString sortable(const QString &v) const;
|
||||
static QString sortable(const QString &v) ;
|
||||
|
||||
QSharedDataPointer<Private> d;
|
||||
};
|
||||
|
@ -126,7 +126,7 @@ void StyleSheetLoader::UpdateStyleSheet(QWidget *widget, StyleSheetData styledat
|
||||
|
||||
}
|
||||
|
||||
void StyleSheetLoader::ReplaceColor(QString *css, const QString &name, const QPalette &palette, QPalette::ColorRole role) const {
|
||||
void StyleSheetLoader::ReplaceColor(QString *css, const QString &name, const QPalette &palette, QPalette::ColorRole role) {
|
||||
|
||||
css->replace("%palette-" + name + "-lighter", palette.color(role).lighter().name(), Qt::CaseInsensitive);
|
||||
css->replace("%palette-" + name + "-darker", palette.color(role).darker().name(), Qt::CaseInsensitive);
|
||||
|
@ -59,7 +59,7 @@ class StyleSheetLoader : public QObject {
|
||||
|
||||
private:
|
||||
void UpdateStyleSheet(QWidget *widget, StyleSheetData styledata);
|
||||
void ReplaceColor(QString *css, const QString &name, const QPalette &palette, QPalette::ColorRole role) const;
|
||||
static void ReplaceColor(QString *css, const QString &name, const QPalette &palette, QPalette::ColorRole role);
|
||||
|
||||
private slots:
|
||||
void ResetCounters();
|
||||
|
@ -160,7 +160,7 @@ class AlbumCoverChoiceController : public QWidget {
|
||||
void AutomaticCoverSearchDone();
|
||||
|
||||
private:
|
||||
QString GetInitialPathForFileDialog(const Song &song, const QString &filename);
|
||||
static QString GetInitialPathForFileDialog(const Song &song, const QString &filename);
|
||||
|
||||
static bool IsKnownImageExtension(const QString &suffix);
|
||||
static QSet<QString> *sImageExtensions;
|
||||
|
@ -371,7 +371,7 @@ void AlbumCoverFetcherSearch::ProviderCoverFetchFinished(QNetworkReply *reply) {
|
||||
|
||||
}
|
||||
|
||||
float AlbumCoverFetcherSearch::ScoreImage(const QSize size) const {
|
||||
float AlbumCoverFetcherSearch::ScoreImage(const QSize size) {
|
||||
|
||||
if (size.width() == 0 || size.height() == 0) return 0.0;
|
||||
|
||||
|
@ -81,7 +81,7 @@ class AlbumCoverFetcherSearch : public QObject {
|
||||
void AllProvidersFinished();
|
||||
|
||||
void FetchMoreImages();
|
||||
float ScoreImage(const QSize size) const;
|
||||
static float ScoreImage(const QSize size) ;
|
||||
void SendBestImage();
|
||||
|
||||
static bool ProviderCompareOrder(CoverProvider *a, CoverProvider *b);
|
||||
|
@ -67,7 +67,7 @@ class AlbumCoverLoader : public QObject {
|
||||
|
||||
static QString AlbumCoverFilename(QString artist, QString album, const QString &extension);
|
||||
|
||||
QString CoverFilenameFromSource(const Song::Source source, const QUrl &cover_url, const QString &artist, const QString &album, const QString &album_id, const QString &extension);
|
||||
static QString CoverFilenameFromSource(const Song::Source source, const QUrl &cover_url, const QString &artist, const QString &album, const QString &album_id, const QString &extension);
|
||||
QString CoverFilenameFromVariable(const QString &artist, const QString &album, const QString &extension = QString());
|
||||
QString CoverFilePath(const Song &song, const QString &album_dir, const QUrl &cover_url, const QString &extension = QString());
|
||||
|
||||
|
@ -133,7 +133,7 @@ class AlbumCoverManager : public QMainWindow {
|
||||
Song GetFirstSelectedAsSong();
|
||||
|
||||
Song ItemAsSong(QListWidgetItem *item) { return ItemAsSong(static_cast<AlbumItem*>(item)); }
|
||||
Song ItemAsSong(AlbumItem *item);
|
||||
static Song ItemAsSong(AlbumItem *item);
|
||||
|
||||
void UpdateStatusText();
|
||||
bool ShouldHide(const AlbumItem &item, const QString &filter, HideCovers hide) const;
|
||||
|
@ -57,7 +57,7 @@ class LastFmCoverProvider : public JsonCoverProvider {
|
||||
};
|
||||
|
||||
QByteArray GetReplyData(QNetworkReply *reply);
|
||||
LastFmImageSize ImageSizeFromString(const QString &size);
|
||||
static LastFmImageSize ImageSizeFromString(const QString &size);
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
private:
|
||||
|
@ -79,7 +79,7 @@ class Udisks2Lister : public DeviceLister {
|
||||
private:
|
||||
bool isPendingJob(const QDBusObjectPath &job_path);
|
||||
void RemoveDevice(const QDBusObjectPath &device_path);
|
||||
QList<QDBusObjectPath> GetMountedPartitionsFromDBusArgument(const QDBusArgument &input);
|
||||
static QList<QDBusObjectPath> GetMountedPartitionsFromDBusArgument(const QDBusArgument &input);
|
||||
|
||||
struct Udisks2Job {
|
||||
Udisks2Job();
|
||||
@ -114,7 +114,7 @@ class Udisks2Lister : public DeviceLister {
|
||||
QStringList mount_paths;
|
||||
};
|
||||
|
||||
PartitionData ReadPartitionData(const QDBusObjectPath &path);
|
||||
static PartitionData ReadPartitionData(const QDBusObjectPath &path);
|
||||
void HandleFinishedMountJob(const Udisks2Lister::PartitionData &partition_data);
|
||||
void HandleFinishedUnmountJob(const Udisks2Lister::PartitionData &partition_data, const QDBusObjectPath &mounted_object);
|
||||
|
||||
|
@ -190,7 +190,7 @@ QString About::ContributorsHtml() const {
|
||||
|
||||
}
|
||||
|
||||
QString About::PersonToHtml(const Person &person) const {
|
||||
QString About::PersonToHtml(const Person &person) {
|
||||
|
||||
if (person.email.isNull())
|
||||
return person.name;
|
||||
|
@ -49,7 +49,7 @@ class About : public QDialog {
|
||||
|
||||
QString MainHtml() const;
|
||||
QString ContributorsHtml() const;
|
||||
QString PersonToHtml(const Person &person) const;
|
||||
static QString PersonToHtml(const Person &person) ;
|
||||
|
||||
private:
|
||||
Ui::About ui_;
|
||||
|
@ -379,7 +379,7 @@ bool EditTagDialog::SetLoading(const QString &message) {
|
||||
|
||||
}
|
||||
|
||||
QList<EditTagDialog::Data> EditTagDialog::LoadData(const SongList &songs) const {
|
||||
QList<EditTagDialog::Data> EditTagDialog::LoadData(const SongList &songs) {
|
||||
|
||||
QList<Data> ret;
|
||||
|
||||
@ -410,11 +410,7 @@ void EditTagDialog::SetSongs(const SongList &s, const PlaylistItemList &items) {
|
||||
collection_songs_.clear();
|
||||
|
||||
// Reload tags in the background
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(&EditTagDialog::LoadData, this, s);
|
||||
#else
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(this, &EditTagDialog::LoadData, s);
|
||||
#endif
|
||||
QFuture<QList<Data>> future = QtConcurrent::run(&EditTagDialog::LoadData, s);
|
||||
QFutureWatcher<QList<Data>> *watcher = new QFutureWatcher<QList<Data>>();
|
||||
QObject::connect(watcher, &QFutureWatcher<QList<Data>>::finished, this, &EditTagDialog::SetSongsFinished);
|
||||
watcher->setFuture(future);
|
||||
|
@ -160,7 +160,7 @@ class EditTagDialog : public QDialog {
|
||||
void UpdateSummaryTab(const Song &song, const UpdateCoverAction cover_action);
|
||||
void UpdateStatisticsTab(const Song &song);
|
||||
|
||||
QString GetArtSummary(const Song &song, const UpdateCoverAction cover_action);
|
||||
static QString GetArtSummary(const Song &song, const UpdateCoverAction cover_action);
|
||||
|
||||
void UpdateUI(const QModelIndexList &indexes);
|
||||
|
||||
@ -168,7 +168,7 @@ class EditTagDialog : public QDialog {
|
||||
void SetSongListVisibility(bool visible);
|
||||
|
||||
// Called by QtConcurrentRun
|
||||
QList<Data> LoadData(const SongList &songs) const;
|
||||
static QList<Data> LoadData(const SongList &songs);
|
||||
void SaveData();
|
||||
|
||||
static void SetText(QLabel *label, const int value, const QString &suffix, const QString &def = QString());
|
||||
|
@ -228,7 +228,7 @@ void TrackSelectionDialog::AddDivider(const QString &text, QTreeWidget *parent)
|
||||
|
||||
}
|
||||
|
||||
void TrackSelectionDialog::AddSong(const Song &song, int result_index, QTreeWidget *parent) const {
|
||||
void TrackSelectionDialog::AddSong(const Song &song, int result_index, QTreeWidget *parent) {
|
||||
|
||||
QStringList values;
|
||||
values << ((song.track() > 0) ? QString::number(song.track()) : QString()) << ((song.year() > 0) ? QString::number(song.year()) : QString()) << song.title() << song.artist() << song.album();
|
||||
|
@ -80,7 +80,7 @@ class TrackSelectionDialog : public QDialog {
|
||||
};
|
||||
|
||||
void AddDivider(const QString &text, QTreeWidget *parent) const;
|
||||
void AddSong(const Song &song, int result_index, QTreeWidget *parent) const;
|
||||
static void AddSong(const Song &song, int result_index, QTreeWidget *parent) ;
|
||||
|
||||
void SetLoading(const QString &message);
|
||||
static void SaveData(const QList<Data> &data);
|
||||
|
@ -47,7 +47,7 @@ class Chromaprinter {
|
||||
QString CreateFingerprint();
|
||||
|
||||
private:
|
||||
GstElement *CreateElement(const QString &factory_name, GstElement *bin = nullptr);
|
||||
static GstElement *CreateElement(const QString &factory_name, GstElement *bin = nullptr);
|
||||
|
||||
static void NewPadCallback(GstElement*, GstPad *pad, gpointer data);
|
||||
static GstFlowReturn NewBufferCallback(GstAppSink *app_sink, gpointer self);
|
||||
|
@ -41,7 +41,7 @@ class GstElementDeleter : public QObject {
|
||||
void DeleteElementLater(GstElement *element);
|
||||
|
||||
private slots:
|
||||
void DeleteElement(GstElement *element);
|
||||
static void DeleteElement(GstElement *element);
|
||||
};
|
||||
|
||||
#endif // GSTELEMENTDELETER_H
|
||||
|
@ -985,7 +985,7 @@ void GstEnginePipeline::TagMessageReceived(GstMessage *msg) {
|
||||
|
||||
}
|
||||
|
||||
QString GstEnginePipeline::ParseStrTag(GstTagList *list, const char *tag) const {
|
||||
QString GstEnginePipeline::ParseStrTag(GstTagList *list, const char *tag) {
|
||||
|
||||
gchar *data = nullptr;
|
||||
bool success = gst_tag_list_get_string(list, tag, &data);
|
||||
@ -999,7 +999,7 @@ QString GstEnginePipeline::ParseStrTag(GstTagList *list, const char *tag) const
|
||||
|
||||
}
|
||||
|
||||
guint GstEnginePipeline::ParseUIntTag(GstTagList *list, const char *tag) const {
|
||||
guint GstEnginePipeline::ParseUIntTag(GstTagList *list, const char *tag) {
|
||||
|
||||
guint data = 0;
|
||||
bool success = gst_tag_list_get_uint(list, tag, &data);
|
||||
|
@ -161,8 +161,8 @@ class GstEnginePipeline : public QObject {
|
||||
void StreamStatusMessageReceived(GstMessage*);
|
||||
void StreamStartMessageReceived();
|
||||
|
||||
QString ParseStrTag(GstTagList *list, const char *tag) const;
|
||||
guint ParseUIntTag(GstTagList *list, const char *tag) const;
|
||||
static QString ParseStrTag(GstTagList *list, const char *tag);
|
||||
static guint ParseUIntTag(GstTagList *list, const char *tag);
|
||||
|
||||
void UpdateVolume();
|
||||
void UpdateStereoBalance();
|
||||
|
@ -62,11 +62,7 @@ gpointer GstStartup::GLibMainLoopThreadFunc(gpointer) {
|
||||
|
||||
GstStartup::GstStartup(QObject *parent) : QObject(parent) {
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
initializing_ = QtConcurrent::run(&GstStartup::InitializeGStreamer, this);
|
||||
#else
|
||||
initializing_ = QtConcurrent::run(this, &GstStartup::InitializeGStreamer);
|
||||
#endif
|
||||
initializing_ = QtConcurrent::run(&GstStartup::InitializeGStreamer);
|
||||
|
||||
const QMetaObject *mo = QAbstractEventDispatcher::instance(qApp->thread())->metaObject();
|
||||
if (mo && strcmp(mo->className(), "QEventDispatcherGlib") != 0 && strcmp(mo->superClass()->className(), "QEventDispatcherGlib") != 0) {
|
||||
|
@ -42,8 +42,8 @@ class GstStartup : public QObject {
|
||||
static GThread *kGThread;
|
||||
static gpointer GLibMainLoopThreadFunc(gpointer);
|
||||
|
||||
void InitializeGStreamer();
|
||||
void SetEnvironment();
|
||||
static void InitializeGStreamer();
|
||||
static void SetEnvironment();
|
||||
|
||||
QFuture<void> initializing_;
|
||||
|
||||
|
@ -75,7 +75,7 @@ class VLCEngine : public Engine::Base {
|
||||
bool Initialized() const { return (instance_ && player_); }
|
||||
uint position() const;
|
||||
uint length() const;
|
||||
bool CanDecode(const QUrl &url);
|
||||
static bool CanDecode(const QUrl &url);
|
||||
void AttachCallback(libvlc_event_manager_t *em, libvlc_event_type_t type, libvlc_callback_t callback);
|
||||
static void StateChangedCallback(const libvlc_event_t *e, void *data);
|
||||
|
||||
|
@ -53,13 +53,13 @@ class GlobalShortcut : public QObject, QAbstractNativeEventFilter {
|
||||
|
||||
private:
|
||||
|
||||
void activateShortcut(quint32 native_key, quint32 native_mods);
|
||||
static void activateShortcut(quint32 native_key, quint32 native_mods);
|
||||
|
||||
quint32 nativeModifiers(Qt::KeyboardModifiers qt_mods);
|
||||
quint32 nativeKeycode(Qt::Key qt_keycode);
|
||||
static quint32 nativeModifiers(Qt::KeyboardModifiers qt_mods);
|
||||
static quint32 nativeKeycode(Qt::Key qt_keycode);
|
||||
|
||||
bool registerShortcut(quint32 native_key, quint32 native_mods);
|
||||
bool unregisterShortcut(quint32 native_key, quint32 native_mods);
|
||||
static bool registerShortcut(quint32 native_key, quint32 native_mods);
|
||||
static bool unregisterShortcut(quint32 native_key, quint32 native_mods);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool nativeEventFilter(const QByteArray &eventtype, void *message, qintptr *result) override;
|
||||
|
@ -179,7 +179,7 @@ bool GlobalShortcutsManager::IsMateAvailable() const {
|
||||
|
||||
}
|
||||
|
||||
bool GlobalShortcutsManager::IsX11Available() const {
|
||||
bool GlobalShortcutsManager::IsX11Available() {
|
||||
|
||||
return QApplication::platformName() == "xcb";
|
||||
|
||||
@ -212,7 +212,7 @@ void GlobalShortcutsManager::Unregister() {
|
||||
|
||||
}
|
||||
|
||||
bool GlobalShortcutsManager::IsMacAccessibilityEnabled() const {
|
||||
bool GlobalShortcutsManager::IsMacAccessibilityEnabled() {
|
||||
#ifdef Q_OS_MACOS
|
||||
if (system_backend_) return qobject_cast<GlobalShortcutsBackendMacOS*>(system_backend_)->IsAccessibilityEnabled();
|
||||
else return false;
|
||||
|
@ -52,10 +52,10 @@ class GlobalShortcutsManager : public QWidget {
|
||||
|
||||
QMap<QString, Shortcut> shortcuts() const { return shortcuts_; }
|
||||
bool IsKdeAvailable() const;
|
||||
bool IsX11Available() const;
|
||||
static bool IsX11Available() ;
|
||||
bool IsGnomeAvailable() const;
|
||||
bool IsMateAvailable() const;
|
||||
bool IsMacAccessibilityEnabled() const;
|
||||
static bool IsMacAccessibilityEnabled() ;
|
||||
|
||||
public slots:
|
||||
void ReloadSettings();
|
||||
|
@ -80,7 +80,7 @@ class MoodbarProxyStyle : public QProxyStyle {
|
||||
void DrawArrow(const QStyleOptionSlider *option, QPainter *painter) const;
|
||||
void ShowContextMenu(const QPoint pos);
|
||||
|
||||
QPixmap MoodbarPixmap(const ColorVector &colors, const QSize size, const QPalette &palette, const QStyleOptionSlider *opt);
|
||||
static QPixmap MoodbarPixmap(const ColorVector &colors, const QSize size, const QPalette &palette, const QStyleOptionSlider *opt);
|
||||
|
||||
private slots:
|
||||
void ReloadSettings();
|
||||
|
@ -189,7 +189,7 @@ class MusicBrainzClient : public QObject {
|
||||
ResultList results_;
|
||||
};
|
||||
|
||||
QByteArray GetReplyData(QNetworkReply *reply, QString &error);
|
||||
static QByteArray GetReplyData(QNetworkReply *reply, QString &error);
|
||||
static bool MediumHasDiscid(const QString &discid, QXmlStreamReader *reader);
|
||||
static ResultList ParseMedium(QXmlStreamReader *reader);
|
||||
static Result ParseTrackFromDisc(QXmlStreamReader *reader);
|
||||
@ -197,7 +197,7 @@ class MusicBrainzClient : public QObject {
|
||||
static void ParseArtist(QXmlStreamReader *reader, QString *artist);
|
||||
static Release ParseRelease(QXmlStreamReader *reader);
|
||||
static ResultList UniqueResults(const ResultList &results, UniqueResultsSortOption opt = SortResults);
|
||||
void Error(const QString &error, const QVariant &debug = QVariant());
|
||||
static void Error(const QString &error, const QVariant &debug = QVariant());
|
||||
|
||||
private:
|
||||
|
||||
|
@ -390,11 +390,7 @@ bool OrganizeDialog::SetUrls(const QList<QUrl> &urls) {
|
||||
|
||||
bool OrganizeDialog::SetFilenames(const QStringList &filenames) {
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
songs_future_ = QtConcurrent::run(&OrganizeDialog::LoadSongsBlocking, this, filenames);
|
||||
#else
|
||||
songs_future_ = QtConcurrent::run(this, &OrganizeDialog::LoadSongsBlocking, filenames);
|
||||
#endif
|
||||
songs_future_ = QtConcurrent::run(&OrganizeDialog::LoadSongsBlocking, filenames);
|
||||
QFutureWatcher<SongList> *watcher = new QFutureWatcher<SongList>();
|
||||
QObject::connect(watcher, &QFutureWatcher<SongList>::finished, this, [this, watcher]() {
|
||||
SetSongs(watcher->result());
|
||||
|
@ -83,7 +83,7 @@ class OrganizeDialog : public QDialog {
|
||||
void LoadSettings();
|
||||
void AdjustSize();
|
||||
|
||||
SongList LoadSongsBlocking(const QStringList &filenames);
|
||||
static SongList LoadSongsBlocking(const QStringList &filenames);
|
||||
void SetLoadingSongs(const bool loading);
|
||||
|
||||
signals:
|
||||
|
@ -529,7 +529,7 @@ void OSDPretty::mouseReleaseEvent(QMouseEvent *) {
|
||||
|
||||
}
|
||||
|
||||
QScreen *OSDPretty::current_screen(const QPoint pos) const {
|
||||
QScreen *OSDPretty::current_screen(const QPoint pos) {
|
||||
|
||||
QScreen *screen(nullptr);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
|
@ -97,7 +97,7 @@ class OSDPretty : public QWidget {
|
||||
// When the user has been moving the popup, use these to get its current position and screen.
|
||||
// Note that these return invalid values if the popup is hidden.
|
||||
QScreen *current_screen() const;
|
||||
QScreen *current_screen(const QPoint pos) const;
|
||||
static QScreen *current_screen(const QPoint pos);
|
||||
QPoint current_pos() const;
|
||||
|
||||
// QWidget
|
||||
|
@ -104,7 +104,7 @@ void QueuedItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
|
||||
}
|
||||
|
||||
void QueuedItemDelegate::DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &text, int width, const float opacity) const {
|
||||
void QueuedItemDelegate::DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &text, int width, const float opacity) {
|
||||
|
||||
QFont smaller = font;
|
||||
smaller.setPointSize(smaller.pointSize() - 1);
|
||||
|
@ -62,7 +62,7 @@ class QueuedItemDelegate : public QStyledItemDelegate {
|
||||
explicit QueuedItemDelegate(QObject *parent, int indicator_column = Playlist::Column_Title);
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
|
||||
void DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &idx, int width = -1, const float opacity = 1.0) const;
|
||||
static void DrawBox(QPainter *painter, const QRect line_rect, const QFont &font, const QString &text, int width = -1, const float opacity = 1.0) ;
|
||||
|
||||
int queue_indicator_size(const QModelIndex &idx) const;
|
||||
|
||||
|
@ -530,7 +530,7 @@ FilterTree *FilterParser::createSearchTermTreeNode(const QString &col, const QSt
|
||||
// "225" is parsed to "225" (srsly! ^.^)
|
||||
// "2:3:4:5" is parsed to "2:3:4:5"
|
||||
// "25m" is parsed to "25m"
|
||||
int FilterParser::parseTime(const QString &time_str) const {
|
||||
int FilterParser::parseTime(const QString &time_str) {
|
||||
|
||||
int seconds = 0;
|
||||
int accum = 0;
|
||||
|
@ -88,7 +88,7 @@ class FilterParser {
|
||||
FilterTree *parseSearchTerm();
|
||||
|
||||
FilterTree *createSearchTermTreeNode(const QString &col, const QString &prefix, const QString &search) const;
|
||||
int parseTime(const QString &time_str) const;
|
||||
static int parseTime(const QString &time_str) ;
|
||||
|
||||
QString::const_iterator iter_;
|
||||
QString::const_iterator end_;
|
||||
|
@ -56,7 +56,7 @@ bool PlaylistListModel::dropMimeData(const QMimeData *data, Qt::DropAction actio
|
||||
|
||||
}
|
||||
|
||||
QString PlaylistListModel::ItemPath(const QStandardItem *item) const {
|
||||
QString PlaylistListModel::ItemPath(const QStandardItem *item) {
|
||||
|
||||
QStringList components;
|
||||
|
||||
|
@ -60,7 +60,7 @@ class PlaylistListModel : public QStandardItemModel {
|
||||
|
||||
// Walks from the given item to the root, returning the / separated path of
|
||||
// all the parent folders. The path includes this item if it is a folder.
|
||||
QString ItemPath(const QStandardItem *item) const;
|
||||
static QString ItemPath(const QStandardItem *item) ;
|
||||
|
||||
// Finds the playlist with the given ID, returns 0 if it doesn't exist.
|
||||
QStandardItem *PlaylistById(const int id) const;
|
||||
|
@ -267,7 +267,7 @@ SongList CueParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
// This and the kFileLineRegExp do most of the "dirty" work, namely: splitting the raw .cue
|
||||
// line into logical parts and getting rid of all the unnecessary whitespaces and quoting.
|
||||
QStringList CueParser::SplitCueLine(const QString &line) const {
|
||||
QStringList CueParser::SplitCueLine(const QString &line) {
|
||||
|
||||
QRegularExpression line_regexp(kFileLineRegExp);
|
||||
QRegularExpressionMatch re_match = line_regexp.match(line.trimmed());
|
||||
@ -281,7 +281,7 @@ QStringList CueParser::SplitCueLine(const QString &line) const {
|
||||
}
|
||||
|
||||
// Updates the song with data from the .cue entry. This one mustn't be used for the last song in the .cue file.
|
||||
bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) const {
|
||||
bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) {
|
||||
|
||||
qint64 beginning = IndexToMarker(entry.index);
|
||||
qint64 end = IndexToMarker(next_index);
|
||||
@ -307,7 +307,7 @@ bool CueParser::UpdateSong(const CueEntry &entry, const QString &next_index, Son
|
||||
}
|
||||
|
||||
// Updates the song with data from the .cue entry. This one must be used only for the last song in the .cue file.
|
||||
bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const {
|
||||
bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) {
|
||||
|
||||
qint64 beginning = IndexToMarker(entry.index);
|
||||
|
||||
@ -338,7 +338,7 @@ bool CueParser::UpdateLastSong(const CueEntry &entry, Song *song) const {
|
||||
|
||||
}
|
||||
|
||||
qint64 CueParser::IndexToMarker(const QString &index) const {
|
||||
qint64 CueParser::IndexToMarker(const QString &index) {
|
||||
|
||||
QRegularExpression index_regexp(kIndexRegExp);
|
||||
QRegularExpressionMatch re_match = index_regexp.match(index);
|
||||
|
@ -96,11 +96,11 @@ class CueParser : public ParserBase {
|
||||
file(_file), index(_index), title(_title), artist(_artist), album_artist(_album_artist), album(_album), composer(_composer), album_composer(_album_composer), genre(_genre), date(_date), disc(_disc) {}
|
||||
};
|
||||
|
||||
bool UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) const;
|
||||
bool UpdateLastSong(const CueEntry &entry, Song *song) const;
|
||||
static bool UpdateSong(const CueEntry &entry, const QString &next_index, Song *song) ;
|
||||
static bool UpdateLastSong(const CueEntry &entry, Song *song) ;
|
||||
|
||||
QStringList SplitCueLine(const QString &line) const;
|
||||
qint64 IndexToMarker(const QString &index) const;
|
||||
static QStringList SplitCueLine(const QString &line);
|
||||
static qint64 IndexToMarker(const QString &index);
|
||||
};
|
||||
|
||||
#endif // CUEPARSER_H
|
||||
|
@ -99,7 +99,7 @@ SongList M3UParser::Load(QIODevice *device, const QString &playlist_path, const
|
||||
|
||||
}
|
||||
|
||||
bool M3UParser::ParseMetadata(const QString &line, M3UParser::Metadata *metadata) const {
|
||||
bool M3UParser::ParseMetadata(const QString &line, M3UParser::Metadata *metadata) {
|
||||
|
||||
// Extended info, eg.
|
||||
// #EXTINF:123,Sample Artist - Sample title
|
||||
|
@ -66,7 +66,7 @@ class M3UParser : public ParserBase {
|
||||
qint64 length;
|
||||
};
|
||||
|
||||
bool ParseMetadata(const QString &line, Metadata *metadata) const;
|
||||
static bool ParseMetadata(const QString &line, Metadata *metadata) ;
|
||||
|
||||
};
|
||||
|
||||
|
@ -100,7 +100,7 @@ Song ParserBase::LoadSong(const QString &filename_or_url, const qint64 beginning
|
||||
|
||||
}
|
||||
|
||||
QString ParserBase::URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) const {
|
||||
QString ParserBase::URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) {
|
||||
|
||||
if (!url.isLocalFile()) return url.toString();
|
||||
|
||||
|
@ -67,7 +67,7 @@ class ParserBase : public QObject {
|
||||
|
||||
// If the URL is a file:// URL then returns its path, absolute or relative to the directory depending on the path_type option.
|
||||
// Otherwise returns the URL as is. This function should always be used when saving a playlist.
|
||||
QString URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) const;
|
||||
static QString URLOrFilename(const QUrl &url, const QDir &dir, Playlist::Path path_type) ;
|
||||
|
||||
private:
|
||||
CollectionBackendInterface *collection_;
|
||||
|
@ -100,7 +100,7 @@ QString PlaylistParser::filters() const {
|
||||
|
||||
}
|
||||
|
||||
QString PlaylistParser::FilterForParser(const ParserBase *parser, QStringList *all_extensions) const {
|
||||
QString PlaylistParser::FilterForParser(const ParserBase *parser, QStringList *all_extensions) {
|
||||
|
||||
const QStringList file_extensions = parser->file_extensions();
|
||||
QStringList extensions;
|
||||
|
@ -61,7 +61,7 @@ class PlaylistParser : public QObject {
|
||||
void Save(const SongList &songs, const QString &filename, const Playlist::Path) const;
|
||||
|
||||
private:
|
||||
QString FilterForParser(const ParserBase *parser, QStringList *all_extensions = nullptr) const;
|
||||
static QString FilterForParser(const ParserBase *parser, QStringList *all_extensions = nullptr) ;
|
||||
|
||||
private:
|
||||
QList<ParserBase*> parsers_;
|
||||
|
@ -121,7 +121,7 @@ void WplParser::Save(const SongList &songs, QIODevice *device, const QDir &dir,
|
||||
}
|
||||
}
|
||||
|
||||
void WplParser::WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) const {
|
||||
void WplParser::WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) {
|
||||
|
||||
writer->writeStartElement("meta");
|
||||
writer->writeAttribute("name", name);
|
||||
|
@ -55,7 +55,7 @@ class WplParser : public XMLParser {
|
||||
|
||||
private:
|
||||
void ParseSeq(const QDir &dir, QXmlStreamReader *reader, SongList *songs, const bool collection_search = true) const;
|
||||
void WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) const;
|
||||
static void WriteMeta(const QString &name, const QString &content, QXmlStreamWriter *writer) ;
|
||||
};
|
||||
|
||||
#endif // WPLPARSER_H
|
||||
|
@ -71,7 +71,7 @@ class QobuzBaseRequest : public QObject {
|
||||
QJsonValue ExtractItems(QJsonObject &json_obj);
|
||||
|
||||
virtual void Error(const QString &error, const QVariant &debug = QVariant()) = 0;
|
||||
QString ErrorsToHTML(const QStringList &errors);
|
||||
static QString ErrorsToHTML(const QStringList &errors);
|
||||
|
||||
QString api_url() { return QString(kApiUrl); }
|
||||
QString app_id() { return service_->app_id(); }
|
||||
|
@ -69,7 +69,7 @@ class QobuzFavoriteRequest : public QobuzBaseRequest {
|
||||
|
||||
private:
|
||||
void Error(const QString &error, const QVariant &debug = QVariant());
|
||||
QString FavoriteText(const FavoriteType type);
|
||||
static QString FavoriteText(const FavoriteType type);
|
||||
void AddFavorites(const FavoriteType type, const SongList &songs);
|
||||
void RemoveFavorites(const FavoriteType type, const SongList &songs);
|
||||
|
||||
|
@ -139,7 +139,7 @@ class QobuzRequest : public QobuzBaseRequest {
|
||||
void AlbumCoverFinishCheck();
|
||||
|
||||
void FinishCheck();
|
||||
void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
static void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
static const int kMaxConcurrentArtistsRequests;
|
||||
|
@ -115,7 +115,7 @@ class AppearanceSettingsPage : public SettingsPage {
|
||||
|
||||
private:
|
||||
// Set the widget's background to new_color
|
||||
void UpdateColorSelectorColor(QWidget *color_selector, const QColor &new_color);
|
||||
static void UpdateColorSelectorColor(QWidget *color_selector, const QColor &new_color);
|
||||
// Init (or refresh) the colorSelectors colors
|
||||
void InitColorSelectorsColors();
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
private slots:
|
||||
void InsertVariableFirstLine(QAction *action);
|
||||
void InsertVariableSecondLine(QAction *action);
|
||||
void ShowMenuTooltip(QAction *action);
|
||||
static void ShowMenuTooltip(QAction *action);
|
||||
void HeadlineFontChanged();
|
||||
void NormalFontChanged();
|
||||
|
||||
|
@ -67,8 +67,8 @@ class SettingsPage : public QWidget {
|
||||
|
||||
void set_changed() { changed_ = true; }
|
||||
|
||||
void ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const QString &default_value);
|
||||
void ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const int default_value);
|
||||
static void ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const QString &default_value);
|
||||
static void ComboBoxLoadFromSettings(const QSettings &s, QComboBox *combobox, const QString &setting, const int default_value);
|
||||
|
||||
private:
|
||||
virtual void Save() = 0;
|
||||
|
@ -243,7 +243,7 @@ void SmartPlaylistsModel::DeleteGenerator(const QModelIndex &idx) {
|
||||
|
||||
}
|
||||
|
||||
void SmartPlaylistsModel::SaveGenerator(QSettings *s, const int i, PlaylistGeneratorPtr generator) const {
|
||||
void SmartPlaylistsModel::SaveGenerator(QSettings *s, const int i, PlaylistGeneratorPtr generator) {
|
||||
|
||||
s->setArrayIndex(i);
|
||||
s->setValue("name", generator->name());
|
||||
|
@ -80,7 +80,7 @@ class SmartPlaylistsModel : public SimpleTreeModel<SmartPlaylistsItem> {
|
||||
static const char *kSmartPlaylistsMimeType;
|
||||
static const int kSmartPlaylistsVersion;
|
||||
|
||||
void SaveGenerator(QSettings *s, const int i, PlaylistGeneratorPtr generator) const;
|
||||
static void SaveGenerator(QSettings *s, const int i, PlaylistGeneratorPtr generator);
|
||||
void ItemFromSmartPlaylist(const QSettings &s, const bool notify);
|
||||
|
||||
private:
|
||||
|
@ -59,7 +59,7 @@ class SubsonicBaseRequest : public QObject {
|
||||
QJsonObject ExtractJsonObj(QByteArray &data);
|
||||
|
||||
virtual void Error(const QString &error, const QVariant &debug = QVariant()) = 0;
|
||||
QString ErrorsToHTML(const QStringList &errors);
|
||||
static QString ErrorsToHTML(const QStringList &errors);
|
||||
|
||||
QString client_name() const { return service_->client_name(); }
|
||||
QString api_version() const { return service_->api_version(); }
|
||||
|
@ -108,7 +108,7 @@ class SubsonicRequest : public SubsonicBaseRequest {
|
||||
void AlbumCoverFinishCheck();
|
||||
|
||||
void FinishCheck();
|
||||
void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
static void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
static const int kMaxConcurrentAlbumsRequests;
|
||||
|
@ -69,7 +69,7 @@ class TidalBaseRequest : public QObject {
|
||||
QJsonValue ExtractItems(const QJsonObject &json_obj);
|
||||
|
||||
virtual void Error(const QString &error, const QVariant &debug = QVariant()) = 0;
|
||||
QString ErrorsToHTML(const QStringList &errors);
|
||||
static QString ErrorsToHTML(const QStringList &errors);
|
||||
|
||||
QString api_url() { return QString(kApiUrl); }
|
||||
bool oauth() { return service_->oauth(); }
|
||||
|
@ -74,7 +74,7 @@ class TidalFavoriteRequest : public TidalBaseRequest {
|
||||
|
||||
private:
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
QString FavoriteText(const FavoriteType type);
|
||||
static QString FavoriteText(const FavoriteType type);
|
||||
void AddFavorites(const FavoriteType type, const SongList &songs);
|
||||
void RemoveFavorites(const FavoriteType type, const SongList &songs);
|
||||
void RemoveFavorites(const FavoriteType type, const QString &id, const SongList &songs);
|
||||
|
@ -143,7 +143,7 @@ class TidalRequest : public TidalBaseRequest {
|
||||
void AlbumCoverFinishCheck();
|
||||
|
||||
void FinishCheck();
|
||||
void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
static void Warn(const QString &error, const QVariant &debug = QVariant());
|
||||
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
||||
|
||||
static const char *kResourcesUrl;
|
||||
|
@ -446,7 +446,7 @@ void TranscodeDialog::AddDestination() {
|
||||
}
|
||||
|
||||
// Returns the rightmost non-empty part of 'path'.
|
||||
QString TranscodeDialog::TrimPath(const QString &path) const {
|
||||
QString TranscodeDialog::TrimPath(const QString &path) {
|
||||
return path.section('/', -1, -1, QString::SectionSkipEmpty);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class TranscodeDialog : public QDialog {
|
||||
void SetWorking(bool working);
|
||||
void UpdateStatusText();
|
||||
void UpdateProgress();
|
||||
QString TrimPath(const QString &path) const;
|
||||
static QString TrimPath(const QString &path) ;
|
||||
QString GetOutputFileName(const QString &input, const TranscoderPreset &preset) const;
|
||||
|
||||
private slots:
|
||||
|
@ -64,7 +64,7 @@ class Transcoder : public QObject {
|
||||
int max_threads() const { return max_threads_; }
|
||||
void set_max_threads(int count) { max_threads_ = count; }
|
||||
|
||||
QString GetFile(const QString &input, const TranscoderPreset &preset, const QString &output = QString());
|
||||
static QString GetFile(const QString &input, const TranscoderPreset &preset, const QString &output = QString());
|
||||
void AddJob(const QString &input, const TranscoderPreset &preset, const QString &output);
|
||||
|
||||
QMap<QString, float> GetProgress() const;
|
||||
|
@ -231,7 +231,7 @@ void FreeSpaceBar::DrawText(QPainter *p, const QRect r) {
|
||||
|
||||
}
|
||||
|
||||
QString FreeSpaceBar::TextForSize(const QString &prefix, const qint64 size) const {
|
||||
QString FreeSpaceBar::TextForSize(const QString &prefix, const qint64 size) {
|
||||
|
||||
QString ret;
|
||||
if (size > 0) {
|
||||
|
@ -77,7 +77,7 @@ class FreeSpaceBar : public QWidget {
|
||||
QColor color;
|
||||
};
|
||||
|
||||
QString TextForSize(const QString &prefix, const qint64 size) const;
|
||||
static QString TextForSize(const QString &prefix, const qint64 size);
|
||||
|
||||
void DrawBar(QPainter *p, const QRect r);
|
||||
void DrawText(QPainter *p, const QRect r);
|
||||
|
@ -80,7 +80,7 @@ class TrackSlider : public QWidget {
|
||||
private:
|
||||
void UpdateTimes(const int elapsed);
|
||||
void UpdateLabelWidth();
|
||||
void UpdateLabelWidth(QLabel *label, const QString &text);
|
||||
static void UpdateLabelWidth(QLabel *label, const QString &text);
|
||||
|
||||
private:
|
||||
Ui_TrackSlider *ui_;
|
||||
|
@ -49,7 +49,7 @@ class CollectionBackendTest : public ::testing::Test {
|
||||
backend_->Init(database_.get(), Song::Source_Collection, SCollection::kSongsTable, SCollection::kDirsTable, SCollection::kSubdirsTable, SCollection::kFtsTable);
|
||||
}
|
||||
|
||||
Song MakeDummySong(int directory_id) {
|
||||
static Song MakeDummySong(int directory_id) {
|
||||
// Returns a valid song with all the required fields set
|
||||
Song ret;
|
||||
ret.set_directory_id(directory_id);
|
||||
|
@ -154,7 +154,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidFunction3Start) {
|
||||
|
||||
class A {
|
||||
public:
|
||||
void f(int* i) {
|
||||
static void f(int* i) {
|
||||
*i = *i + 1;
|
||||
}
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ class TestObjectDecorators : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initStyleOption(QProgressBar *self, QStyleOptionProgressBar *opt);
|
||||
static void initStyleOption(QProgressBar *self, QStyleOptionProgressBar *opt);
|
||||
};
|
||||
|
||||
#endif // TESTOBJECTDECORATORS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user