Port to new connect api

Change-Id: I873a36601d54065b61d0666558b93dc839ad0dfc
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Montel Laurent
2015-01-30 11:02:24 +01:00
committed by hjk
parent f1ac9cd56d
commit 063251ebbc
39 changed files with 287 additions and 240 deletions

View File

@@ -37,8 +37,8 @@ static const char settingsSuffixKey[] = "CodeStyleSettings";
CppCodeStylePreferences::CppCodeStylePreferences(QObject *parent) :
ICodeStylePreferences(parent)
{
connect(this, SIGNAL(currentValueChanged(QVariant)),
this, SLOT(slotCurrentValueChanged(QVariant)));
connect(this, &CppCodeStylePreferences::currentValueChanged,
this, &CppCodeStylePreferences::slotCurrentValueChanged);
}
QVariant CppCodeStylePreferences::value() const

View File

@@ -282,48 +282,48 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
setVisualizeWhitespace(true);
connect(m_ui->tabSettingsWidget, SIGNAL(settingsChanged(TextEditor::TabSettings)),
this, SLOT(slotTabSettingsChanged(TextEditor::TabSettings)));
connect(m_ui->indentBlockBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentBlockBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentClassBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentEnumBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentNamespaceBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentSwitchLabels, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseStatements, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBlocks, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentCaseBreak, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBody, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->indentFunctionBraces, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->extraPaddingConditions, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->alignAssignments, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToIdentifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToTypeName, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToLeftSpecifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->bindStarToRightSpecifier, SIGNAL(toggled(bool)),
this, SLOT(slotCodeStyleSettingsChanged()));
connect(m_ui->tabSettingsWidget, &TextEditor::TabSettingsWidget::settingsChanged,
this, &CppCodeStylePreferencesWidget::slotTabSettingsChanged);
connect(m_ui->indentBlockBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentBlockBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentClassBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentNamespaceBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentEnumBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentNamespaceBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentSwitchLabels, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseStatements, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseBlocks, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentCaseBreak, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentAccessSpecifiers, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentDeclarationsRelativeToAccessSpecifiers, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentFunctionBody, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->indentFunctionBraces, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->extraPaddingConditions, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->alignAssignments, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToIdentifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToTypeName, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToLeftSpecifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
connect(m_ui->bindStarToRightSpecifier, &QCheckBox::toggled,
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
m_ui->categoryTab->setCurrentIndex(0);
@@ -340,8 +340,8 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppTools::CppCodeStylePreferenc
// code preferences
m_preferences = codeStylePreferences;
connect(m_preferences, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)),
this, SLOT(setTabSettings(TextEditor::TabSettings)));
connect(m_preferences, &CppCodeStylePreferences::currentTabSettingsChanged,
this, &CppCodeStylePreferencesWidget::setTabSettings);
connect(m_preferences, SIGNAL(currentCodeStyleSettingsChanged(CppTools::CppCodeStyleSettings)),
this, SLOT(setCodeStyleSettings(CppTools::CppCodeStyleSettings)));
connect(m_preferences, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)),

View File

@@ -42,7 +42,7 @@
using namespace Core;
using namespace CppTools;
using namespace CppTools::Internal;
using namespace ProjectExplorer;
namespace CppTools {
namespace Internal {
@@ -140,8 +140,7 @@ CppIncludesFilter::CppIncludesFilter()
setIncludedByDefault(true);
setPriority(ILocatorFilter::Low);
connect(ProjectExplorer::ProjectExplorerPlugin::instance(),
&ProjectExplorer::ProjectExplorerPlugin::fileListChanged,
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged,
this, &CppIncludesFilter::markOutdated);
connect(CppModelManager::instance(), &CppModelManager::documentUpdated,
this, &CppIncludesFilter::markOutdated);

View File

@@ -152,11 +152,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
JsExpander::registerQObjectForJs(QLatin1String("Cpp"), new CppToolsJsExtension);
CppLocatorData *locatorData = new CppLocatorData;
connect(modelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
locatorData, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
connect(modelManager, &CppModelManager::documentUpdated,
locatorData, &CppLocatorData::onDocumentUpdated);
connect(modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
locatorData, SLOT(onAboutToRemoveFiles(QStringList)));
connect(modelManager, &CppModelManager::aboutToRemoveFiles,
locatorData, &CppLocatorData::onAboutToRemoveFiles);
addAutoReleasedObject(locatorData);
addAutoReleasedObject(new CppLocatorFilter(locatorData));
@@ -184,7 +184,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
Command *command = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true);
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
connect(switchAction, &QAction::triggered,
this, &CppToolsPlugin::switchHeaderSource);
QAction *openInNextSplitAction = new QAction(tr("Open Corresponding Header/Source in Next Split"), this);
command = ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true);
@@ -192,7 +193,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
? tr("Meta+E, F4")
: tr("Ctrl+E, F4")));
mcpptools->addAction(command);
connect(openInNextSplitAction, SIGNAL(triggered()), this, SLOT(switchHeaderSourceInNextSplit()));
connect(openInNextSplitAction, &QAction::triggered,
this, &CppToolsPlugin::switchHeaderSourceInNextSplit);
Utils::MacroExpander *expander = Utils::globalMacroExpander();
expander->registerVariable("Cpp:LicenseTemplate",

View File

@@ -60,13 +60,14 @@ ModelManagerTestHelper::ModelManagerTestHelper(QObject *parent) :
CppModelManager *mm = CppModelManager::instance();
assert(mm);
connect(this, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
mm, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
connect(this, SIGNAL(projectAdded(ProjectExplorer::Project*)),
mm, SLOT(onProjectAdded(ProjectExplorer::Project*)));
connect(mm, SIGNAL(sourceFilesRefreshed(QSet<QString>)),
this, SLOT(sourceFilesRefreshed(QSet<QString>)));
connect(mm, SIGNAL(gcFinished()), this, SLOT(gcFinished()));
connect(this, &ModelManagerTestHelper::aboutToRemoveProject,
mm, &CppModelManager::onAboutToRemoveProject);
connect(this, &ModelManagerTestHelper::projectAdded,
mm, &CppModelManager::onProjectAdded);
connect(mm, &CppModelManager::sourceFilesRefreshed,
this, &ModelManagerTestHelper::sourceFilesRefreshed);
connect(mm, &CppModelManager::gcFinished,
this, &ModelManagerTestHelper::gcFinished);
cleanup();
Tests::VerifyCleanCppModelManager::verify();

View File

@@ -53,8 +53,7 @@ StringTable::StringTable()
m_gcCountDown.setObjectName(QLatin1String("StringTable::m_gcCountDown"));
m_gcCountDown.setSingleShot(true);
m_gcCountDown.setInterval(GCTimeOut);
connect(&m_gcCountDown, SIGNAL(timeout()),
this, SLOT(startGC()));
connect(&m_gcCountDown, &QTimer::timeout, this, &StringTable::startGC);
}
QString StringTable::insert(const QString &string)