ProjectExplorer: Follow up on too-much-magic in IProjectManager

Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-03-03 18:16:34 +01:00
parent 57144e28da
commit c1bfc5d8ec
54 changed files with 152 additions and 532 deletions

View File

@@ -24,7 +24,6 @@
****************************************************************************/
#include "qmlprojectplugin.h"
#include "qmlprojectmanager.h"
#include "qmlproject.h"
#include "qmlprojectrunconfigurationfactory.h"
#include "fileformat/qmlprojectfileformat.h"
@@ -32,7 +31,9 @@
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/icore.h>
#include <qtsupport/qtsupportconstants.h>
#include <projectexplorer/projectmanager.h>
#include <qmljstools/qmljstoolsconstants.h>
#include <QtPlugin>
@@ -40,6 +41,8 @@
#include <QMessageBox>
#include <QPushButton>
using namespace ProjectExplorer;
namespace QmlProjectManager {
QmlProjectPlugin::QmlProjectPlugin()
@@ -53,9 +56,9 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
{
Q_UNUSED(errorMessage)
addAutoReleasedObject(new Internal::Manager);
addAutoReleasedObject(new Internal::QmlProjectRunConfigurationFactory);
ProjectManager::registerProjectType<QmlProject>(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
Core::FileIconProvider::registerIconOverlayForSuffix(":/qmlproject/images/qmlproject.png", "qmlproject");
return true;
}