Make static
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user