Add explicit

This commit is contained in:
Jonas Kvinge 2020-04-07 16:49:15 +02:00
parent 3efc496c41
commit 21b2193cd0
199 changed files with 337 additions and 342 deletions

View File

@ -43,7 +43,7 @@ class SCollection : public QObject {
Q_OBJECT Q_OBJECT
public: public:
SCollection(Application *app, QObject *parent); explicit SCollection(Application *app, QObject *parent);
~SCollection(); ~SCollection();
static const char *kSongsTable; static const char *kSongsTable;

View File

@ -45,7 +45,7 @@ class CollectionBackendInterface : public QObject {
Q_OBJECT Q_OBJECT
public: public:
CollectionBackendInterface(QObject *parent = nullptr) : QObject(parent) {} explicit CollectionBackendInterface(QObject *parent = nullptr) : QObject(parent) {}
virtual ~CollectionBackendInterface() {} virtual ~CollectionBackendInterface() {}
struct Album { struct Album {

View File

@ -42,7 +42,7 @@ class CollectionDirectoryModel : public QStandardItemModel {
Q_OBJECT Q_OBJECT
public: public:
CollectionDirectoryModel(CollectionBackend* backend, QObject *parent = nullptr); explicit CollectionDirectoryModel(CollectionBackend* backend, QObject *parent = nullptr);
~CollectionDirectoryModel(); ~CollectionDirectoryModel();
// To be called by GUIs // To be called by GUIs

View File

@ -48,7 +48,7 @@ class CollectionFilterWidget : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
CollectionFilterWidget(QWidget *parent = nullptr); explicit CollectionFilterWidget(QWidget *parent = nullptr);
~CollectionFilterWidget(); ~CollectionFilterWidget();
static const int kFilterDelay = 500; // msec static const int kFilterDelay = 500; // msec

View File

@ -37,12 +37,12 @@ class CollectionItem : public SimpleTreeItem<CollectionItem> {
Type_LoadingIndicator, Type_LoadingIndicator,
}; };
CollectionItem(SimpleTreeModel<CollectionItem> *model) explicit CollectionItem(SimpleTreeModel<CollectionItem> *model)
: SimpleTreeItem<CollectionItem>(Type_Root, model), : SimpleTreeItem<CollectionItem>(Type_Root, model),
container_level(-1), container_level(-1),
compilation_artist_node_(nullptr) {} compilation_artist_node_(nullptr) {}
CollectionItem(Type type, CollectionItem *parent = nullptr) explicit CollectionItem(Type type, CollectionItem *parent = nullptr)
: SimpleTreeItem<CollectionItem>(type, parent), : SimpleTreeItem<CollectionItem>(type, parent),
container_level(-1), container_level(-1),
compilation_artist_node_(nullptr) {} compilation_artist_node_(nullptr) {}

View File

@ -36,7 +36,7 @@ class CollectionItemDelegate : public QStyledItemDelegate {
Q_OBJECT Q_OBJECT
public: public:
CollectionItemDelegate(QObject *parent); explicit CollectionItemDelegate(QObject *parent);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
public slots: public slots:

View File

@ -62,7 +62,7 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
Q_ENUMS(GroupBy) Q_ENUMS(GroupBy)
public: public:
CollectionModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr); explicit CollectionModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr);
~CollectionModel(); ~CollectionModel();
static const char *kSavedGroupingsSettingsGroup; static const char *kSavedGroupingsSettingsGroup;

View File

@ -33,8 +33,8 @@ class SqlRow;
class CollectionPlaylistItem : public PlaylistItem { class CollectionPlaylistItem : public PlaylistItem {
public: public:
CollectionPlaylistItem(); explicit CollectionPlaylistItem();
CollectionPlaylistItem(const Song &song); explicit CollectionPlaylistItem(const Song &song);
bool InitFromQuery(const SqlRow &query); bool InitFromQuery(const SqlRow &query);
void Reload(); void Reload();

View File

@ -72,7 +72,7 @@ struct QueryOptions {
class CollectionQuery { class CollectionQuery {
public: public:
CollectionQuery(const QueryOptions &options = QueryOptions()); explicit CollectionQuery(const QueryOptions &options = QueryOptions());
// Sets contents of SELECT clause on the query (list of columns to get). // Sets contents of SELECT clause on the query (list of columns to get).
void SetColumnSpec(const QString &spec) { column_spec_ = spec; } void SetColumnSpec(const QString &spec) { column_spec_ = spec; }

View File

@ -53,7 +53,7 @@ class CollectionView : public AutoExpandingTreeView {
Q_OBJECT Q_OBJECT
public: public:
CollectionView(QWidget *parent = nullptr); explicit CollectionView(QWidget *parent = nullptr);
~CollectionView(); ~CollectionView();
// Returns Songs currently selected in the collection view. // Returns Songs currently selected in the collection view.

View File

@ -34,7 +34,7 @@ class CollectionViewContainer : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
CollectionViewContainer(QWidget *parent = nullptr); explicit CollectionViewContainer(QWidget *parent = nullptr);
~CollectionViewContainer(); ~CollectionViewContainer();
CollectionFilterWidget *filter() const; CollectionFilterWidget *filter() const;

View File

@ -48,7 +48,7 @@ class CollectionWatcher : public QObject {
Q_OBJECT Q_OBJECT
public: public:
CollectionWatcher(Song::Source source, QObject *parent = nullptr); explicit CollectionWatcher(Song::Source source, QObject *parent = nullptr);
void set_backend(CollectionBackend *backend) { backend_ = backend; } void set_backend(CollectionBackend *backend) { backend_ = backend; }
void set_task_manager(TaskManager *task_manager) { task_manager_ = task_manager; } void set_task_manager(TaskManager *task_manager) { task_manager_ = task_manager; }

View File

@ -40,7 +40,7 @@ class GroupByDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
GroupByDialog(QWidget *parent = nullptr); explicit GroupByDialog(QWidget *parent = nullptr);
~GroupByDialog(); ~GroupByDialog();
public slots: public slots:

View File

@ -39,7 +39,7 @@ class SavedGroupingManager : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
SavedGroupingManager(QWidget *parent = nullptr); explicit SavedGroupingManager(QWidget *parent = nullptr);
~SavedGroupingManager(); ~SavedGroupingManager();
void UpdateModel(); void UpdateModel();

View File

@ -44,7 +44,7 @@ class ContextAlbum : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
ContextAlbum(QWidget *parent = nullptr); explicit ContextAlbum(QWidget *parent = nullptr);
void Init(AlbumCoverChoiceController *album_cover_choice_controller); void Init(AlbumCoverChoiceController *album_cover_choice_controller);
void SetImage(QImage image = QImage()); void SetImage(QImage image = QImage());

View File

@ -56,7 +56,7 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
Q_OBJECT Q_OBJECT
public: public:
ContextAlbumsModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr); explicit ContextAlbumsModel(CollectionBackend *backend, Application *app, QObject *parent = nullptr);
~ContextAlbumsModel(); ~ContextAlbumsModel();
static const int kPrettyCoverSize; static const int kPrettyCoverSize;

View File

@ -54,7 +54,7 @@ class ContextItemDelegate : public QStyledItemDelegate {
Q_OBJECT Q_OBJECT
public: public:
ContextItemDelegate(QObject *parent); explicit ContextItemDelegate(QObject *parent);
public slots: public slots:
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index); bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);

View File

@ -54,7 +54,7 @@ class ContextView : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
ContextView(QWidget *parent = nullptr); explicit ContextView(QWidget *parent = nullptr);
void Init(Application *app, CollectionView *collectionview, AlbumCoverChoiceController *album_cover_choice_controller); void Init(Application *app, CollectionView *collectionview, AlbumCoverChoiceController *album_cover_choice_controller);

View File

@ -42,7 +42,7 @@ class Database : public QObject {
Q_OBJECT Q_OBJECT
public: public:
Database(Application *app, QObject *parent = nullptr, const QString &database_name = QString()); explicit Database(Application *app, QObject *parent = nullptr, const QString &database_name = QString());
~Database(); ~Database();
struct AttachedDatabase { struct AttachedDatabase {

View File

@ -30,7 +30,7 @@
class DBusScreensaver : public Screensaver { class DBusScreensaver : public Screensaver {
public: public:
DBusScreensaver(const QString &service, const QString &path, const QString &interface); explicit DBusScreensaver(const QString &service, const QString &path, const QString &interface);
void Inhibit(); void Inhibit();
void Uninhibit(); void Uninhibit();

View File

@ -38,7 +38,7 @@ class DeleteFiles : public QObject {
Q_OBJECT Q_OBJECT
public: public:
DeleteFiles(TaskManager *task_manager, std::shared_ptr<MusicStorage> storage); explicit DeleteFiles(TaskManager *task_manager, std::shared_ptr<MusicStorage> storage);
~DeleteFiles(); ~DeleteFiles();
static const int kBatchSize; static const int kBatchSize;

View File

@ -28,7 +28,7 @@ class IconLoader {
static void Init(); static void Init();
static QIcon Load(const QString &name, const int size = 0); static QIcon Load(const QString &name, const int size = 0);
private: private:
IconLoader() {} explicit IconLoader() {}
static bool system_icons_; static bool system_icons_;
static bool custom_icons_; static bool custom_icons_;
}; };

View File

@ -25,7 +25,7 @@
namespace IconMapper { namespace IconMapper {
struct IconProperties { struct IconProperties {
IconProperties() : min_size(0), max_size(0) {} explicit IconProperties() : min_size(0), max_size(0) {}
IconProperties(const QStringList &_names, const int _min_size, const int _max_size) : names(_names), min_size(_min_size), max_size(_max_size) {} IconProperties(const QStringList &_names, const int _min_size, const int _max_size) : names(_names), min_size(_min_size), max_size(_max_size) {}
QStringList names; QStringList names;
int min_size; int min_size;

View File

@ -29,7 +29,7 @@
class MacScreensaver : public Screensaver { class MacScreensaver : public Screensaver {
public: public:
MacScreensaver(); explicit MacScreensaver();
void Inhibit(); void Inhibit();
void Uninhibit(); void Uninhibit();

View File

@ -38,7 +38,7 @@ class MacSystemTrayIcon : public SystemTrayIcon {
Q_OBJECT Q_OBJECT
public: public:
MacSystemTrayIcon(QObject *parent = nullptr); explicit MacSystemTrayIcon(QObject *parent = nullptr);
~MacSystemTrayIcon(); ~MacSystemTrayIcon();
void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit); void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit);

View File

@ -100,7 +100,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
Q_OBJECT Q_OBJECT
public: public:
MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, const CommandlineOptions& options, QWidget *parent = nullptr); explicit MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, const CommandlineOptions& options, QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
static const char *kSettingsGroup; static const char *kSettingsGroup;

View File

@ -78,7 +78,7 @@ class Mpris2 : public QObject {
Q_OBJECT Q_OBJECT
public: public:
Mpris2(Application *app, QObject *parent = nullptr); explicit Mpris2(Application *app, QObject *parent = nullptr);
// org.mpris.MediaPlayer2 MPRIS 2.0 Root interface // org.mpris.MediaPlayer2 MPRIS 2.0 Root interface
Q_PROPERTY(bool CanQuit READ CanQuit) Q_PROPERTY(bool CanQuit READ CanQuit)

View File

@ -32,7 +32,7 @@ class QObject;
class MultiSortFilterProxy : public QSortFilterProxyModel { class MultiSortFilterProxy : public QSortFilterProxyModel {
public: public:
MultiSortFilterProxy(QObject *parent = nullptr); explicit MultiSortFilterProxy(QObject *parent = nullptr);
void AddSortSpec(int role, Qt::SortOrder order = Qt::AscendingOrder); void AddSortSpec(int role, Qt::SortOrder order = Qt::AscendingOrder);

View File

@ -36,7 +36,7 @@
class MusicStorage { class MusicStorage {
public: public:
MusicStorage(); explicit MusicStorage();
virtual ~MusicStorage() {} virtual ~MusicStorage() {}
enum Role { enum Role {

View File

@ -44,7 +44,7 @@ class NetworkProxyFactory : public QNetworkProxyFactory {
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query); QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query);
private: private:
NetworkProxyFactory(); explicit NetworkProxyFactory();
static NetworkProxyFactory *sInstance; static NetworkProxyFactory *sInstance;

View File

@ -31,7 +31,7 @@ class QSqlDatabase;
// Rolls back the transaction if the object goes out of scope before Commit() is called. // Rolls back the transaction if the object goes out of scope before Commit() is called.
class ScopedTransaction : boost::noncopyable { class ScopedTransaction : boost::noncopyable {
public: public:
ScopedTransaction(QSqlDatabase *db); explicit ScopedTransaction(QSqlDatabase *db);
~ScopedTransaction(); ~ScopedTransaction();
void Commit(); void Commit();

View File

@ -29,7 +29,7 @@
class SettingsProvider { class SettingsProvider {
public: public:
SettingsProvider(); explicit SettingsProvider();
virtual ~SettingsProvider() {} virtual ~SettingsProvider() {}
virtual void set_group(const char *group) = 0; virtual void set_group(const char *group) = 0;

View File

@ -32,8 +32,8 @@
template <typename T> template <typename T>
class SimpleTreeItem { class SimpleTreeItem {
public: public:
SimpleTreeItem(int _type, SimpleTreeModel<T>* _model); // For the root item explicit SimpleTreeItem(int _type, SimpleTreeModel<T>* _model); // For the root item
SimpleTreeItem(int _type, const QString& _key, T* _parent = nullptr); explicit SimpleTreeItem(int _type, const QString& _key, T* _parent = nullptr);
explicit SimpleTreeItem(int _type, T* _parent = nullptr); explicit SimpleTreeItem(int _type, T* _parent = nullptr);
virtual ~SimpleTreeItem(); virtual ~SimpleTreeItem();

View File

@ -156,7 +156,7 @@ const QStringList Song::kArticles = QStringList() << "the " << "a " << "an ";
struct Song::Private : public QSharedData { struct Song::Private : public QSharedData {
Private(Source source = Source_Unknown); explicit Private(Source source = Source_Unknown);
bool valid_; bool valid_;
int id_; int id_;

View File

@ -103,7 +103,7 @@ class Song {
FileType_Stream = 91, FileType_Stream = 91,
}; };
Song(Song::Source source = Song::Source_Unknown); explicit Song(Song::Source source = Song::Source_Unknown);
Song(const Song &other); Song(const Song &other);
~Song(); ~Song();

View File

@ -43,7 +43,7 @@ class StandardItemIconLoader : public QObject {
Q_OBJECT Q_OBJECT
public: public:
StandardItemIconLoader(AlbumCoverLoader *cover_loader, QObject *parent = nullptr); explicit StandardItemIconLoader(AlbumCoverLoader *cover_loader, QObject *parent = nullptr);
AlbumCoverLoaderOptions *options() { return &cover_options_; } AlbumCoverLoaderOptions *options() { return &cover_options_; }

View File

@ -36,7 +36,7 @@ class SystemTrayIcon : public QObject {
Q_OBJECT Q_OBJECT
public: public:
SystemTrayIcon(QObject *parent = nullptr); explicit SystemTrayIcon(QObject *parent = nullptr);
// Called once to create the icon's context menu // Called once to create the icon's context menu
virtual void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit) = 0; virtual void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit) = 0;

View File

@ -29,8 +29,7 @@ class QObject;
// Improve QThread by adding a SetIoPriority function // Improve QThread by adding a SetIoPriority function
class Thread : public QThread { class Thread : public QThread {
public: public:
Thread(QObject* parent = nullptr) explicit Thread(QObject* parent = nullptr) : QThread(parent), io_priority_(Utilities::IOPRIO_CLASS_NONE) {}
: QThread(parent), io_priority_(Utilities::IOPRIO_CLASS_NONE) {}
void SetIoPriority(Utilities::IoPriority priority) { void SetIoPriority(Utilities::IoPriority priority) {
io_priority_ = priority; io_priority_ = priority;

View File

@ -27,7 +27,7 @@ class QTranslator;
class Translations : public QObject { class Translations : public QObject {
public: public:
Translations(); explicit Translations();
~Translations(); ~Translations();
void LoadTranslation(const QString &prefix, const QString &path, const QString &language); void LoadTranslation(const QString &prefix, const QString &path, const QString &language);

View File

@ -38,7 +38,7 @@ class Windows7ThumbBar : public QObject {
public: public:
// Creates a list of buttons in the taskbar icon for this window. Does nothing and is safe to use on other operating systems too. // Creates a list of buttons in the taskbar icon for this window. Does nothing and is safe to use on other operating systems too.
Windows7ThumbBar(QWidget *widget = 0); explicit Windows7ThumbBar(QWidget *widget = 0);
static const int kIconSize; static const int kIconSize;
static const int kMaxButtonCount; static const int kMaxButtonCount;

View File

@ -57,7 +57,7 @@ class AlbumCoverChoiceController : public QWidget {
static const char *kSaveImageFileFilter; static const char *kSaveImageFileFilter;
static const char *kAllFilesFilter; static const char *kAllFilesFilter;
AlbumCoverChoiceController(QWidget *parent = nullptr); explicit AlbumCoverChoiceController(QWidget *parent = nullptr);
~AlbumCoverChoiceController(); ~AlbumCoverChoiceController();
void Init(Application *app); void Init(Application *app);

View File

@ -35,7 +35,7 @@ class AlbumCoverExport : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
AlbumCoverExport(QWidget *parent = nullptr); explicit AlbumCoverExport(QWidget *parent = nullptr);
~AlbumCoverExport(); ~AlbumCoverExport();
enum OverwriteMode { enum OverwriteMode {

View File

@ -42,7 +42,7 @@ struct CoverSearchStatistics;
// This class represents a single search-for-cover request. It identifies and describes the request. // This class represents a single search-for-cover request. It identifies and describes the request.
struct CoverSearchRequest { struct CoverSearchRequest {
CoverSearchRequest() : id(-1), search(false), fetchall(false) {} explicit CoverSearchRequest() : id(-1), search(false), fetchall(false) {}
// An unique (for one AlbumCoverFetcher) request identifier // An unique (for one AlbumCoverFetcher) request identifier
quint64 id; quint64 id;
@ -60,7 +60,7 @@ struct CoverSearchRequest {
// This structure represents a single result of some album's cover search request. // This structure represents a single result of some album's cover search request.
struct CoverSearchResult { struct CoverSearchResult {
CoverSearchResult() : score(0.0) {} explicit CoverSearchResult() : score(0.0) {}
// Used for grouping in the user interface. // Used for grouping in the user interface.
QString provider; QString provider;
@ -87,7 +87,7 @@ class AlbumCoverFetcher : public QObject {
Q_OBJECT Q_OBJECT
public: public:
AlbumCoverFetcher(CoverProviders *cover_providers, QObject *parent = nullptr, QNetworkAccessManager *network = 0); explicit AlbumCoverFetcher(CoverProviders *cover_providers, QObject *parent = nullptr, QNetworkAccessManager *network = 0);
virtual ~AlbumCoverFetcher() {} virtual ~AlbumCoverFetcher() {}
static const int kMaxConcurrentRequests; static const int kMaxConcurrentRequests;

View File

@ -47,7 +47,7 @@ class AlbumCoverFetcherSearch : public QObject {
Q_OBJECT Q_OBJECT
public: public:
AlbumCoverFetcherSearch(const CoverSearchRequest &request, QNetworkAccessManager *network, QObject *parent); explicit AlbumCoverFetcherSearch(const CoverSearchRequest &request, QNetworkAccessManager *network, QObject *parent);
void Start(CoverProviders *cover_providers); void Start(CoverProviders *cover_providers);

View File

@ -84,7 +84,7 @@ class AlbumCoverLoader : public QObject {
}; };
struct Task { struct Task {
Task() : redirects(0) {} explicit Task() : redirects(0) {}
AlbumCoverLoaderOptions options; AlbumCoverLoaderOptions options;
@ -98,7 +98,7 @@ class AlbumCoverLoader : public QObject {
}; };
struct TryLoadResult { struct TryLoadResult {
TryLoadResult(bool async, bool success, const QUrl &_cover_url, const QImage &_image) : started_async(async), loaded_success(success), cover_url(_cover_url), image(_image) {} explicit TryLoadResult(bool async, bool success, const QUrl &_cover_url, const QImage &_image) : started_async(async), loaded_success(success), cover_url(_cover_url), image(_image) {}
bool started_async; bool started_async;
bool loaded_success; bool loaded_success;

View File

@ -26,7 +26,7 @@
#include <QImage> #include <QImage>
struct AlbumCoverLoaderOptions { struct AlbumCoverLoaderOptions {
AlbumCoverLoaderOptions() explicit AlbumCoverLoaderOptions()
: desired_height_(120), : desired_height_(120),
scale_output_image_(true), scale_output_image_(true),
pad_output_image_(true) {} pad_output_image_(true) {}

View File

@ -36,8 +36,9 @@ class AlbumCoverManager;
class AlbumCoverManagerList : public QListWidget { class AlbumCoverManagerList : public QListWidget {
Q_OBJECT Q_OBJECT
public: public:
AlbumCoverManagerList(QWidget *parent = nullptr); explicit AlbumCoverManagerList(QWidget *parent = nullptr);
void set_cover_manager(AlbumCoverManager *manager) { manager_ = manager; } void set_cover_manager(AlbumCoverManager *manager) { manager_ = manager; }

View File

@ -57,7 +57,7 @@ public:
static const int kBorderAlpha; static const int kBorderAlpha;
static const int kBackgroundAlpha; static const int kBackgroundAlpha;
SizeOverlayDelegate(QObject *parent = nullptr); explicit SizeOverlayDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
}; };
@ -67,7 +67,7 @@ class AlbumCoverSearcher : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
AlbumCoverSearcher(const QIcon &no_cover_icon, Application *app, QWidget *parent); explicit AlbumCoverSearcher(const QIcon &no_cover_icon, Application *app, QWidget *parent);
~AlbumCoverSearcher(); ~AlbumCoverSearcher();
enum Role { enum Role {

View File

@ -34,7 +34,7 @@ class CoverExportRunnable : public QObject, public QRunnable {
Q_OBJECT Q_OBJECT
public: public:
CoverExportRunnable(const AlbumCoverExport::DialogResult &dialog_result, const Song &song); explicit CoverExportRunnable(const AlbumCoverExport::DialogResult &dialog_result, const Song &song);
virtual ~CoverExportRunnable() {} virtual ~CoverExportRunnable() {}
void run(); void run();

View File

@ -38,7 +38,7 @@ class CoverFromURLDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
CoverFromURLDialog(QWidget *parent = nullptr); explicit CoverFromURLDialog(QWidget *parent = nullptr);
~CoverFromURLDialog(); ~CoverFromURLDialog();
// Opens the dialog. This returns an image found at the URL chosen by user or null image if the dialog got rejected. // Opens the dialog. This returns an image found at the URL chosen by user or null image if the dialog got rejected.

View File

@ -30,7 +30,7 @@
struct CoverSearchStatistics { struct CoverSearchStatistics {
CoverSearchStatistics(); explicit CoverSearchStatistics();
CoverSearchStatistics& operator +=(const CoverSearchStatistics &other); CoverSearchStatistics& operator +=(const CoverSearchStatistics &other);

View File

@ -42,7 +42,7 @@ class Application;
// This struct represents a single search-for-cover request. It identifies and describes the request. // This struct represents a single search-for-cover request. It identifies and describes the request.
struct DiscogsCoverSearchContext { struct DiscogsCoverSearchContext {
DiscogsCoverSearchContext() : id(-1), r_count(0) {} explicit DiscogsCoverSearchContext() : id(-1), r_count(0) {}
// The unique request identifier // The unique request identifier
int id; int id;
@ -58,7 +58,7 @@ Q_DECLARE_METATYPE(DiscogsCoverSearchContext)
// This struct represents a single release request. It identifies and describes the request. // This struct represents a single release request. It identifies and describes the request.
struct DiscogsCoverReleaseContext { struct DiscogsCoverReleaseContext {
DiscogsCoverReleaseContext() : id(-1) {} explicit DiscogsCoverReleaseContext() : id(-1) {}
int id; // The unique request identifier int id; // The unique request identifier
int s_id; // The search request identifier int s_id; // The search request identifier

View File

@ -17,7 +17,7 @@ class AfcFile : public QIODevice {
Q_OBJECT Q_OBJECT
public: public:
AfcFile(iMobileDeviceConnection* connection, const QString &path, QObject *parent = 0); explicit AfcFile(iMobileDeviceConnection* connection, const QString &path, QObject *parent = 0);
~AfcFile(); ~AfcFile();
// QIODevice // QIODevice

View File

@ -39,7 +39,7 @@ class AfcTransfer : public QObject {
Q_OBJECT Q_OBJECT
public: public:
AfcTransfer(const QString &uuid, const QString &local_destination, TaskManager *task_manager, std::shared_ptr<ConnectedDevice> device); explicit AfcTransfer(const QString &uuid, const QString &local_destination, TaskManager *task_manager, std::shared_ptr<ConnectedDevice> device);
~AfcTransfer(); ~AfcTransfer();
bool CopyToDevice(iMobileDeviceConnection *connection); bool CopyToDevice(iMobileDeviceConnection *connection);

View File

@ -107,7 +107,7 @@ bool CddaLister::Init() {
cdio_init(); cdio_init();
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
if (!cdio_have_driver(DRIVER_OSX)) { if (!cdio_have_driver(DRIVER_OSX)) {
qLog(Error) << "libcdio was compiled without support for OS X!"; qLog(Error) << "libcdio was compiled without support for macOS!";
} }
#endif #endif
char** devices = cdio_get_devices(DRIVER_DEVICE); char** devices = cdio_get_devices(DRIVER_DEVICE);

View File

@ -37,7 +37,7 @@ class CddaLister : public DeviceLister {
Q_OBJECT Q_OBJECT
public: public:
CddaLister() {} explicit CddaLister() {}
QStringList DeviceUniqueIDs(); QStringList DeviceUniqueIDs();
QVariantList DeviceIcons(const QString &id); QVariantList DeviceIcons(const QString &id);

View File

@ -43,7 +43,7 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std:
Q_OBJECT Q_OBJECT
public: public:
ConnectedDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time); explicit ConnectedDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time);
~ConnectedDevice(); ~ConnectedDevice();
virtual bool Init() = 0; virtual bool Init() = 0;

View File

@ -60,7 +60,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
Type_Device, Type_Device,
}; };
DeviceInfo(SimpleTreeModel<DeviceInfo> *model) explicit DeviceInfo(SimpleTreeModel<DeviceInfo> *model)
: SimpleTreeItem<DeviceInfo>(Type_Root, model), : SimpleTreeItem<DeviceInfo>(Type_Root, model),
database_id_(-1), database_id_(-1),
size_(0), size_(0),
@ -70,7 +70,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
unmount_(false), unmount_(false),
forget_(false) {} forget_(false) {}
DeviceInfo(Type type, DeviceInfo *parent = nullptr) explicit DeviceInfo(Type type, DeviceInfo *parent = nullptr)
: SimpleTreeItem<DeviceInfo>(type, parent), : SimpleTreeItem<DeviceInfo>(type, parent),
database_id_(-1), database_id_(-1),
size_(0), size_(0),
@ -83,7 +83,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
// A device can be discovered in different ways (udisks2, gio, etc.) // A device can be discovered in different ways (udisks2, gio, etc.)
// Sometimes the same device is discovered more than once. In this case the device will have multiple "backends". // Sometimes the same device is discovered more than once. In this case the device will have multiple "backends".
struct Backend { struct Backend {
Backend(DeviceLister *lister = nullptr, const QString &id = QString()) explicit Backend(DeviceLister *lister = nullptr, const QString &id = QString())
: :
lister_(lister), lister_(lister),
unique_id_(id) unique_id_(id)

View File

@ -58,7 +58,7 @@ class DeviceManager : public SimpleTreeModel<DeviceInfo> {
Q_OBJECT Q_OBJECT
public: public:
DeviceManager(Application *app, QObject *parent = nullptr); explicit DeviceManager(Application *app, QObject *parent = nullptr);
~DeviceManager(); ~DeviceManager();
enum Role { enum Role {

View File

@ -42,7 +42,7 @@ class DeviceProperties : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
DeviceProperties(QWidget *parent = nullptr); explicit DeviceProperties(QWidget *parent = nullptr);
~DeviceProperties(); ~DeviceProperties();
void SetDeviceManager(DeviceManager *manager); void SetDeviceManager(DeviceManager *manager);

View File

@ -36,7 +36,7 @@ class DeviceStateFilterModel : public QSortFilterProxyModel {
Q_OBJECT Q_OBJECT
public: public:
DeviceStateFilterModel(QObject *parent, DeviceManager::State state = DeviceManager::State_Remembered); explicit DeviceStateFilterModel(QObject *parent, DeviceManager::State state = DeviceManager::State_Remembered);
void setSourceModel(QAbstractItemModel *sourceModel); void setSourceModel(QAbstractItemModel *sourceModel);

View File

@ -53,7 +53,7 @@ class DeviceItemDelegate : public CollectionItemDelegate {
Q_OBJECT Q_OBJECT
public: public:
DeviceItemDelegate(QObject *parent); explicit DeviceItemDelegate(QObject *parent);
static const int kIconPadding; static const int kIconPadding;
@ -65,7 +65,7 @@ class DeviceView : public AutoExpandingTreeView {
Q_OBJECT Q_OBJECT
public: public:
DeviceView(QWidget *parent = nullptr); explicit DeviceView(QWidget *parent = nullptr);
~DeviceView(); ~DeviceView();
void SetApplication(Application *app); void SetApplication(Application *app);

View File

@ -49,7 +49,7 @@ class GioLister : public DeviceLister {
Q_OBJECT Q_OBJECT
public: public:
GioLister() {} explicit GioLister() {}
~GioLister(); ~GioLister();
int priority() const { return 50; } int priority() const { return 50; }

View File

@ -40,7 +40,7 @@ class GPodLoader : public QObject {
Q_OBJECT Q_OBJECT
public: public:
GPodLoader(const QString &mount_point, TaskManager *task_manager, CollectionBackend *backend, std::shared_ptr<ConnectedDevice> device); explicit GPodLoader(const QString &mount_point, TaskManager *task_manager, CollectionBackend *backend, std::shared_ptr<ConnectedDevice> device);
~GPodLoader(); ~GPodLoader();
void set_music_path_prefix(const QString &prefix) { path_prefix_ = prefix; } void set_music_path_prefix(const QString &prefix) { path_prefix_ = prefix; }

View File

@ -38,7 +38,7 @@
class iLister : public DeviceLister { class iLister : public DeviceLister {
Q_OBJECT Q_OBJECT
public: public:
iLister(); explicit iLister();
~iLister(); ~iLister();
int priority() const { return 120; } int priority() const { return 120; }

View File

@ -38,7 +38,7 @@
class iMobileDeviceConnection { class iMobileDeviceConnection {
public: public:
iMobileDeviceConnection(const QString &uuid); explicit iMobileDeviceConnection(const QString &uuid);
~iMobileDeviceConnection(); ~iMobileDeviceConnection();
afc_client_t afc() { return afc_; } afc_client_t afc() { return afc_; }

View File

@ -42,7 +42,7 @@ class MacOsDeviceLister : public DeviceLister {
Q_OBJECT Q_OBJECT
public: public:
MacOsDeviceLister(); explicit MacOsDeviceLister();
~MacOsDeviceLister(); ~MacOsDeviceLister();
QStringList DeviceUniqueIDs(); QStringList DeviceUniqueIDs();

View File

@ -36,7 +36,7 @@
class MtpConnection : public QObject, public std::enable_shared_from_this<MtpConnection> { class MtpConnection : public QObject, public std::enable_shared_from_this<MtpConnection> {
public: public:
MtpConnection(const QUrl &url); explicit MtpConnection(const QUrl &url);
~MtpConnection(); ~MtpConnection();
bool is_valid() const { return device_; } bool is_valid() const { return device_; }

View File

@ -39,7 +39,7 @@ class MtpLoader : public QObject {
Q_OBJECT Q_OBJECT
public: public:
MtpLoader(const QUrl &url, TaskManager *task_manager, CollectionBackend *backend); explicit MtpLoader(const QUrl &url, TaskManager *task_manager, CollectionBackend *backend);
~MtpLoader(); ~MtpLoader();
bool Init(); bool Init();

View File

@ -49,7 +49,7 @@ class Udisks2Lister : public DeviceLister {
Q_OBJECT Q_OBJECT
public: public:
Udisks2Lister(); explicit Udisks2Lister();
~Udisks2Lister(); ~Udisks2Lister();
QStringList DeviceUniqueIDs() override; QStringList DeviceUniqueIDs() override;

View File

@ -37,7 +37,7 @@ class About : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
About(QWidget *parent = nullptr); explicit About(QWidget *parent = nullptr);
struct Person { struct Person {
Person(const QString &n, const QString &e = QString()) : name(n), email(e) {} Person(const QString &n, const QString &e = QString()) : name(n), email(e) {}

View File

@ -34,8 +34,9 @@ class Application;
class Console : public QDialog { class Console : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
Console(Application *app, QWidget *parent = nullptr); explicit Console(Application *app, QWidget *parent = nullptr);
private slots: private slots:
void RunQuery(); void RunQuery();

View File

@ -60,7 +60,7 @@ class EditTagDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
EditTagDialog(Application *app, QWidget *parent = nullptr); explicit EditTagDialog(Application *app, QWidget *parent = nullptr);
~EditTagDialog(); ~EditTagDialog();
static const char *kHintText; static const char *kHintText;

View File

@ -36,7 +36,7 @@ class ErrorDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
ErrorDialog(QWidget *parent = nullptr); explicit ErrorDialog(QWidget *parent = nullptr);
~ErrorDialog(); ~ErrorDialog();
public slots: public slots:

View File

@ -38,7 +38,7 @@ class TrackSelectionDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
TrackSelectionDialog(QWidget *parent = nullptr); explicit TrackSelectionDialog(QWidget *parent = nullptr);
~TrackSelectionDialog(); ~TrackSelectionDialog();
void set_save_on_close(bool save_on_close) { save_on_close_ = save_on_close; } void set_save_on_close(bool save_on_close) { save_on_close_ = save_on_close; }

View File

@ -28,7 +28,7 @@
class AlsaDeviceFinder : public DeviceFinder { class AlsaDeviceFinder : public DeviceFinder {
public: public:
AlsaDeviceFinder(); explicit AlsaDeviceFinder();
virtual bool Initialise() { return true; } virtual bool Initialise() { return true; }
virtual QList<Device> ListDevices(); virtual QList<Device> ListDevices();

View File

@ -29,7 +29,7 @@
class DirectSoundDeviceFinder : public DeviceFinder { class DirectSoundDeviceFinder : public DeviceFinder {
public: public:
DirectSoundDeviceFinder(); explicit DirectSoundDeviceFinder();
virtual bool Initialise() { return true; } virtual bool Initialise() { return true; }
virtual QList<Device> ListDevices(); virtual QList<Device> ListDevices();

View File

@ -32,7 +32,7 @@ class GstElementDeleter : public QObject {
Q_OBJECT Q_OBJECT
public: public:
GstElementDeleter(QObject *parent = nullptr); explicit GstElementDeleter(QObject *parent = nullptr);
// If you call this function with any gstreamer element, the element will get deleted in the main thread. // If you call this function with any gstreamer element, the element will get deleted in the main thread.
// This is useful if you need to delete an element from its own callback. // This is useful if you need to delete an element from its own callback.

View File

@ -57,7 +57,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
Q_OBJECT Q_OBJECT
public: public:
GstEngine(TaskManager *task_manager); explicit GstEngine(TaskManager *task_manager);
~GstEngine(); ~GstEngine();
bool Init(); bool Init();

View File

@ -60,7 +60,7 @@ class GstEnginePipeline : public QObject {
Q_OBJECT Q_OBJECT
public: public:
GstEnginePipeline(GstEngine *engine); explicit GstEnginePipeline(GstEngine *engine);
~GstEnginePipeline(); ~GstEnginePipeline();
// Globally unique across all pipelines. // Globally unique across all pipelines.

View File

@ -29,7 +29,7 @@
class MacOsDeviceFinder : public DeviceFinder { class MacOsDeviceFinder : public DeviceFinder {
public: public:
MacOsDeviceFinder(); explicit MacOsDeviceFinder();
virtual bool Initialise() { return true; } virtual bool Initialise() { return true; }
virtual QList<Device> ListDevices(); virtual QList<Device> ListDevices();

View File

@ -26,7 +26,8 @@
class MMDeviceFinder : public DeviceFinder { class MMDeviceFinder : public DeviceFinder {
public: public:
MMDeviceFinder(); explicit MMDeviceFinder();
virtual bool Initialise() { return true; } virtual bool Initialise() { return true; }
virtual QList<Device> ListDevices(); virtual QList<Device> ListDevices();
}; };

View File

@ -40,7 +40,7 @@ class PhononEngine : public Engine::Base {
Q_OBJECT Q_OBJECT
public: public:
PhononEngine(TaskManager *task_manager); explicit PhononEngine(TaskManager *task_manager);
~PhononEngine(); ~PhononEngine();
bool Init(); bool Init();

View File

@ -33,7 +33,7 @@
class PulseDeviceFinder : public DeviceFinder { class PulseDeviceFinder : public DeviceFinder {
public: public:
PulseDeviceFinder(); explicit PulseDeviceFinder();
~PulseDeviceFinder(); ~PulseDeviceFinder();
virtual bool Initialise(); virtual bool Initialise();

View File

@ -42,7 +42,7 @@ class VLCEngine : public Engine::Base {
Q_OBJECT Q_OBJECT
public: public:
VLCEngine(TaskManager *task_manager); explicit VLCEngine(TaskManager *task_manager);
~VLCEngine(); ~VLCEngine();
bool Init(); bool Init();

View File

@ -28,7 +28,7 @@
template <typename T> template <typename T>
class VlcScopedRef { class VlcScopedRef {
public: public:
VlcScopedRef(T* ptr); explicit VlcScopedRef(T* ptr);
~VlcScopedRef(); ~VlcScopedRef();
operator T* () const { return ptr_; } operator T* () const { return ptr_; }
@ -36,7 +36,7 @@ class VlcScopedRef {
T* operator ->() const { return ptr_; } T* operator ->() const { return ptr_; }
private: private:
VlcScopedRef(VlcScopedRef&) {} explicit VlcScopedRef(VlcScopedRef&) {}
VlcScopedRef& operator =(const VlcScopedRef&) { return *this; } VlcScopedRef& operator =(const VlcScopedRef&) { return *this; }
T* ptr_; T* ptr_;

View File

@ -48,7 +48,7 @@ class XineEngine : public Engine::Base {
Q_OBJECT Q_OBJECT
public: public:
XineEngine(TaskManager *task_manager); explicit XineEngine(TaskManager *task_manager);
~XineEngine(); ~XineEngine();
bool Init(); bool Init();

View File

@ -41,7 +41,7 @@ class Equalizer : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
Equalizer(QWidget *parent = nullptr); explicit Equalizer(QWidget *parent = nullptr);
~Equalizer(); ~Equalizer();
static const int kBands = 10; static const int kBands = 10;

View File

@ -35,7 +35,7 @@ class EqualizerSlider : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
EqualizerSlider(const QString &label, QWidget *parent = nullptr); explicit EqualizerSlider(const QString &label, QWidget *parent = nullptr);
~EqualizerSlider(); ~EqualizerSlider();
int value() const; int value() const;

View File

@ -47,7 +47,7 @@ class GlobalShortcutGrabber : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
GlobalShortcutGrabber(QWidget *parent = nullptr); explicit GlobalShortcutGrabber(QWidget *parent = nullptr);
~GlobalShortcutGrabber(); ~GlobalShortcutGrabber();
QKeySequence GetKey(const QString &name); QKeySequence GetKey(const QString &name);

View File

@ -50,7 +50,7 @@ class InternetCollectionView : public AutoExpandingTreeView {
Q_OBJECT Q_OBJECT
public: public:
InternetCollectionView(QWidget *parent = nullptr); explicit InternetCollectionView(QWidget *parent = nullptr);
~InternetCollectionView(); ~InternetCollectionView();
void Init(Application *app, CollectionBackend *backend, CollectionModel *model, const bool favorite = false); void Init(Application *app, CollectionBackend *backend, CollectionModel *model, const bool favorite = false);

View File

@ -42,7 +42,7 @@ class InternetCollectionViewContainer : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InternetCollectionViewContainer(QWidget *parent = nullptr); explicit InternetCollectionViewContainer(QWidget *parent = nullptr);
~InternetCollectionViewContainer(); ~InternetCollectionViewContainer();
QStackedWidget *stacked() const { return ui_->stacked; } QStackedWidget *stacked() const { return ui_->stacked; }

View File

@ -50,7 +50,7 @@ class InternetSearch : public QObject {
Q_OBJECT Q_OBJECT
public: public:
InternetSearch(Application *app, Song::Source source, QObject *parent = nullptr); explicit InternetSearch(Application *app, Song::Source source, QObject *parent = nullptr);
~InternetSearch(); ~InternetSearch();
enum SearchType { enum SearchType {

View File

@ -32,7 +32,7 @@ class InternetSearchView;
class InternetSearchItemDelegate : public CollectionItemDelegate { class InternetSearchItemDelegate : public CollectionItemDelegate {
public: public:
InternetSearchItemDelegate(InternetSearchView *view); explicit InternetSearchItemDelegate(InternetSearchView *view);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

View File

@ -46,7 +46,7 @@ class InternetSearchModel : public QStandardItemModel {
Q_OBJECT Q_OBJECT
public: public:
InternetSearchModel(InternetSearch *engine, QObject *parent = nullptr); explicit InternetSearchModel(InternetSearch *engine, QObject *parent = nullptr);
enum Role { enum Role {
Role_Result = CollectionModel::LastRole, Role_Result = CollectionModel::LastRole,

View File

@ -28,7 +28,7 @@ class QModelIndex;
class InternetSearchSortModel : public QSortFilterProxyModel { class InternetSearchSortModel : public QSortFilterProxyModel {
public: public:
InternetSearchSortModel(QObject *parent = nullptr); explicit InternetSearchSortModel(QObject *parent = nullptr);
protected: protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const; bool lessThan(const QModelIndex &left, const QModelIndex &right) const;

View File

@ -60,7 +60,7 @@ class InternetSearchView : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InternetSearchView(QWidget *parent = nullptr); explicit InternetSearchView(QWidget *parent = nullptr);
~InternetSearchView(); ~InternetSearchView();
void Init(Application *app, InternetSearch *engine, const QString &settings_group, const SettingsDialog::Page settings_page, const bool artists = false, const bool albums = false, const bool songs = false); void Init(Application *app, InternetSearch *engine, const QString &settings_group, const SettingsDialog::Page settings_page, const bool artists = false, const bool albums = false, const bool songs = false);

View File

@ -39,7 +39,7 @@ class InternetService : public QObject {
Q_OBJECT Q_OBJECT
public: public:
InternetService(Song::Source source, const QString &name, const QString &url_scheme, Application *app, QObject *parent = nullptr); explicit InternetService(Song::Source source, const QString &name, const QString &url_scheme, Application *app, QObject *parent = nullptr);
virtual ~InternetService() {} virtual ~InternetService() {}
virtual void Exit() {} virtual void Exit() {}

View File

@ -40,7 +40,7 @@ class InternetSongsView : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InternetSongsView(Application *app, InternetService *service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr); explicit InternetSongsView(Application *app, InternetService *service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr);
~InternetSongsView(); ~InternetSongsView();
void ReloadSettings(); void ReloadSettings();

View File

@ -43,7 +43,7 @@ class InternetTabsView : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InternetTabsView(Application *app, InternetService *service, InternetSearch *engine, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr); explicit InternetTabsView(Application *app, InternetService *service, InternetSearch *engine, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent = nullptr);
~InternetTabsView(); ~InternetTabsView();
void ReloadSettings(); void ReloadSettings();

Some files were not shown because too many files have changed in this diff Show More