Commit b10766e4 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

ClearCase: Use Qt5-style connects



The heavy lifting was handled by clazy.

Change-Id: Ic86f3d5b16cd60361e68b7915595056a68f5a9ba
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 96bc63e0
......@@ -451,9 +451,9 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
initializeVcs(new ClearCaseControl(this), context);
m_clearcasePluginInstance = this;
connect(ICore::instance(), SIGNAL(coreAboutToClose()), this, SLOT(closing()));
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
this, SLOT(tasksFinished(Core::Id)));
connect(ICore::instance(), &ICore::coreAboutToClose, this, &ClearCasePlugin::closing);
connect(ProgressManager::instance(), &ProgressManager::allTasksFinished,
this, &ClearCasePlugin::tasksFinished);
Utils::MimeDatabase::addMimeTypes(QLatin1String(":/clearcase/ClearCase.mimetypes.xml"));
......@@ -495,7 +495,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+O") : tr("Alt+L,Alt+O")));
connect(m_checkOutAction, SIGNAL(triggered()), this, SLOT(checkOutCurrentFile()));
connect(m_checkOutAction, &QAction::triggered, this, &ClearCasePlugin::checkOutCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -503,7 +503,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_checkInCurrentAction, CMD_ID_CHECKIN, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+I") : tr("Alt+L,Alt+I")));
connect(m_checkInCurrentAction, SIGNAL(triggered()), this, SLOT(startCheckInCurrentFile()));
connect(m_checkInCurrentAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -511,7 +511,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_undoCheckOutAction, CMD_ID_UNDOCHECKOUT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+U") : tr("Alt+L,Alt+U")));
connect(m_undoCheckOutAction, SIGNAL(triggered()), this, SLOT(undoCheckOutCurrent()));
connect(m_undoCheckOutAction, &QAction::triggered, this, &ClearCasePlugin::undoCheckOutCurrent);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -519,7 +519,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
command = ActionManager::registerAction(m_undoHijackAction, CMD_ID_UNDOHIJACK, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+R") : tr("Alt+L,Alt+R")));
connect(m_undoHijackAction, SIGNAL(triggered()), this, SLOT(undoHijackCurrent()));
connect(m_undoHijackAction, &QAction::triggered, this, &ClearCasePlugin::undoHijackCurrent);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -530,7 +530,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
CMD_ID_DIFF_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+D") : tr("Alt+L,Alt+D")));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
connect(m_diffCurrentAction, &QAction::triggered, this, &ClearCasePlugin::diffCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -539,8 +539,8 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
CMD_ID_HISTORY_CURRENT, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+H") : tr("Alt+L,Alt+H")));
connect(m_historyCurrentAction, SIGNAL(triggered()), this,
SLOT(historyCurrentFile()));
connect(m_historyCurrentAction, &QAction::triggered, this,
&ClearCasePlugin::historyCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -549,15 +549,15 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
CMD_ID_ANNOTATE, context);
command->setAttribute(Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+A") : tr("Alt+L,Alt+A")));
connect(m_annotateCurrentAction, SIGNAL(triggered()), this,
SLOT(annotateCurrentFile()));
connect(m_annotateCurrentAction, &QAction::triggered, this,
&ClearCasePlugin::annotateCurrentFile);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_addFileAction = new ParameterAction(tr("Add File..."), tr("Add File \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_addFileAction, CMD_ID_ADD_FILE, context);
command->setAttribute(Command::CA_UpdateText);
connect(m_addFileAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
connect(m_addFileAction, &QAction::triggered, this, &ClearCasePlugin::addCurrentFile);
clearcaseMenu->addAction(command);
clearcaseMenu->addSeparator(context);
......@@ -565,14 +565,14 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_diffActivityAction = new QAction(tr("Diff A&ctivity..."), this);
m_diffActivityAction->setEnabled(false);
command = ActionManager::registerAction(m_diffActivityAction, CMD_ID_DIFF_ACTIVITY, context);
connect(m_diffActivityAction, SIGNAL(triggered()), this, SLOT(diffActivity()));
connect(m_diffActivityAction, &QAction::triggered, this, &ClearCasePlugin::diffActivity);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_checkInActivityAction = new ParameterAction(tr("Ch&eck In Activity"), tr("Chec&k In Activity \"%1\"..."), ParameterAction::EnabledWithParameter, this);
m_checkInActivityAction->setEnabled(false);
command = ActionManager::registerAction(m_checkInActivityAction, CMD_ID_CHECKIN_ACTIVITY, context);
connect(m_checkInActivityAction, SIGNAL(triggered()), this, SLOT(startCheckInActivity()));
connect(m_checkInActivityAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInActivity);
command->setAttribute(Command::CA_UpdateText);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -581,12 +581,12 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_updateIndexAction = new QAction(tr("Update Index"), this);
command = ActionManager::registerAction(m_updateIndexAction, CMD_ID_UPDATEINDEX, context);
connect(m_updateIndexAction, SIGNAL(triggered()), this, SLOT(updateIndex()));
connect(m_updateIndexAction, &QAction::triggered, this, &ClearCasePlugin::updateIndex);
clearcaseMenu->addAction(command);
m_updateViewAction = new ParameterAction(tr("Update View"), tr("U&pdate View \"%1\""), ParameterAction::EnabledWithParameter, this);
command = ActionManager::registerAction(m_updateViewAction, CMD_ID_UPDATE_VIEW, context);
connect(m_updateViewAction, SIGNAL(triggered()), this, SLOT(updateView()));
connect(m_updateViewAction, &QAction::triggered, this, &ClearCasePlugin::updateView);
command->setAttribute(Command::CA_UpdateText);
clearcaseMenu->addAction(command);
......@@ -595,14 +595,14 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_checkInAllAction = new QAction(tr("Check In All &Files..."), this);
command = ActionManager::registerAction(m_checkInAllAction, CMD_ID_CHECKIN_ALL, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+F") : tr("Alt+L,Alt+F")));
connect(m_checkInAllAction, SIGNAL(triggered()), this, SLOT(startCheckInAll()));
connect(m_checkInAllAction, &QAction::triggered, this, &ClearCasePlugin::startCheckInAll);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
m_statusAction = new QAction(tr("View &Status"), this);
command = ActionManager::registerAction(m_statusAction, CMD_ID_STATUS, context);
command->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+L,Meta+S") : tr("Alt+L,Alt+S")));
connect(m_statusAction, SIGNAL(triggered()), this, SLOT(viewStatus()));
connect(m_statusAction, &QAction::triggered, this, &ClearCasePlugin::viewStatus);
clearcaseMenu->addAction(command);
m_commandLocator->appendCommand(command);
......@@ -612,7 +612,7 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
m_checkInSelectedAction = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Check In"), this);
command = ActionManager::registerAction(m_checkInSelectedAction, Constants::CHECKIN_SELECTED, clearcasecheckincontext);
command->setAttribute(Command::CA_UpdateText);
connect(m_checkInSelectedAction, SIGNAL(triggered()), this, SLOT(checkInSelected()));
connect(m_checkInSelectedAction, &QAction::triggered, this, &ClearCasePlugin::checkInSelected);
m_checkInDiffAction = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff Selected Files"), this);
ActionManager::registerAction(m_checkInDiffAction , Constants::DIFF_SELECTED, clearcasecheckincontext);
......@@ -1775,8 +1775,8 @@ bool ClearCasePlugin::ccFileOp(const QString &workingDir, const QString &title,
commentLabel->setBuddy(commentEdit);
connect(buttonBox, SIGNAL(accepted()), &fileOpDlg, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), &fileOpDlg, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, &fileOpDlg, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, &fileOpDlg, &QDialog::reject);
if (!fileOpDlg.exec())
return false;
......@@ -2228,7 +2228,7 @@ void ClearCasePlugin::sync(QFutureInterface<void> &future, QStringList files)
{
ClearCasePlugin *plugin = ClearCasePlugin::instance();
ClearCaseSync ccSync(plugin, plugin->m_statusMap);
connect(&ccSync, SIGNAL(updateStreamAndView()), plugin, SLOT(updateStreamAndView()));
connect(&ccSync, &ClearCaseSync::updateStreamAndView, plugin, &ClearCasePlugin::updateStreamAndView);
ccSync.run(future, files);
}
......
......@@ -179,29 +179,10 @@ public slots:
void updateStreamAndView();
private slots:
void checkOutCurrentFile();
void addCurrentFile();
void undoCheckOutCurrent();
void undoHijackCurrent();
void diffActivity();
void diffCurrentFile();
void startCheckInAll();
void startCheckInActivity();
void startCheckInCurrentFile();
void historyCurrentFile();
void annotateCurrentFile();
void annotateVersion(const QString &workingDirectory, const QString &file, const QString &revision, int lineNumber);
void describe(const QString &source, const QString &changeNr);
void viewStatus();
void checkInSelected();
void diffCheckInFiles(const QStringList &);
void updateIndex();
void updateView();
void projectChanged(ProjectExplorer::Project *project);
void tasksFinished(Core::Id type);
void syncSlot();
void closing();
void updateStatusActions();
#ifdef WITH_TESTS
void initTestCase();
void cleanupTestCase();
......@@ -227,6 +208,27 @@ protected:
QList<QStringPair> ccGetActivities() const;
private:
void checkOutCurrentFile();
void addCurrentFile();
void undoCheckOutCurrent();
void undoHijackCurrent();
void diffActivity();
void diffCurrentFile();
void startCheckInAll();
void startCheckInActivity();
void startCheckInCurrentFile();
void historyCurrentFile();
void annotateCurrentFile();
void viewStatus();
void checkInSelected();
void diffCheckInFiles(const QStringList &);
void updateIndex();
void updateView();
void projectChanged(ProjectExplorer::Project *project);
void tasksFinished(Core::Id type);
void closing();
void updateStatusActions();
inline bool isCheckInEditorOpen() const;
QStringList getVobList() const;
QString ccManagesDirectory(const QString &directory) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment