QmlJS[|Editor|Tools]: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I56550546b341d486d321329e9a90b9369d56af40
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
Orgad Shaneh
2016-06-27 22:25:11 +03:00
committed by Orgad Shaneh
parent 090c106929
commit 7609e56ee3
32 changed files with 143 additions and 166 deletions

View File

@@ -104,12 +104,13 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
m_updateCppQmlTypesTimer = new QTimer(this); m_updateCppQmlTypesTimer = new QTimer(this);
m_updateCppQmlTypesTimer->setInterval(1000); m_updateCppQmlTypesTimer->setInterval(1000);
m_updateCppQmlTypesTimer->setSingleShot(true); m_updateCppQmlTypesTimer->setSingleShot(true);
connect(m_updateCppQmlTypesTimer, SIGNAL(timeout()), SLOT(startCppQmlTypeUpdate())); connect(m_updateCppQmlTypesTimer, &QTimer::timeout,
this, &ModelManagerInterface::startCppQmlTypeUpdate);
m_asyncResetTimer = new QTimer(this); m_asyncResetTimer = new QTimer(this);
m_asyncResetTimer->setInterval(15000); m_asyncResetTimer->setInterval(15000);
m_asyncResetTimer->setSingleShot(true); m_asyncResetTimer->setSingleShot(true);
connect(m_asyncResetTimer, SIGNAL(timeout()), SLOT(resetCodeModel())); connect(m_asyncResetTimer, &QTimer::timeout, this, &ModelManagerInterface::resetCodeModel);
qRegisterMetaType<QmlJS::Document::Ptr>("QmlJS::Document::Ptr"); qRegisterMetaType<QmlJS::Document::Ptr>("QmlJS::Document::Ptr");
qRegisterMetaType<QmlJS::LibraryInfo>("QmlJS::LibraryInfo"); qRegisterMetaType<QmlJS::LibraryInfo>("QmlJS::LibraryInfo");

View File

@@ -205,9 +205,11 @@ public:
PathsAndLanguages paths, PathsAndLanguages paths,
ModelManagerInterface *modelManager, ModelManagerInterface *modelManager,
bool emitDocChangedOnDisk, bool libOnly = true); bool emitDocChangedOnDisk, bool libOnly = true);
public slots:
virtual void resetCodeModel(); virtual void resetCodeModel();
void removeProjectInfo(ProjectExplorer::Project *project); void removeProjectInfo(ProjectExplorer::Project *project);
void maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc);
signals: signals:
void documentUpdated(QmlJS::Document::Ptr doc); void documentUpdated(QmlJS::Document::Ptr doc);
void documentChangedOnDisk(QmlJS::Document::Ptr doc); void documentChangedOnDisk(QmlJS::Document::Ptr doc);
@@ -215,12 +217,11 @@ signals:
void libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info); void libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info);
void projectInfoUpdated(const ProjectInfo &pinfo); void projectInfoUpdated(const ProjectInfo &pinfo);
void projectPathChanged(const QString &projectPath); void projectPathChanged(const QString &projectPath);
protected slots:
void maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc);
void queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan);
void asyncReset();
virtual void startCppQmlTypeUpdate();
protected: protected:
Q_INVOKABLE void queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan);
Q_INVOKABLE void asyncReset();
virtual void startCppQmlTypeUpdate();
QMutex *mutex() const; QMutex *mutex() const;
virtual QHash<QString,Dialect> languageForSuffix() const; virtual QHash<QString,Dialect> languageForSuffix() const;
virtual void writeMessageInternal(const QString &msg) const; virtual void writeMessageInternal(const QString &msg) const;

View File

@@ -51,8 +51,8 @@ Utils::FileSystemWatcher *PluginDumper::pluginWatcher()
if (!m_pluginWatcher) { if (!m_pluginWatcher) {
m_pluginWatcher = new Utils::FileSystemWatcher(this); m_pluginWatcher = new Utils::FileSystemWatcher(this);
m_pluginWatcher->setObjectName(QLatin1String("PluginDumperWatcher")); m_pluginWatcher->setObjectName(QLatin1String("PluginDumperWatcher"));
connect(m_pluginWatcher, SIGNAL(fileChanged(QString)), connect(m_pluginWatcher, &Utils::FileSystemWatcher::fileChanged,
this, SLOT(pluginChanged(QString))); this, &PluginDumper::pluginChanged);
} }
return m_pluginWatcher; return m_pluginWatcher;
} }
@@ -509,8 +509,10 @@ void PluginDumper::runQmlDump(const QmlJS::ModelManagerInterface::ProjectInfo &i
{ {
QProcess *process = new QProcess(this); QProcess *process = new QProcess(this);
process->setEnvironment(info.qmlDumpEnvironment.toStringList()); process->setEnvironment(info.qmlDumpEnvironment.toStringList());
connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int))); connect(process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
connect(process, SIGNAL(error(QProcess::ProcessError)), SLOT(qmlPluginTypeDumpError(QProcess::ProcessError))); this, &PluginDumper::qmlPluginTypeDumpDone);
connect(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
this, &PluginDumper::qmlPluginTypeDumpError);
process->start(info.qmlDumpPath, arguments); process->start(info.qmlDumpPath, arguments);
m_runningQmldumps.insert(process, importPath); m_runningQmldumps.insert(process, importPath);
} }

View File

@@ -52,13 +52,13 @@ public:
void scheduleRedumpPlugins(); void scheduleRedumpPlugins();
void scheduleMaybeRedumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info); void scheduleMaybeRedumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info);
private slots: private:
void onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info, Q_INVOKABLE void onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info,
bool force = false); bool force = false);
void onLoadPluginTypes(const QString &libraryPath, const QString &importPath, Q_INVOKABLE void onLoadPluginTypes(const QString &libraryPath, const QString &importPath,
const QString &importUri, const QString &importVersion); const QString &importUri, const QString &importVersion);
void dumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info); Q_INVOKABLE void dumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info);
void dumpAllPlugins(); Q_INVOKABLE void dumpAllPlugins();
void qmlPluginTypeDumpDone(int exitCode); void qmlPluginTypeDumpDone(int exitCode);
void qmlPluginTypeDumpError(QProcess::ProcessError error); void qmlPluginTypeDumpError(QProcess::ProcessError error);
void pluginChanged(const QString &pluginLibrary); void pluginChanged(const QString &pluginLibrary);

View File

@@ -38,10 +38,10 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->pathEdit, SIGNAL(rawPathChanged(QString)), connect(ui->pathEdit, &Utils::PathChooser::rawPathChanged,
this, SLOT(validate())); this, &ComponentNameDialog::validate);
connect(ui->componentNameEdit, SIGNAL(textChanged(QString)), connect(ui->componentNameEdit, &QLineEdit::textChanged,
this, SLOT(validate())); this, &ComponentNameDialog::validate);
} }
ComponentNameDialog::~ComponentNameDialog() ComponentNameDialog::~ComponentNameDialog()
@@ -139,14 +139,6 @@ void ComponentNameDialog::generateCodePreview()
ui->plainTextEdit->appendPlainText(QLatin1String("}")); ui->plainTextEdit->appendPlainText(QLatin1String("}"));
} }
void ComponentNameDialog::choosePath()
{
QString dir = QFileDialog::getExistingDirectory(this, tr("Choose a path"),
ui->pathEdit->path());
if (!dir.isEmpty())
ui->pathEdit->setPath(dir);
}
void ComponentNameDialog::validate() void ComponentNameDialog::validate()
{ {
const QString message = isValid(); const QString message = isValid();

View File

@@ -51,8 +51,6 @@ public:
void generateCodePreview(); void generateCodePreview();
public slots:
void choosePath();
void validate(); void validate();
protected: protected:

View File

@@ -78,6 +78,7 @@
#include <QFileInfo> #include <QFileInfo>
#include <QHeaderView> #include <QHeaderView>
#include <QMenu> #include <QMenu>
#include <QMetaMethod>
#include <QPointer> #include <QPointer>
#include <QScopedPointer> #include <QScopedPointer>
#include <QSignalMapper> #include <QSignalMapper>
@@ -147,11 +148,11 @@ void QmlJSEditorWidget::finalizeInitialization()
connect(this->document(), &QTextDocument::modificationChanged, connect(this->document(), &QTextDocument::modificationChanged,
this, &QmlJSEditorWidget::modificationChanged); this, &QmlJSEditorWidget::modificationChanged);
connect(m_qmlJsEditorDocument, SIGNAL(updateCodeWarnings(QmlJS::Document::Ptr)), connect(m_qmlJsEditorDocument, &QmlJSEditorDocument::updateCodeWarnings,
this, SLOT(updateCodeWarnings(QmlJS::Document::Ptr))); this, &QmlJSEditorWidget::updateCodeWarnings);
connect(m_qmlJsEditorDocument, SIGNAL(semanticInfoUpdated(QmlJSTools::SemanticInfo)), connect(m_qmlJsEditorDocument, &QmlJSEditorDocument::semanticInfoUpdated,
this, SLOT(semanticInfoUpdated(QmlJSTools::SemanticInfo))); this, &QmlJSEditorWidget::semanticInfoUpdated);
setRequestMarkEnabled(true); setRequestMarkEnabled(true);
createToolBar(); createToolBar();
@@ -445,7 +446,9 @@ protected:
void QmlJSEditorWidget::setSelectedElements() void QmlJSEditorWidget::setSelectedElements()
{ {
if (!receivers(SIGNAL(selectedElementsChanged(QList<QmlJS::AST::UiObjectMember*>,QString)))) static const QMetaMethod selectedChangedSignal =
QMetaMethod::fromSignal(&QmlJSEditorWidget::selectedElementsChanged);
if (!isSignalConnected(selectedChangedSignal))
return; return;
QTextCursor tc = textCursor(); QTextCursor tc = textCursor();
@@ -540,11 +543,12 @@ void QmlJSEditorWidget::createToolBar()
policy.setHorizontalPolicy(QSizePolicy::Expanding); policy.setHorizontalPolicy(QSizePolicy::Expanding);
m_outlineCombo->setSizePolicy(policy); m_outlineCombo->setSizePolicy(policy);
connect(m_outlineCombo, SIGNAL(activated(int)), this, SLOT(jumpToOutlineElement(int))); connect(m_outlineCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
connect(m_qmlJsEditorDocument->outlineModel(), SIGNAL(updated()), this, &QmlJSEditorWidget::jumpToOutlineElement);
m_outlineCombo->view()/*QTreeView*/, SLOT(expandAll())); connect(m_qmlJsEditorDocument->outlineModel(), &QmlOutlineModel::updated,
connect(m_qmlJsEditorDocument->outlineModel(), SIGNAL(updated()), static_cast<QTreeView *>(m_outlineCombo->view()), &QTreeView::expandAll);
this, SLOT(updateOutlineIndexNow())); connect(m_qmlJsEditorDocument->outlineModel(), &QmlOutlineModel::updated,
this, &QmlJSEditorWidget::updateOutlineIndexNow);
connect(this, &QmlJSEditorWidget::cursorPositionChanged, connect(this, &QmlJSEditorWidget::cursorPositionChanged,
&m_updateOutlineIndexTimer, static_cast<void (QTimer::*)()>(&QTimer::start)); &m_updateOutlineIndexTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
@@ -819,19 +823,12 @@ void QmlJSEditorWidget::showContextPane()
} }
} }
void QmlJSEditorWidget::performQuickFix(int index)
{
m_quickFixes.at(index)->perform();
}
void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e) void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e)
{ {
QPointer<QMenu> menu(new QMenu(this)); QPointer<QMenu> menu(new QMenu(this));
QMenu *refactoringMenu = new QMenu(tr("Refactoring"), menu); QMenu *refactoringMenu = new QMenu(tr("Refactoring"), menu);
QSignalMapper mapper;
connect(&mapper, SIGNAL(mapped(int)), this, SLOT(performQuickFix(int)));
if (!m_qmlJsEditorDocument->isSemanticInfoOutdated()) { if (!m_qmlJsEditorDocument->isSemanticInfoOutdated()) {
AssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked); AssistInterface *interface = createAssistInterface(QuickFix, ExplicitlyInvoked);
if (interface) { if (interface) {
@@ -843,10 +840,8 @@ void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e)
for (int index = 0; index < model->size(); ++index) { for (int index = 0; index < model->size(); ++index) {
AssistProposalItem *item = static_cast<AssistProposalItem *>(model->proposalItem(index)); AssistProposalItem *item = static_cast<AssistProposalItem *>(model->proposalItem(index));
QuickFixOperation::Ptr op = item->data().value<QuickFixOperation::Ptr>(); QuickFixOperation::Ptr op = item->data().value<QuickFixOperation::Ptr>();
m_quickFixes.append(op);
QAction *action = refactoringMenu->addAction(op->description()); QAction *action = refactoringMenu->addAction(op->description());
mapper.setMapping(action, index); connect(action, &QAction::triggered, this, [op]() { op->perform(); });
connect(action, SIGNAL(triggered()), &mapper, SLOT(map()));
} }
delete model; delete model;
} }
@@ -873,9 +868,6 @@ void QmlJSEditorWidget::contextMenuEvent(QContextMenuEvent *e)
appendStandardContextMenuActions(menu); appendStandardContextMenuActions(menu);
menu->exec(e->globalPos()); menu->exec(e->globalPos());
if (!menu)
return;
m_quickFixes.clear();
delete menu; delete menu;
} }

View File

@@ -72,7 +72,6 @@ public:
void inspectElementUnderCursor() const; void inspectElementUnderCursor() const;
public slots:
void findUsages(); void findUsages();
void renameUsages(); void renameUsages();
void showContextPane(); void showContextPane();
@@ -81,7 +80,7 @@ signals:
void outlineModelIndexChanged(const QModelIndex &index); void outlineModelIndexChanged(const QModelIndex &index);
void selectedElementsChanged(QList<QmlJS::AST::UiObjectMember*> offsets, void selectedElementsChanged(QList<QmlJS::AST::UiObjectMember*> offsets,
const QString &wordAtCursor); const QString &wordAtCursor);
private slots: private:
void modificationChanged(bool); void modificationChanged(bool);
void jumpToOutlineElement(int index); void jumpToOutlineElement(int index);
@@ -93,7 +92,6 @@ private slots:
void semanticInfoUpdated(const QmlJSTools::SemanticInfo &semanticInfo); void semanticInfoUpdated(const QmlJSTools::SemanticInfo &semanticInfo);
void performQuickFix(int index);
void updateCodeWarnings(QmlJS::Document::Ptr doc); void updateCodeWarnings(QmlJS::Document::Ptr doc);
protected: protected:
@@ -127,8 +125,6 @@ private:
QModelIndex m_outlineModelIndex; QModelIndex m_outlineModelIndex;
QmlJS::ModelManagerInterface *m_modelManager; QmlJS::ModelManagerInterface *m_modelManager;
TextEditor::QuickFixOperations m_quickFixes;
QmlJS::IContextPane *m_contextPane; QmlJS::IContextPane *m_contextPane;
int m_oldCursorPosition; int m_oldCursorPosition;

View File

@@ -467,28 +467,32 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare
// code model // code model
m_updateDocumentTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL); m_updateDocumentTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL);
m_updateDocumentTimer.setSingleShot(true); m_updateDocumentTimer.setSingleShot(true);
connect(q->document(), SIGNAL(contentsChanged()), &m_updateDocumentTimer, SLOT(start())); connect(q->document(), &QTextDocument::contentsChanged,
connect(&m_updateDocumentTimer, SIGNAL(timeout()), this, SLOT(reparseDocument())); &m_updateDocumentTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
connect(modelManager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)), connect(&m_updateDocumentTimer, &QTimer::timeout,
this, SLOT(onDocumentUpdated(QmlJS::Document::Ptr))); this, &QmlJSEditorDocumentPrivate::reparseDocument);
connect(modelManager, &ModelManagerInterface::documentUpdated,
this, &QmlJSEditorDocumentPrivate::onDocumentUpdated);
// semantic info // semantic info
m_semanticInfoUpdater = new SemanticInfoUpdater(this); m_semanticInfoUpdater = new SemanticInfoUpdater(this);
connect(m_semanticInfoUpdater, SIGNAL(updated(QmlJSTools::SemanticInfo)), connect(m_semanticInfoUpdater, &SemanticInfoUpdater::updated,
this, SLOT(acceptNewSemanticInfo(QmlJSTools::SemanticInfo))); this, &QmlJSEditorDocumentPrivate::acceptNewSemanticInfo);
m_semanticInfoUpdater->start(); m_semanticInfoUpdater->start();
// library info changes // library info changes
m_reupdateSemanticInfoTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL); m_reupdateSemanticInfoTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL);
m_reupdateSemanticInfoTimer.setSingleShot(true); m_reupdateSemanticInfoTimer.setSingleShot(true);
connect(&m_reupdateSemanticInfoTimer, SIGNAL(timeout()), this, SLOT(reupdateSemanticInfo())); connect(&m_reupdateSemanticInfoTimer, &QTimer::timeout,
connect(modelManager, SIGNAL(libraryInfoUpdated(QString,QmlJS::LibraryInfo)), this, &QmlJSEditorDocumentPrivate::reupdateSemanticInfo);
&m_reupdateSemanticInfoTimer, SLOT(start())); connect(modelManager, &ModelManagerInterface::libraryInfoUpdated,
&m_reupdateSemanticInfoTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
// outline model // outline model
m_updateOutlineModelTimer.setInterval(UPDATE_OUTLINE_INTERVAL); m_updateOutlineModelTimer.setInterval(UPDATE_OUTLINE_INTERVAL);
m_updateOutlineModelTimer.setSingleShot(true); m_updateOutlineModelTimer.setSingleShot(true);
connect(&m_updateOutlineModelTimer, SIGNAL(timeout()), this, SLOT(updateOutlineModel())); connect(&m_updateOutlineModelTimer, &QTimer::timeout,
this, &QmlJSEditorDocumentPrivate::updateOutlineModel);
modelManager->updateSourceFiles(QStringList(parent->filePath().toString()), false); modelManager->updateSourceFiles(QStringList(parent->filePath().toString()), false);
} }
@@ -589,8 +593,8 @@ QmlJSEditorDocument::QmlJSEditorDocument()
: d(new Internal::QmlJSEditorDocumentPrivate(this)) : d(new Internal::QmlJSEditorDocumentPrivate(this))
{ {
setId(Constants::C_QMLJSEDITOR_ID); setId(Constants::C_QMLJSEDITOR_ID);
connect(this, SIGNAL(tabSettingsChanged()), connect(this, &TextEditor::TextDocument::tabSettingsChanged,
d, SLOT(invalidateFormatterCache())); d, &Internal::QmlJSEditorDocumentPrivate::invalidateFormatterCache);
setSyntaxHighlighter(new QmlJSHighlighter(document())); setSyntaxHighlighter(new QmlJSHighlighter(document()));
setIndenter(new Internal::Indenter); setIndenter(new Internal::Indenter);
} }

View File

@@ -50,7 +50,6 @@ public:
QmlJSEditorDocumentPrivate(QmlJSEditorDocument *parent); QmlJSEditorDocumentPrivate(QmlJSEditorDocument *parent);
~QmlJSEditorDocumentPrivate(); ~QmlJSEditorDocumentPrivate();
public slots:
void invalidateFormatterCache(); void invalidateFormatterCache();
void reparseDocument(); void reparseDocument();
void onDocumentUpdated(QmlJS::Document::Ptr doc); void onDocumentUpdated(QmlJS::Document::Ptr doc);

View File

@@ -104,16 +104,16 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
// QML task updating manager // QML task updating manager
m_qmlTaskManager = new QmlTaskManager; m_qmlTaskManager = new QmlTaskManager;
addAutoReleasedObject(m_qmlTaskManager); addAutoReleasedObject(m_qmlTaskManager);
connect(m_modelManager, SIGNAL(documentChangedOnDisk(QmlJS::Document::Ptr)), connect(m_modelManager, &QmlJS::ModelManagerInterface::documentChangedOnDisk,
m_qmlTaskManager, SLOT(updateMessages())); m_qmlTaskManager, &QmlTaskManager::updateMessages);
// recompute messages when information about libraries changes // recompute messages when information about libraries changes
connect(m_modelManager, SIGNAL(libraryInfoUpdated(QString,QmlJS::LibraryInfo)), connect(m_modelManager, &QmlJS::ModelManagerInterface::libraryInfoUpdated,
m_qmlTaskManager, SLOT(updateMessages())); m_qmlTaskManager, &QmlTaskManager::updateMessages);
// recompute messages when project data changes (files added or removed) // recompute messages when project data changes (files added or removed)
connect(m_modelManager, SIGNAL(projectInfoUpdated(ProjectInfo)), connect(m_modelManager, &QmlJS::ModelManagerInterface::projectInfoUpdated,
m_qmlTaskManager, SLOT(updateMessages())); m_qmlTaskManager, &QmlTaskManager::updateMessages);
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)), connect(m_modelManager, &QmlJS::ModelManagerInterface::aboutToRemoveFiles,
m_qmlTaskManager, SLOT(documentsRemoved(QStringList))); m_qmlTaskManager, &QmlTaskManager::documentsRemoved);
Context context(Constants::C_QMLJSEDITOR_ID); Context context(Constants::C_QMLJSEDITOR_ID);
@@ -132,26 +132,26 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
QAction *findUsagesAction = new QAction(tr("Find Usages"), this); QAction *findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context); cmd = ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
connect(findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages())); connect(findUsagesAction, &QAction::triggered, this, &QmlJSEditorPlugin::findUsages);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
QAction *renameUsagesAction = new QAction(tr("Rename Symbol Under Cursor"), this); QAction *renameUsagesAction = new QAction(tr("Rename Symbol Under Cursor"), this);
cmd = ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context); cmd = ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R")));
connect(renameUsagesAction, SIGNAL(triggered()), this, SLOT(renameUsages())); connect(renameUsagesAction, &QAction::triggered, this, &QmlJSEditorPlugin::renameUsages);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
QAction *semanticScan = new QAction(tr("Run Checks"), this); QAction *semanticScan = new QAction(tr("Run Checks"), this);
cmd = ActionManager::registerAction(semanticScan, Id(Constants::RUN_SEMANTIC_SCAN)); cmd = ActionManager::registerAction(semanticScan, Id(Constants::RUN_SEMANTIC_SCAN));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+C"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+C")));
connect(semanticScan, SIGNAL(triggered()), this, SLOT(runSemanticScan())); connect(semanticScan, &QAction::triggered, this, &QmlJSEditorPlugin::runSemanticScan);
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
m_reformatFileAction = new QAction(tr("Reformat File"), this); m_reformatFileAction = new QAction(tr("Reformat File"), this);
cmd = ActionManager::registerAction(m_reformatFileAction, Id(Constants::REFORMAT_FILE), context); cmd = ActionManager::registerAction(m_reformatFileAction, Id(Constants::REFORMAT_FILE), context);
connect(m_reformatFileAction, SIGNAL(triggered()), this, SLOT(reformatFile())); connect(m_reformatFileAction, &QAction::triggered, this, &QmlJSEditorPlugin::reformatFile);
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
QAction *inspectElementAction = new QAction(tr("Inspect API for Element Under Cursor"), this); QAction *inspectElementAction = new QAction(tr("Inspect API for Element Under Cursor"), this);
@@ -167,7 +167,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context); cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
cmd->setDefaultKeySequence(UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space) cmd->setDefaultKeySequence(UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
: QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space)); : QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
connect(showQuickToolbar, SIGNAL(triggered()), this, SLOT(showContextPane())); connect(showQuickToolbar, &QAction::triggered, this, &QmlJSEditorPlugin::showContextPane);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
qmlToolsMenu->addAction(cmd); qmlToolsMenu->addAction(cmd);
@@ -195,7 +195,8 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
addAutoReleasedObject(new QuickToolBar); addAutoReleasedObject(new QuickToolBar);
addAutoReleasedObject(new QuickToolBarSettingsPage); addAutoReleasedObject(new QuickToolBarSettingsPage);
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*))); connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
this, &QmlJSEditorPlugin::currentEditorChanged);
return true; return true;
} }
@@ -275,10 +276,10 @@ void QmlJSEditorPlugin::currentEditorChanged(IEditor *editor)
m_currentDocument->disconnect(this); m_currentDocument->disconnect(this);
m_currentDocument = document; m_currentDocument = document;
if (document) { if (document) {
connect(document->document(), SIGNAL(contentsChanged()), connect(document->document(), &QTextDocument::contentsChanged,
this, SLOT(checkCurrentEditorSemanticInfoUpToDate())); this, &QmlJSEditorPlugin::checkCurrentEditorSemanticInfoUpToDate);
connect(document, SIGNAL(semanticInfoUpdated(QmlJSTools::SemanticInfo)), connect(document, &QmlJSEditorDocument::semanticInfoUpdated,
this, SLOT(checkCurrentEditorSemanticInfoUpToDate())); this, &QmlJSEditorPlugin::checkCurrentEditorSemanticInfoUpToDate);
} }
} }

View File

@@ -73,18 +73,16 @@ public:
Utils::JsonSchemaManager *jsonManager() const; Utils::JsonSchemaManager *jsonManager() const;
public Q_SLOTS:
void findUsages(); void findUsages();
void renameUsages(); void renameUsages();
void reformatFile(); void reformatFile();
void showContextPane(); void showContextPane();
private Q_SLOTS: private:
void currentEditorChanged(Core::IEditor *editor); void currentEditorChanged(Core::IEditor *editor);
void runSemanticScan(); void runSemanticScan();
void checkCurrentEditorSemanticInfoUpToDate(); void checkCurrentEditorSemanticInfoUpToDate();
private:
Core::Command *addToolAction(QAction *a, Core::Context &context, Core::Id id, Core::Command *addToolAction(QAction *a, Core::Context &context, Core::Id id,
Core::ActionContainer *c1, const QString &keySequence); Core::ActionContainer *c1, const QString &keySequence);

View File

@@ -782,8 +782,8 @@ FindReferences::FindReferences(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
m_watcher.setPendingResultsLimit(1); m_watcher.setPendingResultsLimit(1);
connect(&m_watcher, SIGNAL(resultsReadyAt(int,int)), this, SLOT(displayResults(int,int))); connect(&m_watcher, &QFutureWatcherBase::resultsReadyAt, this, &FindReferences::displayResults);
connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished())); connect(&m_watcher, &QFutureWatcherBase::finished, this, &FindReferences::searchFinished);
} }
FindReferences::~FindReferences() FindReferences::~FindReferences()
@@ -955,19 +955,19 @@ void FindReferences::displayResults(int first, int last)
label, QString(), symbolName, SearchResultWindow::SearchAndReplace, label, QString(), symbolName, SearchResultWindow::SearchAndReplace,
SearchResultWindow::PreserveCaseDisabled); SearchResultWindow::PreserveCaseDisabled);
m_currentSearch->setTextToReplace(replacement); m_currentSearch->setTextToReplace(replacement);
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)), connect(m_currentSearch.data(), &SearchResult::replaceButtonClicked,
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool))); this, &FindReferences::onReplaceButtonClicked);
} }
connect(m_currentSearch, SIGNAL(activated(Core::SearchResultItem)), connect(m_currentSearch.data(), &SearchResult::activated,
this, SLOT(openEditor(Core::SearchResultItem))); this, &FindReferences::openEditor);
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel())); connect(m_currentSearch.data(), &SearchResult::cancelled, this, &FindReferences::cancel);
connect(m_currentSearch, SIGNAL(paused(bool)), this, SLOT(setPaused(bool))); connect(m_currentSearch.data(), &SearchResult::paused, this, &FindReferences::setPaused);
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus)); SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
FutureProgress *progress = ProgressManager::addTask( FutureProgress *progress = ProgressManager::addTask(
m_watcher.future(), tr("Searching for Usages"), m_watcher.future(), tr("Searching for Usages"),
QmlJSEditor::Constants::TASK_SEARCH); QmlJSEditor::Constants::TASK_SEARCH);
connect(progress, SIGNAL(clicked()), m_currentSearch, SLOT(popup())); connect(progress, &FutureProgress::clicked, m_currentSearch.data(), &SearchResult::popup);
++first; ++first;
} }

View File

@@ -67,7 +67,7 @@ public:
FindReferences(QObject *parent = 0); FindReferences(QObject *parent = 0);
virtual ~FindReferences(); virtual ~FindReferences();
Q_SIGNALS: signals:
void changed(); void changed();
public: public:
@@ -77,7 +77,7 @@ public:
static QList<Usage> findUsageOfType(const QString &fileName, const QString typeName); static QList<Usage> findUsageOfType(const QString &fileName, const QString typeName);
private Q_SLOTS: private:
void displayResults(int first, int last); void displayResults(int first, int last);
void searchFinished(); void searchFinished();
void cancel(); void cancel();
@@ -85,7 +85,6 @@ private Q_SLOTS:
void openEditor(const Core::SearchResultItem &item); void openEditor(const Core::SearchResultItem &item);
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase); void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
private:
QPointer<Core::SearchResult> m_currentSearch; QPointer<Core::SearchResult> m_currentSearch;
QFutureWatcher<Usage> m_watcher; QFutureWatcher<Usage> m_watcher;
}; };

View File

@@ -117,7 +117,7 @@ QmlJSOutlineWidget::QmlJSOutlineWidget(QWidget *parent) :
m_showBindingsAction->setText(tr("Show All Bindings")); m_showBindingsAction->setText(tr("Show All Bindings"));
m_showBindingsAction->setCheckable(true); m_showBindingsAction->setCheckable(true);
m_showBindingsAction->setChecked(true); m_showBindingsAction->setChecked(true);
connect(m_showBindingsAction, SIGNAL(toggled(bool)), this, SLOT(setShowBindings(bool))); connect(m_showBindingsAction, &QAction::toggled, this, &QmlJSOutlineWidget::setShowBindings);
setLayout(layout); setLayout(layout);
} }
@@ -129,16 +129,16 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel()); m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel());
modelUpdated(); modelUpdated();
connect(m_treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), connect(m_treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
this, SLOT(updateSelectionInText(QItemSelection))); this, &QmlJSOutlineWidget::updateSelectionInText);
connect(m_treeView, SIGNAL(activated(QModelIndex)), connect(m_treeView, &QAbstractItemView::activated,
this, SLOT(focusEditor())); this, &QmlJSOutlineWidget::focusEditor);
connect(m_editor, SIGNAL(outlineModelIndexChanged(QModelIndex)), connect(m_editor, &QmlJSEditorWidget::outlineModelIndexChanged,
this, SLOT(updateSelectionInTree(QModelIndex))); this, &QmlJSOutlineWidget::updateSelectionInTree);
connect(m_editor->qmlJsEditorDocument()->outlineModel(), SIGNAL(updated()), connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QmlOutlineModel::updated,
this, SLOT(modelUpdated())); this, &QmlJSOutlineWidget::modelUpdated);
} }
QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const

View File

@@ -71,15 +71,13 @@ public:
virtual void restoreSettings(const QVariantMap &map); virtual void restoreSettings(const QVariantMap &map);
virtual QVariantMap settings() const; virtual QVariantMap settings() const;
private slots: private:
void modelUpdated(); void modelUpdated();
void updateSelectionInTree(const QModelIndex &index); void updateSelectionInTree(const QModelIndex &index);
void updateSelectionInText(const QItemSelection &selection); void updateSelectionInText(const QItemSelection &selection);
void updateTextCursor(const QModelIndex &index); void updateTextCursor(const QModelIndex &index);
void focusEditor(); void focusEditor();
void setShowBindings(bool showBindings); void setShowBindings(bool showBindings);
private:
bool syncCursor(); bool syncCursor();
private: private:

View File

@@ -57,8 +57,8 @@ void QmlJSOutlineTreeView::contextMenuEvent(QContextMenuEvent *event)
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(tr("Expand All"), this, SLOT(expandAll())); contextMenu.addAction(tr("Expand All"), this, [this] { expandAll(); });
contextMenu.addAction(tr("Collapse All"), this, SLOT(collapseAllExceptRoot())); contextMenu.addAction(tr("Collapse All"), this, [this] { collapseAllExceptRoot(); });
contextMenu.exec(event->globalPos()); contextMenu.exec(event->globalPos());

View File

@@ -38,7 +38,7 @@ public:
void contextMenuEvent(QContextMenuEvent *event); void contextMenuEvent(QContextMenuEvent *event);
private slots: private:
void collapseAllExceptRoot(); void collapseAllExceptRoot();
}; };

View File

@@ -534,10 +534,10 @@ SemanticHighlighter::SemanticHighlighter(QmlJSEditorDocument *document)
, m_document(document) , m_document(document)
, m_startRevision(0) , m_startRevision(0)
{ {
connect(&m_watcher, SIGNAL(resultsReadyAt(int,int)), connect(&m_watcher, &QFutureWatcherBase::resultsReadyAt,
this, SLOT(applyResults(int,int))); this, &SemanticHighlighter::applyResults);
connect(&m_watcher, SIGNAL(finished()), connect(&m_watcher, &QFutureWatcherBase::finished,
this, SLOT(finished())); this, &SemanticHighlighter::finished);
} }
void SemanticHighlighter::rerun(const QmlJSTools::SemanticInfo &semanticInfo) void SemanticHighlighter::rerun(const QmlJSTools::SemanticInfo &semanticInfo)

View File

@@ -80,11 +80,9 @@ public:
void reportMessagesInfo(const QVector<QTextLayout::FormatRange> &diagnosticMessages, void reportMessagesInfo(const QVector<QTextLayout::FormatRange> &diagnosticMessages,
const QHash<int,QTextCharFormat> &formats); const QHash<int,QTextCharFormat> &formats);
private slots: private:
void applyResults(int from, int to); void applyResults(int from, int to);
void finished(); void finished();
private:
void run(QFutureInterface<Use> &futureInterface, const QmlJSTools::SemanticInfo &semanticInfo); void run(QFutureInterface<Use> &futureInterface, const QmlJSTools::SemanticInfo &semanticInfo);
QFutureWatcher<Use> m_watcher; QFutureWatcher<Use> m_watcher;

View File

@@ -47,7 +47,7 @@ public:
void update(const QmlJS::Document::Ptr &doc, const QmlJS::Snapshot &snapshot); void update(const QmlJS::Document::Ptr &doc, const QmlJS::Snapshot &snapshot);
void reupdate(const QmlJS::Snapshot &snapshot); void reupdate(const QmlJS::Snapshot &snapshot);
Q_SIGNALS: signals:
void updated(const QmlJSTools::SemanticInfo &semanticInfo); void updated(const QmlJSTools::SemanticInfo &semanticInfo);
protected: protected:

View File

@@ -52,15 +52,14 @@ QmlTaskManager::QmlTaskManager(QObject *parent) :
m_updatingSemantic(false) m_updatingSemantic(false)
{ {
// displaying results incrementally leads to flickering // displaying results incrementally leads to flickering
// connect(&m_messageCollector, SIGNAL(resultsReadyAt(int,int)), // connect(&m_messageCollector, &QFutureWatcherBase::resultsReadyAt,
// SLOT(displayResults(int,int))); // this, &QmlTaskManager::displayResults);
connect(&m_messageCollector, SIGNAL(finished()), connect(&m_messageCollector, &QFutureWatcherBase::finished,
SLOT(displayAllResults())); this, &QmlTaskManager::displayAllResults);
m_updateDelay.setInterval(500); m_updateDelay.setInterval(500);
m_updateDelay.setSingleShot(true); m_updateDelay.setSingleShot(true);
connect(&m_updateDelay, SIGNAL(timeout()), connect(&m_updateDelay, &QTimer::timeout, this, [this] { updateMessagesNow(); });
SLOT(updateMessagesNow()));
} }
static QList<Task> convertToTasks(const QList<DiagnosticMessage> &messages, const FileName &fileName, Core::Id category) static QList<Task> convertToTasks(const QList<DiagnosticMessage> &messages, const FileName &fileName, Core::Id category)

View File

@@ -47,17 +47,15 @@ public:
void extensionsInitialized(); void extensionsInitialized();
public slots:
void updateMessages(); void updateMessages();
void updateSemanticMessagesNow(); void updateSemanticMessagesNow();
void documentsRemoved(const QStringList &path); void documentsRemoved(const QStringList &path);
private slots: private:
void displayResults(int begin, int end); void displayResults(int begin, int end);
void displayAllResults(); void displayAllResults();
void updateMessagesNow(bool updateSemantic = false); void updateMessagesNow(bool updateSemantic = false);
private:
void insertTask(const ProjectExplorer::Task &task); void insertTask(const ProjectExplorer::Task &task);
void removeTasksForFile(const QString &fileName); void removeTasksForFile(const QString &fileName);
void removeAllTasks(bool clearSemantic); void removeAllTasks(bool clearSemantic);

View File

@@ -436,12 +436,17 @@ ContextPaneWidget* QuickToolBar::contextWidget()
{ {
if (m_widget.isNull()) { //lazily recreate widget if (m_widget.isNull()) { //lazily recreate widget
m_widget = new ContextPaneWidget; m_widget = new ContextPaneWidget;
connect(m_widget.data(), SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(onPropertyChanged(QString,QVariant))); connect(m_widget.data(), &ContextPaneWidget::propertyChanged,
connect(m_widget.data(), SIGNAL(removeProperty(QString)), this, SLOT(onPropertyRemoved(QString))); this, &QuickToolBar::onPropertyChanged);
connect(m_widget.data(), SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SLOT(onPropertyRemovedAndChange(QString,QString,QVariant,bool))); connect(m_widget.data(), &ContextPaneWidget::removeProperty,
connect(m_widget.data(), SIGNAL(enabledChanged(bool)), this, SLOT(onEnabledChanged(bool))); this, &QuickToolBar::onPropertyRemoved);
connect(m_widget.data(), SIGNAL(pinnedChanged(bool)), this, SLOT(onPinnedChanged(bool))); connect(m_widget.data(), &ContextPaneWidget::removeAndChangeProperty,
connect(m_widget.data(), SIGNAL(closed()), this, SIGNAL(closed())); this, &QuickToolBar::onPropertyRemovedAndChange);
connect(m_widget.data(), &ContextPaneWidget::enabledChanged,
this, &QuickToolBar::onEnabledChanged);
connect(m_widget.data(), &ContextPaneWidget::pinnedChanged,
this, &QuickToolBar::onPinnedChanged);
connect(m_widget.data(), &ContextPaneWidget::closed, this, &IContextPane::closed);
} }
return m_widget.data(); return m_widget.data();
} }

View File

@@ -47,7 +47,6 @@ public:
void setEnabled(bool); void setEnabled(bool);
QWidget* widget(); QWidget* widget();
public slots:
void onPropertyChanged(const QString &, const QVariant &); void onPropertyChanged(const QString &, const QVariant &);
void onPropertyRemoved(const QString &); void onPropertyRemoved(const QString &);
void onPropertyRemovedAndChange(const QString &, const QString &, const QVariant &, bool removeFirst = true); void onPropertyRemovedAndChange(const QString &, const QString &, const QVariant &, bool removeFirst = true);

View File

@@ -65,8 +65,8 @@ QmlJSCodeStylePreferencesWidget::QmlJSCodeStylePreferencesWidget(QWidget *parent
provider->decorateEditor(m_ui->previewTextEdit); provider->decorateEditor(m_ui->previewTextEdit);
decorateEditor(TextEditorSettings::fontSettings()); decorateEditor(TextEditorSettings::fontSettings());
connect(TextEditorSettings::instance(), SIGNAL(fontSettingsChanged(TextEditor::FontSettings)), connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
this, SLOT(decorateEditor(TextEditor::FontSettings))); this, &QmlJSCodeStylePreferencesWidget::decorateEditor);
setVisualizeWhitespace(true); setVisualizeWhitespace(true);

View File

@@ -55,13 +55,12 @@ public:
void setPreferences(TextEditor::ICodeStylePreferences *preferences); void setPreferences(TextEditor::ICodeStylePreferences *preferences);
private slots: private:
void decorateEditor(const TextEditor::FontSettings &fontSettings); void decorateEditor(const TextEditor::FontSettings &fontSettings);
void setVisualizeWhitespace(bool on); void setVisualizeWhitespace(bool on);
void slotSettingsChanged(); void slotSettingsChanged();
void updatePreview(); void updatePreview();
private:
TextEditor::ICodeStylePreferences *m_preferences; TextEditor::ICodeStylePreferences *m_preferences;
Ui::QmlJSCodeStyleSettingsPage *m_ui; Ui::QmlJSCodeStyleSettingsPage *m_ui;
}; };

View File

@@ -60,11 +60,10 @@ public:
QHash<QString, QList<Entry> > entries() const; QHash<QString, QList<Entry> > entries() const;
private slots: private:
void onDocumentUpdated(const QmlJS::Document::Ptr &doc); void onDocumentUpdated(const QmlJS::Document::Ptr &doc);
void onAboutToRemoveFiles(const QStringList &files); void onAboutToRemoveFiles(const QStringList &files);
private:
mutable QMutex m_mutex; mutable QMutex m_mutex;
QHash<QString, QList<Entry> > m_entries; QHash<QString, QList<Entry> > m_entries;
}; };

View File

@@ -219,8 +219,8 @@ void ModelManager::delayedInitialization()
CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance(); CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance();
// It's important to have a direct connection here so we can prevent // It's important to have a direct connection here so we can prevent
// the source and AST of the cpp document being cleaned away. // the source and AST of the cpp document being cleaned away.
connect(cppModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), connect(cppModelManager, &CppTools::CppModelManager::documentUpdated,
this, SLOT(maybeQueueCppQmlTypeUpdate(CPlusPlus::Document::Ptr)), Qt::DirectConnection); this, &ModelManagerInterface::maybeQueueCppQmlTypeUpdate, Qt::DirectConnection);
connect(SessionManager::instance(), &SessionManager::projectRemoved, connect(SessionManager::instance(), &SessionManager::projectRemoved,
this, &ModelManager::removeProjectInfo); this, &ModelManager::removeProjectInfo);

View File

@@ -56,9 +56,8 @@ protected:
WorkingCopy workingCopyInternal() const override; WorkingCopy workingCopyInternal() const override;
void addTaskInternal(QFuture<void> result, const QString &msg, const char *taskId) const override; void addTaskInternal(QFuture<void> result, const QString &msg, const char *taskId) const override;
ProjectInfo defaultProjectInfoForProject(ProjectExplorer::Project *project) const override; ProjectInfo defaultProjectInfoForProject(ProjectExplorer::Project *project) const override;
private slots:
void updateDefaultProjectInfo();
private: private:
void updateDefaultProjectInfo();
void loadDefaultQmlTypeDescriptions(); void loadDefaultQmlTypeDescriptions();
QHash<QString, QmlJS::Dialect> initLanguageForSuffix() const; QHash<QString, QmlJS::Dialect> initLanguageForSuffix() const;
}; };

View File

@@ -105,10 +105,10 @@ bool QmlJSToolsPlugin::initialize(const QStringList &arguments, QString *error)
mqmljstools->addAction(cmd); mqmljstools->addAction(cmd);
// watch task progress // watch task progress
connect(ProgressManager::instance(), SIGNAL(taskStarted(Core::Id)), connect(ProgressManager::instance(), &ProgressManager::taskStarted,
this, SLOT(onTaskStarted(Core::Id))); this, &QmlJSToolsPlugin::onTaskStarted);
connect(ProgressManager::instance(), SIGNAL(allTasksFinished(Core::Id)), connect(ProgressManager::instance(), &ProgressManager::allTasksFinished,
this, SLOT(onAllTasksFinished(Core::Id))); this, &QmlJSToolsPlugin::onAllTasksFinished);
return true; return true;
} }

View File

@@ -58,20 +58,20 @@ public:
ShutdownFlag aboutToShutdown(); ShutdownFlag aboutToShutdown();
ModelManager *modelManager() { return m_modelManager; } ModelManager *modelManager() { return m_modelManager; }
private slots: private:
void onTaskStarted(Core::Id type); void onTaskStarted(Core::Id type);
void onAllTasksFinished(Core::Id type); void onAllTasksFinished(Core::Id type);
#ifdef WITH_TESTS
void test_basic();
#endif
private:
ModelManager *m_modelManager; ModelManager *m_modelManager;
QmlJSToolsSettings *m_settings; QmlJSToolsSettings *m_settings;
QAction *m_resetCodeModelAction; QAction *m_resetCodeModelAction;
static QmlJSToolsPlugin *m_instance; static QmlJSToolsPlugin *m_instance;
#ifdef WITH_TESTS
private slots:
void test_basic();
#endif
}; };
} // namespace Internal } // namespace Internal