Subversion: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I9ed81a33b27b85773218e943ba39c2ac5d88adf3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-11-19 16:50:42 +01:00
parent a1c2a0fde4
commit 947e821743
2 changed files with 31 additions and 32 deletions

View File

@@ -251,7 +251,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
CMD_ID_DIFF_CURRENT, context); CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+D") : tr("Alt+S,Alt+D"))); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -259,8 +259,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
command = ActionManager::registerAction(m_filelogCurrentAction, command = ActionManager::registerAction(m_filelogCurrentAction,
CMD_ID_FILELOG_CURRENT, context); CMD_ID_FILELOG_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, connect(m_filelogCurrentAction, &QAction::triggered, this, &SubversionPlugin::filelogCurrentFile);
SLOT(filelogCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -268,8 +267,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
command = ActionManager::registerAction(m_annotateCurrentAction, command = ActionManager::registerAction(m_annotateCurrentAction,
CMD_ID_ANNOTATE_CURRENT, context); CMD_ID_ANNOTATE_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, connect(m_annotateCurrentAction, &QAction::triggered, this, &SubversionPlugin::annotateCurrentFile);
SLOT(annotateCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -280,7 +278,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+A") : tr("Alt+S,Alt+A"))); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
@@ -289,7 +287,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
CMD_ID_COMMIT_CURRENT, context); CMD_ID_COMMIT_CURRENT, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+S,Meta+C") : tr("Alt+S,Alt+C"))); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(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, command = ActionManager::registerAction(m_revertAction, CMD_ID_REVERT,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertAction, &QAction::triggered, this, &SubversionPlugin::revertCurrentFile);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(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, command = ActionManager::registerAction(m_diffProjectAction, CMD_ID_DIFF_PROJECT,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffProject())); connect(m_diffProjectAction, &QAction::triggered, this, &SubversionPlugin::diffProject);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(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, command = ActionManager::registerAction(m_statusProjectAction, CMD_ID_STATUS,
context); context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(projectStatus())); connect(m_statusProjectAction, &QAction::triggered, this, &SubversionPlugin::projectStatus);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this); m_logProjectAction = new ParameterAction(tr("Log Project"), tr("Log Project \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context); command = ActionManager::registerAction(m_logProjectAction, CMD_ID_PROJECTLOG, context);
command->setAttribute(Command::CA_UpdateText); command->setAttribute(Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); connect(m_logProjectAction, &QAction::triggered, this, &SubversionPlugin::logProject);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this); m_updateProjectAction = new ParameterAction(tr("Update Project"), tr("Update Project \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_updateProjectAction, CMD_ID_UPDATE, context); 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); command->setAttribute(Command::CA_UpdateText);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this); m_commitProjectAction = new ParameterAction(tr("Commit Project"), tr("Commit Project \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_commitProjectAction, CMD_ID_COMMIT_PROJECT, context); 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); command->setAttribute(Command::CA_UpdateText);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(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); m_diffRepositoryAction = new QAction(tr("Diff Repository"), this);
command = ActionManager::registerAction(m_diffRepositoryAction, CMD_ID_REPOSITORYDIFF, context); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_statusRepositoryAction = new QAction(tr("Repository Status"), this); m_statusRepositoryAction = new QAction(tr("Repository Status"), this);
command = ActionManager::registerAction(m_statusRepositoryAction, CMD_ID_REPOSITORYSTATUS, context); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_logRepositoryAction = new QAction(tr("Log Repository"), this); m_logRepositoryAction = new QAction(tr("Log Repository"), this);
command = ActionManager::registerAction(m_logRepositoryAction, CMD_ID_REPOSITORYLOG, context); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_updateRepositoryAction = new QAction(tr("Update Repository"), this); m_updateRepositoryAction = new QAction(tr("Update Repository"), this);
command = ActionManager::registerAction(m_updateRepositoryAction, CMD_ID_REPOSITORYUPDATE, context); 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); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_commitAllAction = new QAction(tr("Commit All Files"), this); m_commitAllAction = new QAction(tr("Commit All Files"), this);
command = ActionManager::registerAction(m_commitAllAction, CMD_ID_COMMIT_ALL, command = ActionManager::registerAction(m_commitAllAction, CMD_ID_COMMIT_ALL,
context); context);
connect(m_commitAllAction, SIGNAL(triggered()), this, SLOT(startCommitAll())); connect(m_commitAllAction, &QAction::triggered, this, &SubversionPlugin::startCommitAll);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_describeAction = new QAction(tr("Describe..."), this); m_describeAction = new QAction(tr("Describe..."), this);
command = ActionManager::registerAction(m_describeAction, CMD_ID_DESCRIBE, context); 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); subversionMenu->addAction(command);
m_revertRepositoryAction = new QAction(tr("Revert Repository..."), this); m_revertRepositoryAction = new QAction(tr("Revert Repository..."), this);
command = ActionManager::registerAction(m_revertRepositoryAction, CMD_ID_REVERT_ALL, command = ActionManager::registerAction(m_revertRepositoryAction, CMD_ID_REVERT_ALL,
context); context);
connect(m_revertRepositoryAction, SIGNAL(triggered()), this, SLOT(revertAll())); connect(m_revertRepositoryAction, &QAction::triggered, this, &SubversionPlugin::revertAll);
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_commandLocator->appendCommand(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); m_submitCurrentLogAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, svncommitcontext); command = ActionManager::registerAction(m_submitCurrentLogAction, SUBMIT_CURRENT, svncommitcontext);
command->setAttribute(Command::CA_UpdateText); 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); m_submitDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
ActionManager::registerAction(m_submitDiffAction , DIFF_SELECTED, svncommitcontext); ActionManager::registerAction(m_submitDiffAction , DIFF_SELECTED, svncommitcontext);

View File

@@ -95,10 +95,22 @@ public:
unsigned flags, QTextCodec *outputCodec = 0) const; unsigned flags, QTextCodec *outputCodec = 0) const;
public slots: 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, void vcsAnnotate(const QString &workingDir, const QString &file,
const QString &revision = QString(), int lineNumber = -1); const QString &revision = QString(), int lineNumber = -1);
#ifdef WITH_TESTS
private slots: private slots:
void testLogResolving();
#endif
protected:
void updateActions(VcsBase::VcsBasePlugin::ActionState);
bool submitEditorAboutToClose();
private:
void addCurrentFile(); void addCurrentFile();
void revertCurrentFile(); void revertCurrentFile();
void diffProject(); void diffProject();
@@ -110,10 +122,7 @@ private slots:
void revertAll(); void revertAll();
void filelogCurrentFile(); void filelogCurrentFile();
void annotateCurrentFile(); void annotateCurrentFile();
void annotateVersion(const QString &workingDirectory, const QString &file,
const QString &revision, int lineNumber);
void projectStatus(); void projectStatus();
void describe(const QString &source, const QString &changeNr);
void slotDescribe(); void slotDescribe();
void updateProject(); void updateProject();
void submitCurrentLog(); void submitCurrentLog();
@@ -123,15 +132,7 @@ private slots:
void diffRepository(); void diffRepository();
void statusRepository(); void statusRepository();
void updateRepository(); void updateRepository();
#ifdef WITH_TESTS
void testLogResolving();
#endif
protected:
void updateActions(VcsBase::VcsBasePlugin::ActionState);
bool submitEditorAboutToClose();
private:
inline bool isCommitEditorOpen() const; inline bool isCommitEditorOpen() const;
Core::IEditor *showOutputInEditor(const QString &title, const QString &output, Core::IEditor *showOutputInEditor(const QString &title, const QString &output,
int editorType, const QString &source, int editorType, const QString &source,