forked from qt-creator/qt-creator
CppTools: Use Qt5-style connects
Mostly done by clazy. Change-Id: I0fbbbe1a2d28b79bcb83093d608bca6e2f927ebb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
324e221bee
commit
46cacd901a
@@ -58,14 +58,13 @@ signals:
|
||||
void currentConfigChanged(const Core::Id ¤tConfigId);
|
||||
void customConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onCurrentConfigChanged(int);
|
||||
void onCopyButtonClicked();
|
||||
void onRemoveButtonClicked();
|
||||
|
||||
void onDiagnosticOptionsEdited();
|
||||
|
||||
private:
|
||||
void syncWidgetsToModel(const Core::Id &configToSelect = Core::Id());
|
||||
void syncConfigChooserToModel(const Core::Id &configToSelect = Core::Id());
|
||||
void syncOtherWidgetsToComboBox();
|
||||
|
||||
@@ -60,10 +60,9 @@ signals:
|
||||
protected:
|
||||
virtual QString settingsSuffix() const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void slotCurrentValueChanged(const QVariant &);
|
||||
|
||||
private:
|
||||
CppCodeStyleSettings m_data;
|
||||
};
|
||||
|
||||
|
||||
@@ -274,8 +274,8 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
|
||||
m_previews[i]->setPlainText(QLatin1String(defaultCodeStyleSnippets[i]));
|
||||
|
||||
decorateEditors(TextEditorSettings::fontSettings());
|
||||
connect(TextEditorSettings::instance(), SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||
this, SLOT(decorateEditors(TextEditor::FontSettings)));
|
||||
connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
|
||||
this, &CppCodeStylePreferencesWidget::decorateEditors);
|
||||
|
||||
setVisualizeWhitespace(true);
|
||||
|
||||
@@ -339,10 +339,15 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppTools::CppCodeStylePreferenc
|
||||
|
||||
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*)),
|
||||
this, SLOT(slotCurrentPreferencesChanged(TextEditor::ICodeStylePreferences*)));
|
||||
connect(m_preferences, &CppCodeStylePreferences::currentCodeStyleSettingsChanged,
|
||||
this, [this](const CppTools::CppCodeStyleSettings &codeStyleSettings) {
|
||||
setCodeStyleSettings(codeStyleSettings);
|
||||
});
|
||||
|
||||
connect(m_preferences, &ICodeStylePreferences::currentPreferencesChanged,
|
||||
this, [this](TextEditor::ICodeStylePreferences *currentPreferences) {
|
||||
slotCurrentPreferencesChanged(currentPreferences);
|
||||
});
|
||||
|
||||
setTabSettings(m_preferences->tabSettings());
|
||||
setCodeStyleSettings(m_preferences->codeStyleSettings(), false);
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
void setCodeStyle(CppTools::CppCodeStylePreferences *codeStylePreferences);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void decorateEditors(const TextEditor::FontSettings &fontSettings);
|
||||
void setVisualizeWhitespace(bool on);
|
||||
void slotTabSettingsChanged(const TextEditor::TabSettings &settings);
|
||||
@@ -69,7 +69,6 @@ private slots:
|
||||
void setCodeStyleSettings(const CppTools::CppCodeStyleSettings &settings, bool preview = true);
|
||||
void slotCurrentPreferencesChanged(TextEditor::ICodeStylePreferences *, bool preview = true);
|
||||
|
||||
private:
|
||||
CppCodeStyleSettings cppCodeStyleSettings() const;
|
||||
|
||||
CppCodeStylePreferences *m_preferences;
|
||||
|
||||
@@ -52,12 +52,12 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppTools::CppModelManager *ma
|
||||
SymbolSearcher::Functions |
|
||||
SymbolSearcher::Classes);
|
||||
|
||||
connect(manager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
|
||||
this, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
|
||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
this, SLOT(onCurrentEditorChanged(Core::IEditor*)));
|
||||
connect(Core::EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
this, SLOT(onEditorAboutToClose(Core::IEditor*)));
|
||||
connect(manager, &CppModelManager::documentUpdated,
|
||||
this, &CppCurrentDocumentFilter::onDocumentUpdated);
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||
this, &CppCurrentDocumentFilter::onCurrentEditorChanged);
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::editorAboutToClose,
|
||||
this, &CppCurrentDocumentFilter::onEditorAboutToClose);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(
|
||||
|
||||
@@ -50,12 +50,11 @@ public:
|
||||
void accept(Core::LocatorFilterEntry selection) const;
|
||||
void refresh(QFutureInterface<void> &future);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
|
||||
void onCurrentEditorChanged(Core::IEditor *currentEditor);
|
||||
void onEditorAboutToClose(Core::IEditor *currentEditor);
|
||||
|
||||
private:
|
||||
QList<IndexItem::Ptr> itemsOfCurrentDocument();
|
||||
|
||||
CppModelManager * m_modelManager;
|
||||
|
||||
@@ -123,17 +123,19 @@ CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget)
|
||||
&CppTools::CppToolsSettings::setSortedEditorDocumentOutline);
|
||||
m_combo->addAction(m_sortAction);
|
||||
|
||||
connect(m_combo, SIGNAL(activated(int)), this, SLOT(gotoSymbolInEditor()));
|
||||
connect(m_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateToolTip()));
|
||||
connect(m_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &CppEditorOutline::gotoSymbolInEditor);
|
||||
connect(m_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &CppEditorOutline::updateToolTip);
|
||||
|
||||
// Set up timers
|
||||
m_updateTimer = newSingleShotTimer(this, UpdateOutlineIntervalInMs,
|
||||
QLatin1String("CppEditorOutline::m_updateTimer"));
|
||||
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateNow()));
|
||||
connect(m_updateTimer, &QTimer::timeout, this, &CppEditorOutline::updateNow);
|
||||
|
||||
m_updateIndexTimer = newSingleShotTimer(this, UpdateOutlineIntervalInMs,
|
||||
QLatin1String("CppEditorOutline::m_updateIndexTimer"));
|
||||
connect(m_updateIndexTimer, SIGNAL(timeout()), this, SLOT(updateIndexNow()));
|
||||
connect(m_updateIndexTimer, &QTimer::timeout, this, &CppEditorOutline::updateIndexNow);
|
||||
}
|
||||
|
||||
void CppEditorOutline::update()
|
||||
|
||||
@@ -63,13 +63,12 @@ public slots:
|
||||
void updateIndex();
|
||||
void setSorted(bool sort);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateNow();
|
||||
void updateIndexNow();
|
||||
void updateToolTip();
|
||||
void gotoSymbolInEditor();
|
||||
|
||||
private:
|
||||
CppEditorOutline();
|
||||
|
||||
bool isSorted() const;
|
||||
|
||||
@@ -329,11 +329,11 @@ void CppFindReferences::findUsages(Symbol *symbol,
|
||||
SearchResultWindow::PreserveCaseDisabled,
|
||||
QLatin1String("CppEditor"));
|
||||
search->setTextToReplace(replacement);
|
||||
connect(search, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
|
||||
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)));
|
||||
connect(search, SIGNAL(paused(bool)), this, SLOT(setPaused(bool)));
|
||||
connect(search, &SearchResult::replaceButtonClicked,
|
||||
this, &CppFindReferences::onReplaceButtonClicked);
|
||||
connect(search, &SearchResult::paused, this, &CppFindReferences::setPaused);
|
||||
search->setSearchAgainSupported(true);
|
||||
connect(search, SIGNAL(searchAgainRequested()), this, SLOT(searchAgain()));
|
||||
connect(search, &SearchResult::searchAgainRequested, this, &CppFindReferences::searchAgain);
|
||||
CppFindReferencesParameters parameters;
|
||||
parameters.symbolId = fullIdForSymbol(symbol);
|
||||
parameters.symbolFileName = QByteArray(symbol->fileName());
|
||||
@@ -358,9 +358,9 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
|
||||
search->finishSearch(false);
|
||||
return;
|
||||
}
|
||||
connect(search, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
connect(search, SIGNAL(activated(Core::SearchResultItem)),
|
||||
this, SLOT(openEditor(Core::SearchResultItem)));
|
||||
connect(search, &SearchResult::cancelled, this, &CppFindReferences::cancel);
|
||||
connect(search, &SearchResult::activated,
|
||||
this, &CppFindReferences::openEditor);
|
||||
|
||||
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
const WorkingCopy workingCopy = m_modelManager->workingCopy();
|
||||
@@ -372,7 +372,7 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
|
||||
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"),
|
||||
CppTools::Constants::TASK_SEARCH);
|
||||
|
||||
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
|
||||
connect(progress, &FutureProgress::clicked, search, &SearchResult::popup);
|
||||
}
|
||||
|
||||
void CppFindReferences::onReplaceButtonClicked(const QString &text,
|
||||
@@ -645,15 +645,15 @@ void CppFindReferences::findMacroUses(const Macro ¯o, const QString &replace
|
||||
QLatin1String("CppEditor"));
|
||||
|
||||
search->setTextToReplace(replacement);
|
||||
connect(search, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
|
||||
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)));
|
||||
connect(search, &SearchResult::replaceButtonClicked,
|
||||
this, &CppFindReferences::onReplaceButtonClicked);
|
||||
|
||||
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
|
||||
connect(search, SIGNAL(activated(Core::SearchResultItem)),
|
||||
this, SLOT(openEditor(Core::SearchResultItem)));
|
||||
connect(search, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
connect(search, SIGNAL(paused(bool)), this, SLOT(setPaused(bool)));
|
||||
connect(search, &SearchResult::activated,
|
||||
this, &CppFindReferences::openEditor);
|
||||
connect(search, &SearchResult::cancelled, this, &CppFindReferences::cancel);
|
||||
connect(search, &SearchResult::paused, this, &CppFindReferences::setPaused);
|
||||
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
const WorkingCopy workingCopy = m_modelManager->workingCopy();
|
||||
@@ -676,7 +676,7 @@ void CppFindReferences::findMacroUses(const Macro ¯o, const QString &replace
|
||||
|
||||
FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"),
|
||||
CppTools::Constants::TASK_SEARCH);
|
||||
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
|
||||
connect(progress, &FutureProgress::clicked, search, &SearchResult::popup);
|
||||
}
|
||||
|
||||
void CppFindReferences::renameMacroUses(const Macro ¯o, const QString &replacement)
|
||||
@@ -689,8 +689,8 @@ void CppFindReferences::createWatcher(const QFuture<Usage> &future, SearchResult
|
||||
{
|
||||
QFutureWatcher<Usage> *watcher = new QFutureWatcher<Usage>();
|
||||
watcher->setPendingResultsLimit(1);
|
||||
connect(watcher, SIGNAL(resultsReadyAt(int,int)), this, SLOT(displayResults(int,int)));
|
||||
connect(watcher, SIGNAL(finished()), this, SLOT(searchFinished()));
|
||||
connect(watcher, &QFutureWatcherBase::resultsReadyAt, this, &CppFindReferences::displayResults);
|
||||
connect(watcher, &QFutureWatcherBase::finished, this, &CppFindReferences::searchFinished);
|
||||
m_watchers.insert(watcher, search);
|
||||
watcher->setFuture(future);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
void findMacroUses(const CPlusPlus::Macro ¯o);
|
||||
void renameMacroUses(const CPlusPlus::Macro ¯o, const QString &replacement = QString());
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void displayResults(int first, int last);
|
||||
void searchFinished();
|
||||
void cancel();
|
||||
@@ -79,7 +79,6 @@ private slots:
|
||||
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
|
||||
void searchAgain();
|
||||
|
||||
private:
|
||||
void findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context,
|
||||
const QString &replacement, bool replace);
|
||||
void findMacroUses(const CPlusPlus::Macro ¯o, const QString &replacement,
|
||||
|
||||
@@ -175,7 +175,7 @@ void CppIncludesFilter::prepareSearch(const QString &entry)
|
||||
void CppIncludesFilter::refresh(QFutureInterface<void> &future)
|
||||
{
|
||||
Q_UNUSED(future)
|
||||
QTimer::singleShot(0, this, SLOT(markOutdated()));
|
||||
QTimer::singleShot(0, this, &CppIncludesFilter::markOutdated);
|
||||
}
|
||||
|
||||
void CppIncludesFilter::markOutdated()
|
||||
|
||||
@@ -42,10 +42,9 @@ public:
|
||||
void prepareSearch(const QString &entry);
|
||||
void refresh(QFutureInterface<void> &future);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void markOutdated();
|
||||
|
||||
private:
|
||||
bool m_needsUpdate;
|
||||
};
|
||||
|
||||
|
||||
@@ -307,8 +307,8 @@ CppModelManager::CppModelManager(QObject *parent)
|
||||
d->m_enableGC = true;
|
||||
|
||||
qRegisterMetaType<QSet<QString> >();
|
||||
connect(this, SIGNAL(sourceFilesRefreshed(QSet<QString>)),
|
||||
this, SLOT(onSourceFilesRefreshed()));
|
||||
connect(this, &CppModelManager::sourceFilesRefreshed,
|
||||
this, &CppModelManager::onSourceFilesRefreshed);
|
||||
|
||||
d->m_findReferences = new CppFindReferences(this);
|
||||
d->m_indexerEnabled = qgetenv("QTC_NO_CODE_INDEXER") != "1";
|
||||
@@ -317,15 +317,15 @@ CppModelManager::CppModelManager(QObject *parent)
|
||||
|
||||
d->m_delayedGcTimer.setObjectName(QLatin1String("CppModelManager::m_delayedGcTimer"));
|
||||
d->m_delayedGcTimer.setSingleShot(true);
|
||||
connect(&d->m_delayedGcTimer, SIGNAL(timeout()), this, SLOT(GC()));
|
||||
connect(&d->m_delayedGcTimer, &QTimer::timeout, this, &CppModelManager::GC);
|
||||
|
||||
QObject *sessionManager = ProjectExplorer::SessionManager::instance();
|
||||
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
|
||||
this, SLOT(onProjectAdded(ProjectExplorer::Project*)));
|
||||
connect(sessionManager, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
|
||||
this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
|
||||
connect(sessionManager, SIGNAL(aboutToLoadSession(QString)),
|
||||
this, SLOT(onAboutToLoadSession()));
|
||||
auto sessionManager = ProjectExplorer::SessionManager::instance();
|
||||
connect(sessionManager, &ProjectExplorer::SessionManager::projectAdded,
|
||||
this, &CppModelManager::onProjectAdded);
|
||||
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
|
||||
this, &CppModelManager::onAboutToRemoveProject);
|
||||
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToLoadSession,
|
||||
this, &CppModelManager::onAboutToLoadSession);
|
||||
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||
this, &CppModelManager::onCurrentEditorChanged);
|
||||
@@ -333,8 +333,8 @@ CppModelManager::CppModelManager(QObject *parent)
|
||||
connect(Core::DocumentManager::instance(), &Core::DocumentManager::allDocumentsRenamed,
|
||||
this, &CppModelManager::renameIncludes);
|
||||
|
||||
connect(Core::ICore::instance(), SIGNAL(coreAboutToClose()),
|
||||
this, SLOT(onCoreAboutToClose()));
|
||||
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose,
|
||||
this, &CppModelManager::onCoreAboutToClose);
|
||||
|
||||
qRegisterMetaType<CPlusPlus::Document::Ptr>("CPlusPlus::Document::Ptr");
|
||||
qRegisterMetaType<QList<Document::DiagnosticMessage>>(
|
||||
@@ -1031,7 +1031,7 @@ void CppModelManager::onAboutToRemoveProject(ProjectExplorer::Project *project)
|
||||
void CppModelManager::onSourceFilesRefreshed() const
|
||||
{
|
||||
if (BuiltinIndexingSupport::isFindErrorsIndexingActive()) {
|
||||
QTimer::singleShot(1, QCoreApplication::instance(), SLOT(quit()));
|
||||
QTimer::singleShot(1, QCoreApplication::instance(), &QCoreApplication::quit);
|
||||
qDebug("FindErrorsIndexing: Done, requesting Qt Creator to quit.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public slots:
|
||||
void updateModifiedSourceFiles();
|
||||
void GC();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
// This should be executed in the GUI thread.
|
||||
friend class Tests::ModelManagerTestHelper;
|
||||
void onAboutToLoadSession();
|
||||
@@ -203,7 +203,6 @@ private slots:
|
||||
void onCurrentEditorChanged(Core::IEditor *editor);
|
||||
void onCoreAboutToClose();
|
||||
|
||||
private:
|
||||
void initializeBuiltinModelManagerSupport();
|
||||
void delayedGC();
|
||||
void recalculateProjectPartMappings();
|
||||
|
||||
@@ -148,8 +148,8 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
// Objects
|
||||
CppModelManager *modelManager = CppModelManager::instance();
|
||||
connect(VcsManager::instance(), SIGNAL(repositoryChanged(QString)),
|
||||
modelManager, SLOT(updateModifiedSourceFiles()));
|
||||
connect(VcsManager::instance(), &VcsManager::repositoryChanged,
|
||||
modelManager, &CppModelManager::updateModifiedSourceFiles);
|
||||
connect(DocumentManager::instance(), &DocumentManager::filesChangedInternally,
|
||||
[=](const QStringList &files) {
|
||||
modelManager->updateSourceFiles(files.toSet());
|
||||
|
||||
@@ -70,11 +70,10 @@ public:
|
||||
|
||||
void run();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onHighlighterResultAvailable(int from, int to);
|
||||
void onHighlighterFinished();
|
||||
|
||||
private:
|
||||
void connectWatcher();
|
||||
void disconnectWatcher();
|
||||
|
||||
|
||||
@@ -45,11 +45,10 @@ public:
|
||||
QString insert(const QString &string);
|
||||
void scheduleGC();
|
||||
|
||||
private slots:
|
||||
void startGC();
|
||||
|
||||
private:
|
||||
void startGC();
|
||||
void GC();
|
||||
|
||||
class GCRunner: public QRunnable {
|
||||
StringTable &m_stringTable;
|
||||
|
||||
|
||||
@@ -60,10 +60,10 @@ SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager)
|
||||
m_scope(SymbolSearcher::SearchProjectsOnly)
|
||||
{
|
||||
// for disabling while parser is running
|
||||
connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)),
|
||||
this, SLOT(onTaskStarted(Core::Id)));
|
||||
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)),
|
||||
this, SLOT(onAllTasksFinished(Core::Id)));
|
||||
connect(ProgressManager::instance(), &ProgressManager::taskStarted,
|
||||
this, &SymbolsFindFilter::onTaskStarted);
|
||||
connect(ProgressManager::instance(), &ProgressManager::allTasksFinished,
|
||||
this, &SymbolsFindFilter::onAllTasksFinished);
|
||||
}
|
||||
|
||||
QString SymbolsFindFilter::id() const
|
||||
@@ -110,12 +110,12 @@ void SymbolsFindFilter::findAll(const QString &txt, FindFlags findFlags)
|
||||
SearchResultWindow *window = SearchResultWindow::instance();
|
||||
SearchResult *search = window->startNewSearch(label(), toolTip(findFlags), txt);
|
||||
search->setSearchAgainSupported(true);
|
||||
connect(search, SIGNAL(activated(Core::SearchResultItem)),
|
||||
this, SLOT(openEditor(Core::SearchResultItem)));
|
||||
connect(search, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
connect(search, SIGNAL(paused(bool)), this, SLOT(setPaused(bool)));
|
||||
connect(search, SIGNAL(searchAgainRequested()), this, SLOT(searchAgain()));
|
||||
connect(this, SIGNAL(enabledChanged(bool)), search, SLOT(setSearchAgainEnabled(bool)));
|
||||
connect(search, &SearchResult::activated,
|
||||
this, &SymbolsFindFilter::openEditor);
|
||||
connect(search, &SearchResult::cancelled, this, &SymbolsFindFilter::cancel);
|
||||
connect(search, &SearchResult::paused, this, &SymbolsFindFilter::setPaused);
|
||||
connect(search, &SearchResult::searchAgainRequested, this, &SymbolsFindFilter::searchAgain);
|
||||
connect(this, &IFindFilter::enabledChanged, search, &SearchResult::setSearchAgainEnabled);
|
||||
window->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
|
||||
SymbolSearcher::Parameters parameters;
|
||||
@@ -138,18 +138,18 @@ void SymbolsFindFilter::startSearch(SearchResult *search)
|
||||
|
||||
QFutureWatcher<SearchResultItem> *watcher = new QFutureWatcher<SearchResultItem>();
|
||||
m_watchers.insert(watcher, search);
|
||||
connect(watcher, SIGNAL(finished()),
|
||||
this, SLOT(finish()));
|
||||
connect(watcher, SIGNAL(resultsReadyAt(int,int)),
|
||||
this, SLOT(addResults(int,int)));
|
||||
connect(watcher, &QFutureWatcherBase::finished,
|
||||
this, &SymbolsFindFilter::finish);
|
||||
connect(watcher, &QFutureWatcherBase::resultsReadyAt,
|
||||
this, &SymbolsFindFilter::addResults);
|
||||
SymbolSearcher *symbolSearcher = m_manager->indexingSupport()->createSymbolSearcher(parameters, projectFileNames);
|
||||
connect(watcher, SIGNAL(finished()),
|
||||
symbolSearcher, SLOT(deleteLater()));
|
||||
connect(watcher, &QFutureWatcherBase::finished,
|
||||
symbolSearcher, &QObject::deleteLater);
|
||||
watcher->setFuture(Utils::runAsync(m_manager->sharedThreadPool(),
|
||||
&SymbolSearcher::runSearch, symbolSearcher));
|
||||
FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching for Symbol"),
|
||||
Core::Constants::TASK_SEARCH);
|
||||
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
|
||||
connect(progress, &FutureProgress::clicked, search, &SearchResult::popup);
|
||||
}
|
||||
|
||||
void SymbolsFindFilter::addResults(int begin, int end)
|
||||
@@ -262,7 +262,8 @@ QString SymbolsFindFilter::toolTip(FindFlags findFlags) const
|
||||
SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter)
|
||||
: m_filter(filter)
|
||||
{
|
||||
connect(m_filter, SIGNAL(symbolsToSearchChanged()), this, SLOT(getState()));
|
||||
connect(m_filter, &SymbolsFindFilter::symbolsToSearchChanged,
|
||||
this, &SymbolsFindFilterConfigWidget::getState);
|
||||
|
||||
QGridLayout *layout = new QGridLayout(this);
|
||||
setLayout(layout);
|
||||
@@ -289,10 +290,14 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *
|
||||
m_typeClasses->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
m_typeMethods->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
|
||||
connect(m_typeClasses, SIGNAL(clicked(bool)), this, SLOT(setState()));
|
||||
connect(m_typeMethods, SIGNAL(clicked(bool)), this, SLOT(setState()));
|
||||
connect(m_typeEnums, SIGNAL(clicked(bool)), this, SLOT(setState()));
|
||||
connect(m_typeDeclarations, SIGNAL(clicked(bool)), this, SLOT(setState()));
|
||||
connect(m_typeClasses, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
connect(m_typeMethods, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
connect(m_typeEnums, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
connect(m_typeDeclarations, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
|
||||
m_searchProjectsOnly = new QRadioButton(tr("Projects only"));
|
||||
layout->addWidget(m_searchProjectsOnly, 2, 1);
|
||||
@@ -304,10 +309,10 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *
|
||||
m_searchGroup->addButton(m_searchProjectsOnly);
|
||||
m_searchGroup->addButton(m_searchGlobal);
|
||||
|
||||
connect(m_searchProjectsOnly, SIGNAL(clicked(bool)),
|
||||
this, SLOT(setState()));
|
||||
connect(m_searchGlobal, SIGNAL(clicked(bool)),
|
||||
this, SLOT(setState()));
|
||||
connect(m_searchProjectsOnly, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
connect(m_searchGlobal, &QAbstractButton::clicked,
|
||||
this, &SymbolsFindFilterConfigWidget::setState);
|
||||
}
|
||||
|
||||
void SymbolsFindFilterConfigWidget::getState()
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
signals:
|
||||
void symbolsToSearchChanged();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void openEditor(const Core::SearchResultItem &item);
|
||||
|
||||
void addResults(int begin, int end);
|
||||
@@ -84,7 +84,6 @@ private slots:
|
||||
void onAllTasksFinished(Core::Id type);
|
||||
void searchAgain();
|
||||
|
||||
private:
|
||||
QString label() const;
|
||||
QString toolTip(Core::FindFlags findFlags) const;
|
||||
void startSearch(Core::SearchResult *search);
|
||||
@@ -103,11 +102,10 @@ class SymbolsFindFilterConfigWidget : public QWidget
|
||||
public:
|
||||
SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void setState() const;
|
||||
void getState();
|
||||
|
||||
private:
|
||||
SymbolsFindFilter *m_filter;
|
||||
|
||||
QCheckBox *m_typeClasses;
|
||||
|
||||
Reference in New Issue
Block a user