diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-11-19 16:50:42 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-11-23 09:01:51 +0000 |
commit | 947e821743c9ef662ae599e7e54519edd83c7ac5 (patch) | |
tree | b4a70636a91f76a4d6528d86202d69410acef940 /src/plugins/subversion | |
parent | a1c2a0fde42be66379ae5b282788dea492a2b460 (diff) | |
download | qt-creator-947e821743c9ef662ae599e7e54519edd83c7ac5.tar.gz |
Subversion: Use Qt5-style connects
The heavy lifting was done by clazy.
Change-Id: I9ed81a33b27b85773218e943ba39c2ac5d88adf3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/subversion')
-rw-r--r-- | src/plugins/subversion/subversionplugin.cpp | 40 | ||||
-rw-r--r-- | src/plugins/subversion/subversionplugin.h | 23 |
2 files changed, 31 insertions, 32 deletions
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 2eadd77843..951e967d74 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -251,7 +251,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e CMD_ID_DIFF_CURRENT, context); command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D"))); - connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); + connect(m_diffCurrentAction, &QAction::triggered, this, &SubversionPlugin::diffCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -259,8 +259,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e command = ActionManager::registerAction(m_filelogCurrentAction, CMD_ID_FILELOG_CURRENT, context); command->setAttribute(Command::CA_UpdateText); - connect(m_filelogCurrentAction, SIGNAL(triggered()), this, - SLOT(filelogCurrentFile())); + connect(m_filelogCurrentAction, &QAction::triggered, this, &SubversionPlugin::filelogCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -268,8 +267,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e command = ActionManager::registerAction(m_annotateCurrentAction, CMD_ID_ANNOTATE_CURRENT, context); command->setAttribute(Command::CA_UpdateText); - connect(m_annotateCurrentAction, SIGNAL(triggered()), this, - SLOT(annotateCurrentFile())); + connect(m_annotateCurrentAction, &QAction::triggered, this, &SubversionPlugin::annotateCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -280,7 +278,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e context); command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A"))); - connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); + connect(m_addAction, &QAction::triggered, this, &SubversionPlugin::addCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -289,7 +287,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e CMD_ID_COMMIT_CURRENT, context); command->setAttribute(Command::CA_UpdateText); command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C"))); - connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); + connect(m_commitCurrentAction, &QAction::triggered, this, &SubversionPlugin::startCommitCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -305,7 +303,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e command = ActionManager::registerAction(m_revertAction, CMD_ID_REVERT, context); command->setAttribute(Command::CA_UpdateText); - connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); + connect(m_revertAction, &QAction::triggered, this, &SubversionPlugin::revertCurrentFile); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -315,7 +313,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT, context); command->setAttribute(Command::CA_UpdateText); - connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffProject())); + connect(m_diffProjectAction, &QAction::triggered, this, &SubversionPlugin::diffProject); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -323,27 +321,27 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS, context); command->setAttribute(Command::CA_UpdateText); - connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(projectStatus())); + connect(m_statusProjectAction, &QAction::triggered, this, &SubversionPlugin::projectStatus); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context); command->setAttribute(Command::CA_UpdateText); - connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); + connect(m_logProjectAction, &QAction::triggered, this, &SubversionPlugin::logProject); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context); - connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateProject())); + connect(m_updateProjectAction, &QAction::triggered, this, &SubversionPlugin::updateProject); command->setAttribute(Command::CA_UpdateText); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this); command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_COMMIT_PROJECT, context); - connect(m_commitProjectAction, SIGNAL(triggered()), this, SLOT(startCommitProject())); + connect(m_commitProjectAction, &QAction::triggered, this, &SubversionPlugin::startCommitProject); command->setAttribute(Command::CA_UpdateText); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -352,44 +350,44 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e m_diffRepositoryAction = new QAction(tr("Diff Repository"), this); command = ActionManager::registerAction(m_diffRepositoryAction, CMD_ID_REPOSITORYDIFF, context); - connect(m_diffRepositoryAction, SIGNAL(triggered()), this, SLOT(diffRepository())); + connect(m_diffRepositoryAction, &QAction::triggered, this, &SubversionPlugin::diffRepository); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_statusRepositoryAction = new QAction(tr("Repository Status"), this); command = ActionManager::registerAction(m_statusRepositoryAction, CMD_ID_REPOSITORYSTATUS, context); - connect(m_statusRepositoryAction, SIGNAL(triggered()), this, SLOT(statusRepository())); + connect(m_statusRepositoryAction, &QAction::triggered, this, &SubversionPlugin::statusRepository); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_logRepositoryAction = new QAction(tr("Log Repository"), this); command = ActionManager::registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, context); - connect(m_logRepositoryAction, SIGNAL(triggered()), this, SLOT(logRepository())); + connect(m_logRepositoryAction, &QAction::triggered, this, &SubversionPlugin::logRepository); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_updateRepositoryAction = new QAction(tr("Update Repository"), this); command = ActionManager::registerAction(m_updateRepositoryAction, CMD_ID_REPOSITORYUPDATE, context); - connect(m_updateRepositoryAction, SIGNAL(triggered()), this, SLOT(updateRepository())); + connect(m_updateRepositoryAction, &QAction::triggered, this, &SubversionPlugin::updateRepository); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_commitAllAction = new QAction(tr("Commit All Files"), this); command = ActionManager::registerAction(m_commitAllAction, CMD_ID_COMMIT_ALL, context); - connect(m_commitAllAction, SIGNAL(triggered()), this, SLOT(startCommitAll())); + connect(m_commitAllAction, &QAction::triggered, this, &SubversionPlugin::startCommitAll); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); m_describeAction = new QAction(tr("Describe..."), this); command = ActionManager::registerAction(m_describeAction, CMD_ID_DESCRIBE, context); - connect(m_describeAction, SIGNAL(triggered()), this, SLOT(slotDescribe())); + connect(m_describeAction, &QAction::triggered, this, &SubversionPlugin::slotDescribe); subversionMenu->addAction(command); m_revertRepositoryAction = new QAction(tr("Revert Repository..."), this); command = ActionManager::registerAction(m_revertRepositoryAction, CMD_ID_REVERT_ALL, context); - connect(m_revertRepositoryAction, SIGNAL(triggered()), this, SLOT(revertAll())); + connect(m_revertRepositoryAction, &QAction::triggered, this, &SubversionPlugin::revertAll); subversionMenu->addAction(command); m_commandLocator->appendCommand(command); @@ -399,7 +397,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, svncommitcontext); command->setAttribute(Command::CA_UpdateText); - connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog())); + connect(m_submitCurrentLogAction, &QAction::triggered, this, &SubversionPlugin::submitCurrentLog); m_submitDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); ActionManager::registerAction(m_submitDiffAction , DIFF_SELECTED, svncommitcontext); diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 4ed1051a7e..3e75ee1eaf 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -95,10 +95,22 @@ public: unsigned flags, QTextCodec *outputCodec = 0) const; public slots: + void annotateVersion(const QString &workingDirectory, const QString &file, + const QString &revision, int lineNumber); + void describe(const QString &source, const QString &changeNr); void vcsAnnotate(const QString &workingDir, const QString &file, const QString &revision = QString(), int lineNumber = -1); +#ifdef WITH_TESTS private slots: + void testLogResolving(); +#endif + +protected: + void updateActions(VcsBase::VcsBasePlugin::ActionState); + bool submitEditorAboutToClose(); + +private: void addCurrentFile(); void revertCurrentFile(); void diffProject(); @@ -110,10 +122,7 @@ private slots: void revertAll(); void filelogCurrentFile(); void annotateCurrentFile(); - void annotateVersion(const QString &workingDirectory, const QString &file, - const QString &revision, int lineNumber); void projectStatus(); - void describe(const QString &source, const QString &changeNr); void slotDescribe(); void updateProject(); void submitCurrentLog(); @@ -123,15 +132,7 @@ private slots: void diffRepository(); void statusRepository(); void updateRepository(); -#ifdef WITH_TESTS - void testLogResolving(); -#endif -protected: - void updateActions(VcsBase::VcsBasePlugin::ActionState); - bool submitEditorAboutToClose(); - -private: inline bool isCommitEditorOpen() const; Core::IEditor *showOutputInEditor(const QString &title, const QString &output, int editorType, const QString &source, |