Browse Source

Use uniform initialization on some default arguments

adaptive-webui-19844
thalieht 6 years ago
parent
commit
89dce36e98
  1. 2
      src/app/cmdoptions.cpp
  2. 2
      src/base/bittorrent/magneturi.h
  3. 2
      src/base/bittorrent/session.h
  4. 2
      src/base/bittorrent/torrentinfo.h
  5. 2
      src/base/logger.h
  6. 4
      src/base/net/smtp.h
  7. 2
      src/base/preferences.h
  8. 4
      src/base/scanfoldersmodel.h
  9. 2
      src/base/settingsstorage.h
  10. 4
      src/base/torrentfileguard.h
  11. 2
      src/base/utils/foreignapps.cpp
  12. 2
      src/gui/addnewtorrentdialog.h
  13. 2
      src/gui/autoexpandabledialog.h
  14. 6
      src/gui/categoryfiltermodel.h
  15. 10
      src/gui/cookiesmodel.h
  16. 2
      src/gui/mainwindow.h
  17. 2
      src/gui/search/searchsortmodel.h
  18. 4
      src/gui/tagfiltermodel.h
  19. 2
      src/gui/torrentcategorydialog.h
  20. 6
      src/gui/torrentcontentmodel.h
  21. 2
      src/gui/torrentcreatordialog.h
  22. 2
      src/gui/transferlistmodel.h

2
src/app/cmdoptions.cpp

@ -159,7 +159,7 @@ namespace
.arg(fullParameter()).arg(QLatin1String("<value>"))); .arg(fullParameter()).arg(QLatin1String("<value>")));
} }
QString value(const QProcessEnvironment &env, const QString &defaultValue = QString()) const QString value(const QProcessEnvironment &env, const QString &defaultValue = {}) const
{ {
QString val = env.value(envVarName()); QString val = env.value(envVarName());
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, QLatin1String("'\"")); return val.isEmpty() ? defaultValue : Utils::String::unquote(val, QLatin1String("'\""));

2
src/base/bittorrent/magneturi.h

@ -43,7 +43,7 @@ namespace BitTorrent
class MagnetUri class MagnetUri
{ {
public: public:
explicit MagnetUri(const QString &source = QString()); explicit MagnetUri(const QString &source = {});
bool isValid() const; bool isValid() const;
InfoHash hash() const; InfoHash hash() const;

2
src/base/bittorrent/session.h

@ -581,7 +581,7 @@ namespace BitTorrent
bool addTorrent_impl(CreateTorrentParams params, const MagnetUri &magnetUri, bool addTorrent_impl(CreateTorrentParams params, const MagnetUri &magnetUri,
TorrentInfo torrentInfo = TorrentInfo(), TorrentInfo torrentInfo = TorrentInfo(),
const QByteArray &fastresumeData = QByteArray()); const QByteArray &fastresumeData = {});
bool findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const; bool findIncompleteFiles(TorrentInfo &torrentInfo, QString &savePath) const;
void updateSeedingLimitTimer(); void updateSeedingLimitTimer();

2
src/base/bittorrent/torrentinfo.h

@ -57,7 +57,7 @@ namespace BitTorrent
typedef boost::shared_ptr<const libtorrent::torrent_info> NativeConstPtr; typedef boost::shared_ptr<const libtorrent::torrent_info> NativeConstPtr;
typedef boost::shared_ptr<libtorrent::torrent_info> NativePtr; typedef boost::shared_ptr<libtorrent::torrent_info> NativePtr;
explicit TorrentInfo(NativeConstPtr nativeInfo = NativeConstPtr()); explicit TorrentInfo(NativeConstPtr nativeInfo = {});
TorrentInfo(const TorrentInfo &other); TorrentInfo(const TorrentInfo &other);
static TorrentInfo load(const QByteArray &data, QString *error = nullptr) noexcept; static TorrentInfo load(const QByteArray &data, QString *error = nullptr) noexcept;

2
src/base/logger.h

@ -79,7 +79,7 @@ public:
static Logger *instance(); static Logger *instance();
void addMessage(const QString &message, const Log::MsgType &type = Log::NORMAL); void addMessage(const QString &message, const Log::MsgType &type = Log::NORMAL);
void addPeer(const QString &ip, bool blocked, const QString &reason = QString()); void addPeer(const QString &ip, bool blocked, const QString &reason = {});
QVector<Log::Msg> getMessages(int lastKnownId = -1) const; QVector<Log::Msg> getMessages(int lastKnownId = -1) const;
QVector<Log::Peer> getPeers(int lastKnownId = -1) const; QVector<Log::Peer> getPeers(int lastKnownId = -1) const;

4
src/base/net/smtp.h

@ -90,13 +90,13 @@ namespace Net
AuthCramMD5 AuthCramMD5
}; };
QByteArray encodeMimeHeader(const QString &key, const QString &value, QTextCodec *latin1, const QByteArray &prefix = QByteArray()); QByteArray encodeMimeHeader(const QString &key, const QString &value, QTextCodec *latin1, const QByteArray &prefix = {});
void ehlo(); void ehlo();
void helo(); void helo();
void parseEhloResponse(const QByteArray &code, bool continued, const QString &line); void parseEhloResponse(const QByteArray &code, bool continued, const QString &line);
void authenticate(); void authenticate();
void startTLS(); void startTLS();
void authCramMD5(const QByteArray &challenge = QByteArray()); void authCramMD5(const QByteArray &challenge = {});
void authPlain(); void authPlain();
void authLogin(); void authLogin();
void logError(const QString &msg); void logError(const QString &msg);

2
src/base/preferences.h

@ -83,7 +83,7 @@ class Preferences : public QObject
Preferences(); Preferences();
const QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const; const QVariant value(const QString &key, const QVariant &defaultValue = {}) const;
void setValue(const QString &key, const QVariant &value); void setValue(const QString &key, const QVariant &value);
static Preferences *m_instance; static Preferences *m_instance;

4
src/base/scanfoldersmodel.h

@ -70,8 +70,8 @@ public:
static QString pathTypeDisplayName(PathType type); static QString pathTypeDisplayName(PathType type);
int rowCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = {}) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = {}) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const; Qt::ItemFlags flags(const QModelIndex &index) const;

2
src/base/settingsstorage.h

@ -46,7 +46,7 @@ public:
static void freeInstance(); static void freeInstance();
static SettingsStorage *instance(); static SettingsStorage *instance();
QVariant loadValue(const QString &key, const QVariant &defaultValue = QVariant()) const; QVariant loadValue(const QString &key, const QVariant &defaultValue = {}) const;
void storeValue(const QString &key, const QVariant &value); void storeValue(const QString &key, const QVariant &value);
void removeValue(const QString &key); void removeValue(const QString &key);

4
src/base/torrentfileguard.h

@ -37,7 +37,7 @@ template <typename T> class CachedSettingValue;
class FileGuard class FileGuard
{ {
public: public:
explicit FileGuard(const QString &path = QString()); explicit FileGuard(const QString &path = {});
~FileGuard(); ~FileGuard();
/// Cancels or re-enables deferred file deletion /// Cancels or re-enables deferred file deletion
@ -55,7 +55,7 @@ class TorrentFileGuard : private FileGuard
Q_GADGET Q_GADGET
public: public:
explicit TorrentFileGuard(const QString &path = QString()); explicit TorrentFileGuard(const QString &path = {});
~TorrentFileGuard(); ~TorrentFileGuard();
/// marks the torrent file as loaded (added) into the BitTorrent::Session /// marks the torrent file as loaded (added) into the BitTorrent::Session

2
src/base/utils/foreignapps.cpp

@ -119,7 +119,7 @@ namespace
return keys; return keys;
} }
QString getRegValue(const HKEY handle, const QString &name = QString()) QString getRegValue(const HKEY handle, const QString &name = {})
{ {
QString result; QString result;

2
src/gui/addnewtorrentdialog.h

@ -98,7 +98,7 @@ private:
int indexOfSavePath(const QString &savePath); int indexOfSavePath(const QString &savePath);
void loadState(); void loadState();
void saveState(); void saveState();
void setMetadataProgressIndicator(bool visibleIndicator, const QString &labelText = QString()); void setMetadataProgressIndicator(bool visibleIndicator, const QString &labelText = {});
void setupTreeview(); void setupTreeview();
void setCommentText(const QString &str) const; void setCommentText(const QString &str) const;
void setSavePath(const QString &newPath); void setSavePath(const QString &newPath);

2
src/gui/autoexpandabledialog.h

@ -47,7 +47,7 @@ public:
~AutoExpandableDialog(); ~AutoExpandableDialog();
static QString getText(QWidget *parent, const QString &title, const QString &label, static QString getText(QWidget *parent, const QString &title, const QString &label,
QLineEdit::EchoMode mode = QLineEdit::Normal, const QString &text = QString(), QLineEdit::EchoMode mode = QLineEdit::Normal, const QString &text = {},
bool *ok = nullptr, bool excludeExtension = false, Qt::InputMethodHints inputMethodHints = Qt::ImhNone); bool *ok = nullptr, bool excludeExtension = false, Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
protected: protected:

6
src/gui/categoryfiltermodel.h

@ -49,13 +49,13 @@ public:
static bool isSpecialItem(const QModelIndex &index); static bool isSpecialItem(const QModelIndex &index);
int columnCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = {}) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
QModelIndex parent(const QModelIndex &index) const override; QModelIndex parent(const QModelIndex &index) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = {}) const override;
QModelIndex index(const QString &categoryName) const; QModelIndex index(const QString &categoryName) const;
QString categoryName(const QModelIndex &index) const; QString categoryName(const QModelIndex &index) const;

10
src/gui/cookiesmodel.h

@ -54,18 +54,18 @@ public:
QList<QNetworkCookie> cookies() const; QList<QNetworkCookie> cookies() const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
QModelIndex parent(const QModelIndex &index) const override; QModelIndex parent(const QModelIndex &index) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = {}) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = {}) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override; bool setData(const QModelIndex &index, const QVariant &value, int role) override;
bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; bool insertRows(int row, int count, const QModelIndex &parent = {}) override;
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; bool removeRows(int row, int count, const QModelIndex &parent = {}) override;
private: private:
mutable QList<QNetworkCookie> m_cookies; mutable QList<QNetworkCookie> m_cookies;

2
src/gui/mainwindow.h

@ -209,7 +209,7 @@ private:
bool event(QEvent *e) override; bool event(QEvent *e) override;
void displayRSSTab(bool enable); void displayRSSTab(bool enable);
void displaySearchTab(bool enable); void displaySearchTab(bool enable);
void createTorrentTriggered(const QString &path = QString()); void createTorrentTriggered(const QString &path = {});
void showStatusBar(bool show); void showStatusBar(bool show);
Ui::MainWindow *m_ui; Ui::MainWindow *m_ui;

2
src/gui/search/searchsortmodel.h

@ -53,7 +53,7 @@ public:
explicit SearchSortModel(QObject *parent = nullptr); explicit SearchSortModel(QObject *parent = nullptr);
void enableNameFilter(bool enabled); void enableNameFilter(bool enabled);
void setNameFilter(const QString &searchTerm = QString()); void setNameFilter(const QString &searchTerm = {});
//! \brief Sets parameters for filtering by size //! \brief Sets parameters for filtering by size
//! \param minSize minimal size in bytes //! \param minSize minimal size in bytes

4
src/gui/tagfiltermodel.h

@ -54,8 +54,8 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = {}) const override;
QModelIndex index(const QString &tag) const; QModelIndex index(const QString &tag) const;
QString tag(const QModelIndex &index) const; QString tag(const QModelIndex &index) const;

2
src/gui/torrentcategorydialog.h

@ -41,7 +41,7 @@ class TorrentCategoryDialog : public QDialog
Q_DISABLE_COPY(TorrentCategoryDialog) Q_DISABLE_COPY(TorrentCategoryDialog)
public: public:
static QString createCategory(QWidget *parent, const QString &parentCategoryName = QString()); static QString createCategory(QWidget *parent, const QString &parentCategoryName = {});
static void editCategory(QWidget *parent, const QString &categoryName); static void editCategory(QWidget *parent, const QString &categoryName);
explicit TorrentCategoryDialog(QWidget *parent = nullptr); explicit TorrentCategoryDialog(QWidget *parent = nullptr);

6
src/gui/torrentcontentmodel.h

@ -53,16 +53,16 @@ public:
void updateFilesAvailability(const QVector<qreal> &fa); void updateFilesAvailability(const QVector<qreal> &fa);
QVector<int> getFilePriorities() const; QVector<int> getFilePriorities() const;
bool allFiltered() const; bool allFiltered() const;
int columnCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = {}) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
TorrentContentModelItem::ItemType itemType(const QModelIndex &index) const; TorrentContentModelItem::ItemType itemType(const QModelIndex &index) const;
int getFileIndex(const QModelIndex &index); int getFileIndex(const QModelIndex &index);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
QModelIndex parent(const QModelIndex &index) const override; QModelIndex parent(const QModelIndex &index) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = {}) const override;
void clear(); void clear();
void setupModelData(const BitTorrent::TorrentInfo &info); void setupModelData(const BitTorrent::TorrentInfo &info);

2
src/gui/torrentcreatordialog.h

@ -49,7 +49,7 @@ class TorrentCreatorDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
TorrentCreatorDialog(QWidget *parent = nullptr, const QString &defaultPath = QString()); TorrentCreatorDialog(QWidget *parent = nullptr, const QString &defaultPath = {});
~TorrentCreatorDialog() override; ~TorrentCreatorDialog() override;
void updateInputPath(const QString &path); void updateInputPath(const QString &path);

2
src/gui/transferlistmodel.h

@ -83,7 +83,7 @@ public:
explicit TransferListModel(QObject *parent = nullptr); explicit TransferListModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &index = QModelIndex()) const override; int rowCount(const QModelIndex &index = {}) const override;
int columnCount(const QModelIndex &parent=QModelIndex()) const override; int columnCount(const QModelIndex &parent=QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override; bool setData(const QModelIndex &index, const QVariant &value, int role) override;

Loading…
Cancel
Save