aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cvs
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-11-19 16:47:46 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-11-23 08:35:19 +0000
commit96bc63e0e7e92fc2b2748d47704ff1235bfee7b0 (patch)
tree467c305c0f6fda0d27f7ea30337c06cc51338d3a /src/plugins/cvs
parent325769108886af7628dd4681c9a201d07e05b059 (diff)
CVS: Use Qt5-style connects
The heavy lifting was done by clazy. Change-Id: I8a36528605e5de791ece191e94a0911112b5a237 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cvs')
-rw-r--r--src/plugins/cvs/cvsplugin.cpp48
-rw-r--r--src/plugins/cvs/cvsplugin.h21
2 files changed, 34 insertions, 35 deletions
diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp
index f03c1b85d90..661e4584a41 100644
--- a/src/plugins/cvs/cvsplugin.cpp
+++ b/src/plugins/cvs/cvsplugin.cpp
@@ -250,7 +250,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+D") : tr("Alt+C,Alt+D")));
- connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
+ connect(m_diffCurrentAction, &QAction::triggered, this, &CvsPlugin::diffCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -258,8 +258,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::filelogCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -267,8 +266,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::annotateCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -279,7 +277,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+A") : tr("Alt+C,Alt+A")));
- connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
+ connect(m_addAction, &QAction::triggered, this, &CvsPlugin::addCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -288,7 +286,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
CMD_ID_COMMIT_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+C,Meta+C") : tr("Alt+C,Alt+C")));
- connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
+ connect(m_commitCurrentAction, &QAction::triggered, this, &CvsPlugin::startCommitCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -304,7 +302,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::revertCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -313,20 +311,20 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_editCurrentAction = new ParameterAction(tr("Edit"), tr("Edit \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_editCurrentAction, CMD_ID_EDIT_FILE, context);
command->setAttribute(Command::CA_UpdateText);
- connect(m_editCurrentAction, SIGNAL(triggered()), this, SLOT(editCurrentFile()));
+ connect(m_editCurrentAction, &QAction::triggered, this, &CvsPlugin::editCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_uneditCurrentAction = new ParameterAction(tr("Unedit"), tr("Unedit \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_uneditCurrentAction, CMD_ID_UNEDIT_FILE, context);
command->setAttribute(Command::CA_UpdateText);
- connect(m_uneditCurrentAction, SIGNAL(triggered()), this, SLOT(uneditCurrentFile()));
+ connect(m_uneditCurrentAction, &QAction::triggered, this, &CvsPlugin::uneditCurrentFile);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_uneditRepositoryAction = new QAction(tr("Unedit Repository"), this);
command = ActionManager::registerAction(m_uneditRepositoryAction, CMD_ID_UNEDIT_REPOSITORY, context);
- connect(m_uneditRepositoryAction, SIGNAL(triggered()), this, SLOT(uneditCurrentRepository()));
+ connect(m_uneditRepositoryAction, &QAction::triggered, this, &CvsPlugin::uneditCurrentRepository);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -336,7 +334,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::diffProject);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -344,28 +342,28 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::projectStatus);
cvsMenu->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, &CvsPlugin::logProject);
cvsMenu->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);
command->setAttribute(Command::CA_UpdateText);
- connect(m_updateProjectAction, SIGNAL(triggered()), this, SLOT(updateProject()));
+ connect(m_updateProjectAction, &QAction::triggered, this, &CvsPlugin::updateProject);
cvsMenu->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_PROJECTCOMMIT, context);
command->setAttribute(Command::CA_UpdateText);
- connect(m_commitProjectAction, SIGNAL(triggered()), this, SLOT(commitProject()));
+ connect(m_commitProjectAction, &QAction::triggered, this, &CvsPlugin::commitProject);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -374,7 +372,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_updateDirectoryAction = new ParameterAction(tr("Update Directory"), tr("Update Directory \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_updateDirectoryAction, CMD_ID_UPDATE_DIRECTORY, context);
command->setAttribute(Command::CA_UpdateText);
- connect(m_updateDirectoryAction, SIGNAL(triggered()), this, SLOT(updateDirectory()));
+ connect(m_updateDirectoryAction, &QAction::triggered, this, &CvsPlugin::updateDirectory);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -382,7 +380,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = ActionManager::registerAction(m_commitDirectoryAction,
CMD_ID_COMMIT_DIRECTORY, context);
command->setAttribute(Command::CA_UpdateText);
- connect(m_commitDirectoryAction, SIGNAL(triggered()), this, SLOT(startCommitDirectory()));
+ connect(m_commitDirectoryAction, &QAction::triggered, this, &CvsPlugin::startCommitDirectory);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -390,39 +388,39 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
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, &CvsPlugin::diffRepository);
cvsMenu->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, &CvsPlugin::statusRepository);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_logRepositoryAction = new QAction(tr("Repository Log"), this);
command = ActionManager::registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, context);
- connect(m_logRepositoryAction, SIGNAL(triggered()), this, SLOT(logRepository()));
+ connect(m_logRepositoryAction, &QAction::triggered, this, &CvsPlugin::logRepository);
cvsMenu->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, &CvsPlugin::updateRepository);
cvsMenu->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, &CvsPlugin::startCommitAll);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(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, &CvsPlugin::revertAll);
cvsMenu->addAction(command);
m_commandLocator->appendCommand(command);
@@ -432,7 +430,7 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, cvscommitcontext);
command->setAttribute(Command::CA_UpdateText);
- connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
+ connect(m_submitCurrentLogAction, &QAction::triggered, this, &CvsPlugin::submitCurrentLog);
m_submitDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
ActionManager::registerAction(m_submitDiffAction , DIFF_SELECTED, cvscommitcontext);
diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h
index c94ed8767e4..83ae4a1f8d6 100644
--- a/src/plugins/cvs/cvsplugin.h
+++ b/src/plugins/cvs/cvsplugin.h
@@ -98,6 +98,17 @@ public slots:
const QString &revision, int lineNumber);
private slots:
+#ifdef WITH_TESTS
+ void testDiffFileResolving_data();
+ void testDiffFileResolving();
+ void testLogResolving();
+#endif
+
+protected:
+ void updateActions(VcsBase::VcsBasePlugin::ActionState);
+ bool submitEditorAboutToClose();
+
+private:
void addCurrentFile();
void revertCurrentFile();
void diffProject();
@@ -123,17 +134,7 @@ private slots:
void editCurrentFile();
void uneditCurrentFile();
void uneditCurrentRepository();
-#ifdef WITH_TESTS
- void testDiffFileResolving_data();
- void testDiffFileResolving();
- void testLogResolving();
-#endif
-protected:
- void updateActions(VcsBase::VcsBasePlugin::ActionState);
- bool submitEditorAboutToClose();
-
-private:
bool isCommitEditorOpen() const;
Core::IEditor *showOutputInEditor(const QString& title, const QString &output,
int editorType, const QString &source,