Port to new connect api

Change-Id: I603fc2e3fda624c913e432d5059c86d96c3e2c3b
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Montel Laurent
2015-01-29 10:42:16 +01:00
committed by hjk
parent f567565d26
commit c001e98da8
12 changed files with 40 additions and 32 deletions

View File

@@ -58,12 +58,13 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::IRunConfigurat
<< QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom") << QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom")
); );
globalSettingLayout->addWidget(m_settingsCombo); globalSettingLayout->addWidget(m_settingsCombo);
connect(m_settingsCombo, SIGNAL(activated(int)), this, SLOT(chooseSettings(int))); connect(m_settingsCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &AnalyzerRunConfigWidget::chooseSettings);
m_restoreButton = new QPushButton( m_restoreButton = new QPushButton(
QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Restore Global"), QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Restore Global"),
globalSetting); globalSetting);
globalSettingLayout->addWidget(m_restoreButton); globalSettingLayout->addWidget(m_restoreButton);
connect(m_restoreButton, SIGNAL(clicked()), this, SLOT(restoreGlobal())); connect(m_restoreButton, &QPushButton::clicked, this, &AnalyzerRunConfigWidget::restoreGlobal);
globalSettingLayout->addStretch(2); globalSettingLayout->addStretch(2);
QWidget *innerPane = new QWidget; QWidget *innerPane = new QWidget;

View File

@@ -56,7 +56,8 @@ AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
m_runConfig = runConfiguration; m_runConfig = runConfiguration;
m_sp = sp; m_sp = sp;
connect(this, SIGNAL(finished()), SLOT(runControlFinished())); connect(this, &AnalyzerRunControl::finished,
this, &AnalyzerRunControl::runControlFinished);
connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), SLOT(stopIt())); connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), SLOT(stopIt()));
} }

View File

@@ -94,12 +94,12 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
d->arguments->setText(settings->value(QLatin1String("arguments")).toString()); d->arguments->setText(settings->value(QLatin1String("arguments")).toString());
settings->endGroup(); settings->endGroup();
connect(d->kitChooser, SIGNAL(activated(int)), SLOT(validate())); connect(d->kitChooser, &KitChooser::activated, this, &StartRemoteDialog::validate);
connect(d->executable, SIGNAL(textChanged(QString)), SLOT(validate())); connect(d->executable, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->workingDirectory, SIGNAL(textChanged(QString)), SLOT(validate())); connect(d->workingDirectory, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->arguments, SIGNAL(textChanged(QString)), SLOT(validate())); connect(d->arguments, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(d->buttonBox, &QDialogButtonBox::accepted, this, &StartRemoteDialog::accept);
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject())); connect(d->buttonBox, &QDialogButtonBox::rejected, this, &StartRemoteDialog::reject);
validate(); validate();
} }

View File

@@ -57,10 +57,10 @@ DiffEditorGuiController::DiffEditorGuiController(
m_syncScrollBars).toBool(); m_syncScrollBars).toBool();
s->endGroup(); s->endGroup();
connect(m_controller, SIGNAL(cleared(QString)), connect(m_controller, &DiffEditorController::cleared, this,
this, SLOT(slotUpdateDiffFileIndex())); &DiffEditorGuiController::slotUpdateDiffFileIndex);
connect(m_controller, SIGNAL(diffFilesChanged(QList<FileData>,QString)), connect(m_controller, &DiffEditorController::diffFilesChanged, this,
this, SLOT(slotUpdateDiffFileIndex())); &DiffEditorGuiController::slotUpdateDiffFileIndex);
slotUpdateDiffFileIndex(); slotUpdateDiffFileIndex();
} }

View File

@@ -48,8 +48,8 @@ DiffEditorManager::DiffEditorManager(QObject *parent)
m_instance = this; m_instance = this;
Core::EditorManager *editorManager = Core::EditorManager::instance(); Core::EditorManager *editorManager = Core::EditorManager::instance();
connect(editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)), connect(editorManager, &Core::EditorManager::editorsClosed,
this, SLOT(slotEditorsClosed(QList<Core::IEditor*>))); this, &DiffEditorManager::slotEditorsClosed);
} }
DiffEditorManager::~DiffEditorManager() DiffEditorManager::~DiffEditorManager()

View File

@@ -163,7 +163,7 @@ bool DiffEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
QAction *diffAction = new QAction(tr("Diff..."), this); QAction *diffAction = new QAction(tr("Diff..."), this);
Core::Command *diffCommand = Core::ActionManager::registerAction(diffAction, Core::Command *diffCommand = Core::ActionManager::registerAction(diffAction,
"DiffEditor.Diff", globalcontext); "DiffEditor.Diff", globalcontext);
connect(diffAction, SIGNAL(triggered()), this, SLOT(diff())); connect(diffAction, &QAction::triggered, this, &DiffEditorPlugin::diff);
toolsContainer->addAction(diffCommand, Constants::G_TOOLS_DIFF); toolsContainer->addAction(diffCommand, Constants::G_TOOLS_DIFF);
addAutoReleasedObject(new DiffEditorFactory(this)); addAutoReleasedObject(new DiffEditorFactory(this));

View File

@@ -64,10 +64,10 @@ void DiffEditorReloader::setController(DiffEditorController *controller)
m_controller = controller; m_controller = controller;
if (m_controller) { if (m_controller) {
connect(m_controller, SIGNAL(ignoreWhitespaceChanged(bool)), connect(m_controller, &DiffEditorController::ignoreWhitespaceChanged,
this, SLOT(requestReload())); this, &DiffEditorReloader::requestReload);
connect(m_controller, SIGNAL(contextLinesNumberChanged(int)), connect(m_controller, &DiffEditorController::contextLinesNumberChanged,
this, SLOT(requestReload())); this, &DiffEditorReloader::requestReload);
} }
} }

View File

@@ -44,8 +44,8 @@ CppTodoItemsScanner::CppTodoItemsScanner(const KeywordList &keywordList, QObject
{ {
CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance(); CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), this, connect(modelManager, &CppTools::CppModelManager::documentUpdated,
SLOT(documentUpdated(CPlusPlus::Document::Ptr)), Qt::DirectConnection); this, &CppTodoItemsScanner::documentUpdated, Qt::DirectConnection);
} }
void CppTodoItemsScanner::keywordListChanged() void CppTodoItemsScanner::keywordListChanged()

View File

@@ -40,8 +40,8 @@ QmlJsTodoItemsScanner::QmlJsTodoItemsScanner(const KeywordList &keywordList, QOb
TodoItemsScanner(keywordList, parent) TodoItemsScanner(keywordList, parent)
{ {
QmlJS::ModelManagerInterface *model = QmlJS::ModelManagerInterface::instance(); QmlJS::ModelManagerInterface *model = QmlJS::ModelManagerInterface::instance();
connect(model, SIGNAL(documentUpdated(QmlJS::Document::Ptr)), connect(model, &QmlJS::ModelManagerInterface::documentUpdated,
this, SLOT(documentUpdated(QmlJS::Document::Ptr)), Qt::DirectConnection); this, &QmlJsTodoItemsScanner::documentUpdated, Qt::DirectConnection);
} }
bool QmlJsTodoItemsScanner::shouldProcessFile(const QString &fileName) bool QmlJsTodoItemsScanner::shouldProcessFile(const QString &fileName)

View File

@@ -170,7 +170,7 @@ void TodoItemsProvider::setupUpdateListTimer()
{ {
m_shouldUpdateList = false; m_shouldUpdateList = false;
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), SLOT(updateListTimeoutElapsed())); connect(timer, &QTimer::timeout, this, &TodoItemsProvider::updateListTimeoutElapsed);
timer->start(Constants::OUTPUT_PANE_UPDATE_INTERVAL); timer->start(Constants::OUTPUT_PANE_UPDATE_INTERVAL);
} }

View File

@@ -49,8 +49,10 @@ TodoOutputPane::TodoOutputPane(TodoItemsModel *todoItemsModel, QObject *parent)
createTreeView(); createTreeView();
createScopeButtons(); createScopeButtons();
setScanningScope(ScanningScopeCurrentFile); // default setScanningScope(ScanningScopeCurrentFile); // default
connect(m_todoItemsModel, SIGNAL(layoutChanged()), SIGNAL(navigateStateUpdate())); connect(m_todoItemsModel, &TodoItemsModel::layoutChanged,
connect(m_todoItemsModel, SIGNAL(layoutChanged()), SLOT(updateTodoCount())); this, &TodoOutputPane::navigateStateUpdate);
connect(m_todoItemsModel, &TodoItemsModel::layoutChanged,
this, &TodoOutputPane::updateTodoCount);
} }
TodoOutputPane::~TodoOutputPane() TodoOutputPane::~TodoOutputPane()
@@ -183,7 +185,7 @@ void TodoOutputPane::createTreeView()
m_todoTreeView = new TodoOutputTreeView(); m_todoTreeView = new TodoOutputTreeView();
m_todoTreeView->setModel(m_todoItemsModel); m_todoTreeView->setModel(m_todoItemsModel);
connect(m_todoTreeView, SIGNAL(activated(QModelIndex)), SLOT(todoTreeViewClicked(QModelIndex))); connect(m_todoTreeView, &TodoOutputTreeView::activated, this, &TodoOutputPane::todoTreeViewClicked);
} }
void TodoOutputPane::freeTreeView() void TodoOutputPane::freeTreeView()
@@ -206,7 +208,8 @@ void TodoOutputPane::createScopeButtons()
m_scopeButtons = new QButtonGroup(); m_scopeButtons = new QButtonGroup();
m_scopeButtons->addButton(m_wholeProjectButton); m_scopeButtons->addButton(m_wholeProjectButton);
m_scopeButtons->addButton(m_currentFileButton); m_scopeButtons->addButton(m_currentFileButton);
connect(m_scopeButtons, SIGNAL(buttonClicked(QAbstractButton*)), SLOT(scopeButtonClicked(QAbstractButton*))); connect(m_scopeButtons, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked),
this, &TodoOutputPane::scopeButtonClicked);
m_spacer = new QWidget; m_spacer = new QWidget;
m_spacer->setMinimumWidth(Constants::OUTPUT_TOOLBAR_SPACER_WIDTH); m_spacer->setMinimumWidth(Constants::OUTPUT_TOOLBAR_SPACER_WIDTH);

View File

@@ -114,15 +114,18 @@ void TodoPlugin::createTodoOutputPane()
m_todoOutputPane = new TodoOutputPane(m_todoItemsProvider->todoItemsModel()); m_todoOutputPane = new TodoOutputPane(m_todoItemsProvider->todoItemsModel());
addAutoReleasedObject(m_todoOutputPane); addAutoReleasedObject(m_todoOutputPane);
m_todoOutputPane->setScanningScope(m_settings.scanningScope); m_todoOutputPane->setScanningScope(m_settings.scanningScope);
connect(m_todoOutputPane, SIGNAL(scanningScopeChanged(ScanningScope)), SLOT(scanningScopeChanged(ScanningScope))); connect(m_todoOutputPane, &TodoOutputPane::scanningScopeChanged,
connect(m_todoOutputPane, SIGNAL(todoItemClicked(TodoItem)), SLOT(todoItemClicked(TodoItem))); this, &TodoPlugin::scanningScopeChanged);
connect(m_todoOutputPane, &TodoOutputPane::todoItemClicked,
this, &TodoPlugin::todoItemClicked);
} }
void TodoPlugin::createOptionsPage() void TodoPlugin::createOptionsPage()
{ {
m_optionsPage = new OptionsPage(m_settings); m_optionsPage = new OptionsPage(m_settings);
addAutoReleasedObject(m_optionsPage); addAutoReleasedObject(m_optionsPage);
connect(m_optionsPage, SIGNAL(settingsChanged(Settings)), SLOT(settingsChanged(Settings))); connect(m_optionsPage, &OptionsPage::settingsChanged,
this, &TodoPlugin::settingsChanged);
} }
} // namespace Internal } // namespace Internal