Add explicit
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -37,7 +37,7 @@ class CddaLister : public DeviceLister {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CddaLister() {}
|
||||
explicit CddaLister() {}
|
||||
|
||||
QStringList DeviceUniqueIDs();
|
||||
QVariantList DeviceIcons(const QString &id);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -49,7 +49,7 @@ class GioLister : public DeviceLister {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GioLister() {}
|
||||
explicit GioLister() {}
|
||||
~GioLister();
|
||||
|
||||
int priority() const { return 50; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
class iLister : public DeviceLister {
|
||||
Q_OBJECT
|
||||
public:
|
||||
iLister();
|
||||
explicit iLister();
|
||||
~iLister();
|
||||
|
||||
int priority() const { return 120; }
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
class iMobileDeviceConnection {
|
||||
public:
|
||||
iMobileDeviceConnection(const QString &uuid);
|
||||
explicit iMobileDeviceConnection(const QString &uuid);
|
||||
~iMobileDeviceConnection();
|
||||
|
||||
afc_client_t afc() { return afc_; }
|
||||
|
||||
@@ -42,7 +42,7 @@ class MacOsDeviceLister : public DeviceLister {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacOsDeviceLister();
|
||||
explicit MacOsDeviceLister();
|
||||
~MacOsDeviceLister();
|
||||
|
||||
QStringList DeviceUniqueIDs();
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -49,7 +49,7 @@ class Udisks2Lister : public DeviceLister {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Udisks2Lister();
|
||||
explicit Udisks2Lister();
|
||||
~Udisks2Lister();
|
||||
|
||||
QStringList DeviceUniqueIDs() override;
|
||||
|
||||
Reference in New Issue
Block a user