forked from qt-creator/qt-creator
QmlProjectManager: Hide plugin class in .cpp
Change-Id: If9ed1c00c53f127ba328f5011772431b5e5b25f9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
// Copyright (C) 2016 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "qdslandingpage.h"
|
|
||||||
#include "qmlprojectplugin.h"
|
#include "qmlprojectplugin.h"
|
||||||
|
|
||||||
|
#include "qdslandingpage.h"
|
||||||
#include "qmlproject.h"
|
#include "qmlproject.h"
|
||||||
#include "qmlprojectconstants.h"
|
#include "qmlprojectconstants.h"
|
||||||
#include "qmlprojectmanagertr.h"
|
#include "qmlprojectmanagertr.h"
|
||||||
@@ -20,6 +21,8 @@
|
|||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
@@ -99,19 +102,6 @@ public:
|
|||||||
QdsLandingPageWidget *landingPageWidget = nullptr;
|
QdsLandingPageWidget *landingPageWidget = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
QmlProjectPlugin::~QmlProjectPlugin()
|
|
||||||
{
|
|
||||||
QTC_ASSERT(d, return);
|
|
||||||
|
|
||||||
if (d->lastMessageBox)
|
|
||||||
d->lastMessageBox->deleteLater();
|
|
||||||
if (d->landingPage)
|
|
||||||
d->landingPage->deleteLater();
|
|
||||||
if (d->landingPageWidget)
|
|
||||||
d->landingPageWidget->deleteLater();
|
|
||||||
delete d;
|
|
||||||
}
|
|
||||||
|
|
||||||
void openQDS(const FilePath &fileName)
|
void openQDS(const FilePath &fileName)
|
||||||
{
|
{
|
||||||
const FilePath qdsPath = qdsInstallationEntry();
|
const FilePath qdsPath = qdsInstallationEntry();
|
||||||
@@ -236,6 +226,37 @@ static QmlBuildSystem *qmlBuildSystemforFileNode(const FileNode *fileNode)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class QmlProjectPlugin final : public ExtensionSystem::IPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProjectManager.json")
|
||||||
|
|
||||||
|
public:
|
||||||
|
~QmlProjectPlugin()
|
||||||
|
{
|
||||||
|
if (d->lastMessageBox)
|
||||||
|
d->lastMessageBox->deleteLater();
|
||||||
|
if (d->landingPage)
|
||||||
|
d->landingPage->deleteLater();
|
||||||
|
if (d->landingPageWidget)
|
||||||
|
d->landingPageWidget->deleteLater();
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void editorModeChanged(Utils::Id newMode, Utils::Id oldMode);
|
||||||
|
void openQtc(bool permanent = false);
|
||||||
|
void openQds(bool permanent = false);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initialize() final;
|
||||||
|
void displayQmlLandingPage();
|
||||||
|
void hideQmlLandingPage();
|
||||||
|
void updateQmlLandingPageProjectInfo(const Utils::FilePath &projectFile);
|
||||||
|
|
||||||
|
class QmlProjectPluginPrivate *d = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
void QmlProjectPlugin::initialize()
|
void QmlProjectPlugin::initialize()
|
||||||
{
|
{
|
||||||
d = new QmlProjectPluginPrivate;
|
d = new QmlProjectPluginPrivate;
|
||||||
@@ -451,3 +472,5 @@ FilePath projectFilePath()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // QmlProjectManager::Internal
|
} // QmlProjectManager::Internal
|
||||||
|
|
||||||
|
#include "qmlprojectplugin.moc"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <extensionsystem/iplugin.h>
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
|
namespace Core { class IEditor; }
|
||||||
|
|
||||||
namespace QmlProjectManager::Internal {
|
namespace QmlProjectManager::Internal {
|
||||||
|
|
||||||
void openQDS(const Utils::FilePath &fileName);
|
void openQDS(const Utils::FilePath &fileName);
|
||||||
@@ -20,27 +20,4 @@ QString qdsVersion(const Utils::FilePath &projectFilePath);
|
|||||||
void openInQDSWithProject(const Utils::FilePath &filePath);
|
void openInQDSWithProject(const Utils::FilePath &filePath);
|
||||||
const QString readFileContents(const Utils::FilePath &filePath);
|
const QString readFileContents(const Utils::FilePath &filePath);
|
||||||
|
|
||||||
class QmlProjectPlugin final : public ExtensionSystem::IPlugin
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProjectManager.json")
|
|
||||||
|
|
||||||
public:
|
|
||||||
QmlProjectPlugin() = default;
|
|
||||||
~QmlProjectPlugin() final;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void editorModeChanged(Utils::Id newMode, Utils::Id oldMode);
|
|
||||||
void openQtc(bool permanent = false);
|
|
||||||
void openQds(bool permanent = false);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialize() final;
|
|
||||||
void displayQmlLandingPage();
|
|
||||||
void hideQmlLandingPage();
|
|
||||||
void updateQmlLandingPageProjectInfo(const Utils::FilePath &projectFile);
|
|
||||||
|
|
||||||
class QmlProjectPluginPrivate *d = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // QmlProject::Internal
|
} // QmlProject::Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user