Add explicit
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -35,7 +35,7 @@ class AlbumCoverExport : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AlbumCoverExport(QWidget *parent = nullptr);
|
||||
explicit AlbumCoverExport(QWidget *parent = nullptr);
|
||||
~AlbumCoverExport();
|
||||
|
||||
enum OverwriteMode {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <QImage>
|
||||
|
||||
struct AlbumCoverLoaderOptions {
|
||||
AlbumCoverLoaderOptions()
|
||||
explicit AlbumCoverLoaderOptions()
|
||||
: desired_height_(120),
|
||||
scale_output_image_(true),
|
||||
pad_output_image_(true) {}
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
struct CoverSearchStatistics {
|
||||
|
||||
CoverSearchStatistics();
|
||||
explicit CoverSearchStatistics();
|
||||
|
||||
CoverSearchStatistics& operator +=(const CoverSearchStatistics &other);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user