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
public:
SCollection(Application *app, QObject *parent);
explicit SCollection(Application *app, QObject *parent);
~SCollection();
static const char *kSongsTable;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -72,7 +72,7 @@ struct QueryOptions {
class CollectionQuery {
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).
void SetColumnSpec(const QString &spec) { column_spec_ = spec; }

View File

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

View File

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

View File

@ -48,7 +48,7 @@ class CollectionWatcher : public QObject {
Q_OBJECT
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_task_manager(TaskManager *task_manager) { task_manager_ = task_manager; }
@ -64,7 +64,7 @@ class CollectionWatcher : public QObject {
void ExitAsync();
signals:
signals:
void NewOrUpdatedSongs(const SongList &songs);
void SongsMTimeUpdated(const SongList &songs);
void SongsDeleted(const SongList &songs);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -42,7 +42,7 @@ class Database : public QObject {
Q_OBJECT
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();
struct AttachedDatabase {

View File

@ -30,7 +30,7 @@
class DBusScreensaver : public Screensaver {
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 Uninhibit();

View File

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

View File

@ -29,7 +29,7 @@
#include "musicstorage.h"
class FilesystemMusicStorage : public virtual MusicStorage {
public:
public:
explicit FilesystemMusicStorage(const QString &root);
~FilesystemMusicStorage() {}
@ -38,7 +38,7 @@ public:
bool CopyToStorage(const CopyJob &job);
bool DeleteFromStorage(const DeleteJob &job);
private:
private:
QString root_;
};

View File

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

View File

@ -25,7 +25,7 @@
namespace IconMapper {
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) {}
QStringList names;
int min_size;

View File

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

View File

@ -38,7 +38,7 @@ class MacSystemTrayIcon : public SystemTrayIcon {
Q_OBJECT
public:
MacSystemTrayIcon(QObject *parent = nullptr);
explicit MacSystemTrayIcon(QObject *parent = nullptr);
~MacSystemTrayIcon();
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
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();
static const char *kSettingsGroup;

View File

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

View File

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

View File

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

View File

@ -44,7 +44,7 @@ class NetworkProxyFactory : public QNetworkProxyFactory {
QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query);
private:
NetworkProxyFactory();
explicit NetworkProxyFactory();
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.
class ScopedTransaction : boost::noncopyable {
public:
ScopedTransaction(QSqlDatabase *db);
explicit ScopedTransaction(QSqlDatabase *db);
~ScopedTransaction();
void Commit();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ class SystemTrayIcon : public QObject {
Q_OBJECT
public:
SystemTrayIcon(QObject *parent = nullptr);
explicit SystemTrayIcon(QObject *parent = nullptr);
// 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;

View File

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

View File

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

View File

@ -38,7 +38,7 @@ class Windows7ThumbBar : public QObject {
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.
Windows7ThumbBar(QWidget *widget = 0);
explicit Windows7ThumbBar(QWidget *widget = 0);
static const int kIconSize;
static const int kMaxButtonCount;

View File

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

View File

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

View File

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

View File

@ -84,7 +84,7 @@ class AlbumCoverLoader : public QObject {
};
struct Task {
Task() : redirects(0) {}
explicit Task() : redirects(0) {}
AlbumCoverLoaderOptions options;
@ -98,7 +98,7 @@ class AlbumCoverLoader : public QObject {
};
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 loaded_success;

View File

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

View File

@ -36,16 +36,17 @@ class AlbumCoverManager;
class AlbumCoverManagerList : public QListWidget {
Q_OBJECT
public:
AlbumCoverManagerList(QWidget *parent = nullptr);
explicit AlbumCoverManagerList(QWidget *parent = nullptr);
void set_cover_manager(AlbumCoverManager *manager) { manager_ = manager; }
protected:
protected:
QMimeData *mimeData(const QList<QListWidgetItem*> items) const;
void dropEvent(QDropEvent *event);
private:
private:
AlbumCoverManager* manager_;
};

View File

@ -48,7 +48,7 @@ class Application;
class Ui_AlbumCoverSearcher;
class SizeOverlayDelegate : public QStyledItemDelegate {
public:
public:
static const int kMargin;
static const int kPaddingX;
static const int kPaddingY;
@ -57,7 +57,7 @@ public:
static const int kBorderAlpha;
static const int kBackgroundAlpha;
SizeOverlayDelegate(QObject *parent = nullptr);
explicit SizeOverlayDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};
@ -66,8 +66,8 @@ public:
class AlbumCoverSearcher : public QDialog {
Q_OBJECT
public:
AlbumCoverSearcher(const QIcon &no_cover_icon, Application *app, QWidget *parent);
public:
explicit AlbumCoverSearcher(const QIcon &no_cover_icon, Application *app, QWidget *parent);
~AlbumCoverSearcher();
enum Role {
@ -82,17 +82,17 @@ public:
QImage Exec(const QString &artist, const QString &album);
protected:
protected:
void keyPressEvent(QKeyEvent*);
private slots:
private slots:
void Search();
void SearchFinished(const quint64 id, const CoverSearchResults &results);
void ImageLoaded(const quint64 id, const QUrl &cover_url, const QImage &image);
void CoverDoubleClicked(const QModelIndex &index);
private:
private:
Ui_AlbumCoverSearcher *ui_;
Application *app_;

View File

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

View File

@ -38,7 +38,7 @@ class CoverFromURLDialog : public QDialog {
Q_OBJECT
public:
CoverFromURLDialog(QWidget *parent = nullptr);
explicit CoverFromURLDialog(QWidget *parent = nullptr);
~CoverFromURLDialog();
// 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 {
CoverSearchStatistics();
explicit CoverSearchStatistics();
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.
struct DiscogsCoverSearchContext {
DiscogsCoverSearchContext() : id(-1), r_count(0) {}
explicit DiscogsCoverSearchContext() : id(-1), r_count(0) {}
// The unique request identifier
int id;
@ -58,7 +58,7 @@ Q_DECLARE_METATYPE(DiscogsCoverSearchContext)
// This struct represents a single release request. It identifies and describes the request.
struct DiscogsCoverReleaseContext {
DiscogsCoverReleaseContext() : id(-1) {}
explicit DiscogsCoverReleaseContext() : id(-1) {}
int id; // The unique request identifier
int s_id; // The search request identifier

View File

@ -16,8 +16,8 @@ class iMobileDeviceConnection;
class AfcFile : public QIODevice {
Q_OBJECT
public:
AfcFile(iMobileDeviceConnection* connection, const QString &path, QObject *parent = 0);
public:
explicit AfcFile(iMobileDeviceConnection* connection, const QString &path, QObject *parent = 0);
~AfcFile();
// QIODevice
@ -26,7 +26,7 @@ public:
bool seek(qint64 pos);
qint64 size() const;
private:
private:
// QIODevice
qint64 readData(char *data, qint64 max_size);
qint64 writeData(const char *data, qint64 max_size);

View File

@ -38,26 +38,26 @@ class iMobileDeviceConnection;
class AfcTransfer : public QObject {
Q_OBJECT
public:
AfcTransfer(const QString &uuid, const QString &local_destination, TaskManager *task_manager, std::shared_ptr<ConnectedDevice> device);
public:
explicit AfcTransfer(const QString &uuid, const QString &local_destination, TaskManager *task_manager, std::shared_ptr<ConnectedDevice> device);
~AfcTransfer();
bool CopyToDevice(iMobileDeviceConnection *connection);
public slots:
public slots:
void CopyFromDevice();
signals:
signals:
void TaskStarted(int task_id);
void CopyFinished(bool success);
private:
private:
bool CopyDirFromDevice(iMobileDeviceConnection *c, const QString &path);
bool CopyDirToDevice(iMobileDeviceConnection *c, const QString &path);
bool CopyFileFromDevice(iMobileDeviceConnection *c, const QString &path);
bool CopyFileToDevice(iMobileDeviceConnection *c, const QString &path);
private:
private:
QThread *original_thread_;
std::shared_ptr<ConnectedDevice> device_;
TaskManager *task_manager_;

View File

@ -107,7 +107,7 @@ bool CddaLister::Init() {
cdio_init();
#ifdef Q_OS_MACOS
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
char** devices = cdio_get_devices(DRIVER_DEVICE);

View File

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

View File

@ -43,7 +43,7 @@ class ConnectedDevice : public QObject, public virtual MusicStorage, public std:
Q_OBJECT
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();
virtual bool Init() = 0;

View File

@ -60,7 +60,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
Type_Device,
};
DeviceInfo(SimpleTreeModel<DeviceInfo> *model)
explicit DeviceInfo(SimpleTreeModel<DeviceInfo> *model)
: SimpleTreeItem<DeviceInfo>(Type_Root, model),
database_id_(-1),
size_(0),
@ -70,7 +70,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
unmount_(false),
forget_(false) {}
DeviceInfo(Type type, DeviceInfo *parent = nullptr)
explicit DeviceInfo(Type type, DeviceInfo *parent = nullptr)
: SimpleTreeItem<DeviceInfo>(type, parent),
database_id_(-1),
size_(0),
@ -83,7 +83,7 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
// 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".
struct Backend {
Backend(DeviceLister *lister = nullptr, const QString &id = QString())
explicit Backend(DeviceLister *lister = nullptr, const QString &id = QString())
:
lister_(lister),
unique_id_(id)

View File

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

View File

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

View File

@ -35,22 +35,22 @@ class QModelIndex;
class DeviceStateFilterModel : public QSortFilterProxyModel {
Q_OBJECT
public:
DeviceStateFilterModel(QObject *parent, DeviceManager::State state = DeviceManager::State_Remembered);
public:
explicit DeviceStateFilterModel(QObject *parent, DeviceManager::State state = DeviceManager::State_Remembered);
void setSourceModel(QAbstractItemModel *sourceModel);
signals:
signals:
void IsEmptyChanged(bool is_empty);
protected:
protected:
bool filterAcceptsRow(int row, const QModelIndex &parent) const;
private slots:
private slots:
void ProxyRowCountChanged();
void ProxyRowCountChanged(QModelIndex index, int first, int last);
private:
private:
DeviceManager::State state_;
};

View File

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

View File

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

View File

@ -40,7 +40,7 @@ class GPodLoader : public QObject {
Q_OBJECT
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();
void set_music_path_prefix(const QString &prefix) { path_prefix_ = prefix; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -38,7 +38,7 @@ class TrackSelectionDialog : public QDialog {
Q_OBJECT
public:
TrackSelectionDialog(QWidget *parent = nullptr);
explicit TrackSelectionDialog(QWidget *parent = nullptr);
~TrackSelectionDialog();
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 {
public:
AlsaDeviceFinder();
explicit AlsaDeviceFinder();
virtual bool Initialise() { return true; }
virtual QList<Device> ListDevices();

View File

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

View File

@ -32,7 +32,7 @@ class GstElementDeleter : public QObject {
Q_OBJECT
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.
// 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
public:
GstEngine(TaskManager *task_manager);
explicit GstEngine(TaskManager *task_manager);
~GstEngine();
bool Init();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -47,7 +47,7 @@ class GlobalShortcutGrabber : public QDialog {
Q_OBJECT
public:
GlobalShortcutGrabber(QWidget *parent = nullptr);
explicit GlobalShortcutGrabber(QWidget *parent = nullptr);
~GlobalShortcutGrabber();
QKeySequence GetKey(const QString &name);
@ -59,7 +59,7 @@ class GlobalShortcutGrabber : public QDialog {
void grabKeyboard();
void releaseKeyboard();
private slots:
private slots:
void Accepted();
void Rejected();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -60,7 +60,7 @@ class InternetSearchView : public QWidget {
Q_OBJECT
public:
InternetSearchView(QWidget *parent = nullptr);
explicit InternetSearchView(QWidget *parent = nullptr);
~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);

View File

@ -39,7 +39,7 @@ class InternetService : public QObject {
Q_OBJECT
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 void Exit() {}

View File

@ -40,7 +40,7 @@ class InternetSongsView : public QWidget {
Q_OBJECT
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();
void ReloadSettings();

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