From 032f12bacf4e100d274d61edf3a87dc9468529f4 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sun, 19 Feb 2017 09:53:47 +0100 Subject: [PATCH] Transfer to newer connect() usage. --- src/core/feedsmodel.cpp | 12 ++++++------ src/dynamic-shortcuts/shortcutcatcher.cpp | 6 +++--- src/gui/dialogs/formaddaccount.cpp | 9 ++++++--- src/miscellaneous/settings.cpp | 9 ++++----- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 64f7ea746..e7f80d45f 100755 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -488,12 +488,12 @@ bool FeedsModel::addServiceAccount(ServiceRoot *root, bool freshly_activated) { endInsertRows(); // Connect. - connect(root, SIGNAL(itemRemovalRequested(RootItem*)), this, SLOT(removeItem(RootItem*))); - connect(root, SIGNAL(itemReassignmentRequested(RootItem*,RootItem*)), this, SLOT(reassignNodeToNewParent(RootItem*,RootItem*))); - connect(root, SIGNAL(dataChanged(QList)), this, SLOT(onItemDataChanged(QList))); - connect(root, SIGNAL(reloadMessageListRequested(bool)), this, SIGNAL(reloadMessageListRequested(bool))); - connect(root, SIGNAL(itemExpandRequested(QList,bool)), this, SIGNAL(itemExpandRequested(QList,bool))); - connect(root, SIGNAL(itemExpandStateSaveRequested(RootItem*)), this, SIGNAL(itemExpandStateSaveRequested(RootItem*))); + connect(root, &ServiceRoot::itemRemovalRequested, this, static_cast(&FeedsModel::removeItem)); + connect(root, &ServiceRoot::itemReassignmentRequested, this, &FeedsModel::reassignNodeToNewParent); + connect(root, &ServiceRoot::dataChanged, this, &FeedsModel::onItemDataChanged); + connect(root, &ServiceRoot::reloadMessageListRequested, this, &FeedsModel::reloadMessageListRequested); + connect(root, &ServiceRoot::itemExpandRequested, this, &FeedsModel::itemExpandRequested); + connect(root, &ServiceRoot::itemExpandStateSaveRequested, this, &FeedsModel::itemExpandStateSaveRequested); root->start(freshly_activated); return true; diff --git a/src/dynamic-shortcuts/shortcutcatcher.cpp b/src/dynamic-shortcuts/shortcutcatcher.cpp index 52cae0341..6e9184abb 100755 --- a/src/dynamic-shortcuts/shortcutcatcher.cpp +++ b/src/dynamic-shortcuts/shortcutcatcher.cpp @@ -82,9 +82,9 @@ ShortcutCatcher::ShortcutCatcher(QWidget *parent) m_layout->addWidget(m_btnClear); // Establish needed connections. - connect(m_btnReset, SIGNAL(clicked()), this, SLOT(resetShortcut())); - connect(m_btnClear, SIGNAL(clicked()), this, SLOT(clearShortcut())); - connect(m_btnChange, SIGNAL(clicked()), this, SLOT(startRecording())); + connect(m_btnReset, &QToolButton::clicked, this, &ShortcutCatcher::resetShortcut); + connect(m_btnClear, &QToolButton::clicked, this, &ShortcutCatcher::clearShortcut); + connect(m_btnChange, &QToolButton::clicked, this, &ShortcutCatcher::startRecording); // Prepare initial state of the control. updateDisplayShortcut(); diff --git a/src/gui/dialogs/formaddaccount.cpp b/src/gui/dialogs/formaddaccount.cpp index 1949449ab..9854a32ad 100755 --- a/src/gui/dialogs/formaddaccount.cpp +++ b/src/gui/dialogs/formaddaccount.cpp @@ -22,6 +22,9 @@ #include "core/feedsmodel.h" #include "services/standard/standardserviceentrypoint.h" +#include +#include + FormAddAccount::FormAddAccount(const QList &entry_points, FeedsModel *model, QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAddAccount), m_model(model), m_entryPoints(entry_points) { @@ -31,9 +34,9 @@ FormAddAccount::FormAddAccount(const QList &entry_points, Fe setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog | Qt::WindowSystemMenuHint); setWindowIcon(qApp->icons()->fromTheme(QSL("document-new"))); - connect(m_ui->m_listEntryPoints, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addSelectedAccount())); - connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(addSelectedAccount())); - connect(m_ui->m_listEntryPoints, SIGNAL(itemSelectionChanged()), this, SLOT(displayActiveEntryPointDetails())); + connect(m_ui->m_listEntryPoints, &QListWidget::itemDoubleClicked, this, &FormAddAccount::addSelectedAccount); + connect(m_ui->m_buttonBox, &QDialogButtonBox::accepted, this, &FormAddAccount::addSelectedAccount); + connect(m_ui->m_listEntryPoints, &QListWidget::itemSelectionChanged, this, &FormAddAccount::displayActiveEntryPointDetails); loadEntryPoints(); } diff --git a/src/miscellaneous/settings.cpp b/src/miscellaneous/settings.cpp index d9d6313a8..3529cb607 100755 --- a/src/miscellaneous/settings.cpp +++ b/src/miscellaneous/settings.cpp @@ -338,13 +338,8 @@ SettingsProperties Settings::determineProperties() { properties.m_settingsSuffix = QDir::separator() + QString(APP_CFG_PATH) + QDir::separator() + QString(APP_CFG_FILE); - const QString exe_path = qApp->applicationDirPath(); const QString app_path = qApp->getUserDataAppPath(); const QString home_path = qApp->getUserDataHomePath(); - const QString home_path_file = home_path + properties.m_settingsSuffix; - - const bool portable_settings_available = IOFactory::isFolderWritable(exe_path); - const bool non_portable_settings_exist = QFile::exists(home_path_file); // We will use PORTABLE settings only and only if it is available and NON-PORTABLE // settings was not initialized before. @@ -352,6 +347,10 @@ SettingsProperties Settings::determineProperties() { // DO NOT use portable settings for Linux, it is really not used on that platform. const bool will_we_use_portable_settings = false; #else + const QString exe_path = qApp->applicationDirPath(); + const QString home_path_file = home_path + properties.m_settingsSuffix; + const bool portable_settings_available = IOFactory::isFolderWritable(exe_path); + const bool non_portable_settings_exist = QFile::exists(home_path_file); const bool will_we_use_portable_settings = portable_settings_available && !non_portable_settings_exist; #endif