diff options
Diffstat (limited to 'src/plugins/qmlprojectmanager')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlproject.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectfile.cpp | 63 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectfile.h | 49 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectmanager.pro | 2 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectmanager.qbs | 1 |
5 files changed, 2 insertions, 118 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 43fbe6ab56..096fca8a2f 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "qmlproject.h" -#include "qmlprojectfile.h" #include "fileformat/qmlprojectfileformat.h" #include "fileformat/qmlprojectitem.h" #include "qmlprojectrunconfiguration.h" @@ -59,8 +58,8 @@ QmlProject::QmlProject(const Utils::FileName &fileName) : m_defaultImport(UnknownImport) { setId("QmlProjectManager.QmlProject"); - setDocument(new Internal::QmlProjectFile(this, fileName)); - DocumentManager::addDocument(document(), true); + setDocument(new ProjectDocument(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName, + [this]() { refreshProjectFile(); })); setProjectContext(Context(QmlProjectManager::Constants::PROJECTCONTEXT)); setProjectLanguages(Context(ProjectExplorer::Constants::QMLJS_LANGUAGE_ID)); diff --git a/src/plugins/qmlprojectmanager/qmlprojectfile.cpp b/src/plugins/qmlprojectmanager/qmlprojectfile.cpp deleted file mode 100644 index 3794f1d11a..0000000000 --- a/src/plugins/qmlprojectmanager/qmlprojectfile.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "qmlprojectfile.h" -#include "qmlproject.h" -#include "qmlprojectconstants.h" -#include <utils/qtcassert.h> - -namespace QmlProjectManager { -namespace Internal { - -QmlProjectFile::QmlProjectFile(QmlProject *parent, const Utils::FileName &fileName) : - m_project(parent) -{ - QTC_CHECK(m_project); - QTC_CHECK(!fileName.isEmpty()); - setId("Qml.ProjectFile"); - setMimeType(QLatin1String(Constants::QMLPROJECT_MIMETYPE)); - setFilePath(fileName); -} - -Core::IDocument::ReloadBehavior QmlProjectFile::reloadBehavior(ChangeTrigger state, ChangeType type) const -{ - Q_UNUSED(state) - Q_UNUSED(type) - return BehaviorSilent; -} - -bool QmlProjectFile::reload(QString *errorString, ReloadFlag flag, ChangeType type) -{ - Q_UNUSED(errorString) - Q_UNUSED(flag) - - if (type == TypeContents) - m_project->refreshProjectFile(); - - return true; -} - -} // namespace Internal -} // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectfile.h b/src/plugins/qmlprojectmanager/qmlprojectfile.h deleted file mode 100644 index 90805fa018..0000000000 --- a/src/plugins/qmlprojectmanager/qmlprojectfile.h +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include <coreplugin/idocument.h> - -namespace QmlProjectManager { - -class QmlProject; - -namespace Internal { - -class QmlProjectFile : public Core::IDocument -{ -public: - QmlProjectFile(QmlProject *parent, const Utils::FileName &fileName); - - ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; - bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - -private: - QmlProject *m_project; -}; - -} // namespace Internal -} // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro index a28281a17d..2a12d7a631 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager.pro +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.pro @@ -9,7 +9,6 @@ HEADERS += qmlproject.h \ qmlprojectplugin.h \ qmlprojectconstants.h \ qmlprojectnodes.h \ - qmlprojectfile.h \ qmlprojectrunconfiguration.h \ qmlprojectrunconfigurationfactory.h \ qmlprojectmanager_global.h \ @@ -20,7 +19,6 @@ SOURCES += qmlproject.cpp \ qmlprojectenvironmentaspect.cpp \ qmlprojectplugin.cpp \ qmlprojectnodes.cpp \ - qmlprojectfile.cpp \ qmlprojectrunconfiguration.cpp \ qmlprojectrunconfigurationfactory.cpp \ qmlprojectrunconfigurationwidget.cpp diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs index a033afb338..b6dcdcd5f5 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs +++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs @@ -18,7 +18,6 @@ QtcPlugin { "qmlproject.qrc", "qmlprojectconstants.h", "qmlprojectenvironmentaspect.cpp", "qmlprojectenvironmentaspect.h", - "qmlprojectfile.cpp", "qmlprojectfile.h", "qmlprojectmanager_global.h", "qmlprojectmanagerconstants.h", "qmlprojectnodes.cpp", "qmlprojectnodes.h", |