forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
090c106929
commit
7609e56ee3
@@ -104,12 +104,13 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
|
||||
m_updateCppQmlTypesTimer = new QTimer(this);
|
||||
m_updateCppQmlTypesTimer->setInterval(1000);
|
||||
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->setInterval(15000);
|
||||
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::LibraryInfo>("QmlJS::LibraryInfo");
|
||||
|
||||
@@ -205,9 +205,11 @@ public:
|
||||
PathsAndLanguages paths,
|
||||
ModelManagerInterface *modelManager,
|
||||
bool emitDocChangedOnDisk, bool libOnly = true);
|
||||
public slots:
|
||||
|
||||
virtual void resetCodeModel();
|
||||
void removeProjectInfo(ProjectExplorer::Project *project);
|
||||
void maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc);
|
||||
|
||||
signals:
|
||||
void documentUpdated(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 projectInfoUpdated(const ProjectInfo &pinfo);
|
||||
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:
|
||||
Q_INVOKABLE void queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan);
|
||||
Q_INVOKABLE void asyncReset();
|
||||
virtual void startCppQmlTypeUpdate();
|
||||
QMutex *mutex() const;
|
||||
virtual QHash<QString,Dialect> languageForSuffix() const;
|
||||
virtual void writeMessageInternal(const QString &msg) const;
|
||||
|
||||
@@ -51,8 +51,8 @@ Utils::FileSystemWatcher *PluginDumper::pluginWatcher()
|
||||
if (!m_pluginWatcher) {
|
||||
m_pluginWatcher = new Utils::FileSystemWatcher(this);
|
||||
m_pluginWatcher->setObjectName(QLatin1String("PluginDumperWatcher"));
|
||||
connect(m_pluginWatcher, SIGNAL(fileChanged(QString)),
|
||||
this, SLOT(pluginChanged(QString)));
|
||||
connect(m_pluginWatcher, &Utils::FileSystemWatcher::fileChanged,
|
||||
this, &PluginDumper::pluginChanged);
|
||||
}
|
||||
return m_pluginWatcher;
|
||||
}
|
||||
@@ -509,8 +509,10 @@ void PluginDumper::runQmlDump(const QmlJS::ModelManagerInterface::ProjectInfo &i
|
||||
{
|
||||
QProcess *process = new QProcess(this);
|
||||
process->setEnvironment(info.qmlDumpEnvironment.toStringList());
|
||||
connect(process, SIGNAL(finished(int)), SLOT(qmlPluginTypeDumpDone(int)));
|
||||
connect(process, SIGNAL(error(QProcess::ProcessError)), SLOT(qmlPluginTypeDumpError(QProcess::ProcessError)));
|
||||
connect(process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||
this, &PluginDumper::qmlPluginTypeDumpDone);
|
||||
connect(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
|
||||
this, &PluginDumper::qmlPluginTypeDumpError);
|
||||
process->start(info.qmlDumpPath, arguments);
|
||||
m_runningQmldumps.insert(process, importPath);
|
||||
}
|
||||
|
||||
@@ -52,13 +52,13 @@ public:
|
||||
void scheduleRedumpPlugins();
|
||||
void scheduleMaybeRedumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info);
|
||||
|
||||
private slots:
|
||||
void onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info,
|
||||
bool force = false);
|
||||
void onLoadPluginTypes(const QString &libraryPath, const QString &importPath,
|
||||
const QString &importUri, const QString &importVersion);
|
||||
void dumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info);
|
||||
void dumpAllPlugins();
|
||||
private:
|
||||
Q_INVOKABLE void onLoadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info,
|
||||
bool force = false);
|
||||
Q_INVOKABLE void onLoadPluginTypes(const QString &libraryPath, const QString &importPath,
|
||||
const QString &importUri, const QString &importVersion);
|
||||
Q_INVOKABLE void dumpBuiltins(const QmlJS::ModelManagerInterface::ProjectInfo &info);
|
||||
Q_INVOKABLE void dumpAllPlugins();
|
||||
void qmlPluginTypeDumpDone(int exitCode);
|
||||
void qmlPluginTypeDumpError(QProcess::ProcessError error);
|
||||
void pluginChanged(const QString &pluginLibrary);
|
||||
|
||||
Reference in New Issue
Block a user