2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-09-04 16:51:11 +02:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2009-09-04 16:51:11 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-09-04 16:51:11 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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 Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2009-09-04 16:51:11 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-09-04 16:51:11 +02:00
|
|
|
|
2010-02-15 13:49:00 +01:00
|
|
|
#include "qmljsmodelmanager.h"
|
2010-11-11 10:05:05 +01:00
|
|
|
#include "qmljstoolsconstants.h"
|
2012-04-13 11:57:34 +02:00
|
|
|
#include "qmljssemanticinfo.h"
|
2012-12-06 17:20:58 +01:00
|
|
|
#include "qmljsbundleprovider.h"
|
2009-09-04 16:51:11 +02:00
|
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
2011-05-30 12:56:24 +02:00
|
|
|
#include <coreplugin/messagemanager.h>
|
2014-01-23 14:28:31 +01:00
|
|
|
#include <coreplugin/progressmanager/progressmanager.h>
|
2014-09-15 00:12:27 +02:00
|
|
|
#include <cpptools/cppmodelmanager.h>
|
2014-01-23 14:28:31 +01:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2012-12-06 17:20:58 +01:00
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
2010-06-22 12:54:19 +02:00
|
|
|
#include <projectexplorer/project.h>
|
2010-09-27 15:51:49 +02:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2011-06-28 12:01:56 +02:00
|
|
|
#include <projectexplorer/session.h>
|
2012-12-06 17:20:58 +01:00
|
|
|
#include <projectexplorer/target.h>
|
2014-01-23 14:28:31 +01:00
|
|
|
#include <qmljs/qmljsbind.h>
|
|
|
|
|
#include <qmljs/qmljsfindexportedcpptypes.h>
|
|
|
|
|
#include <qmljs/qmljsplugindumper.h>
|
2012-12-06 17:20:58 +01:00
|
|
|
#include <qtsupport/qmldumptool.h>
|
2014-01-23 14:28:31 +01:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
2012-12-06 17:20:58 +01:00
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
2014-01-23 14:28:31 +01:00
|
|
|
#include <texteditor/basetextdocument.h>
|
|
|
|
|
#include <utils/hostosinfo.h>
|
2009-09-04 16:51:11 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QFileInfo>
|
2012-02-09 09:35:03 +01:00
|
|
|
#include <utils/runextensions.h>
|
2013-07-17 11:27:46 +02:00
|
|
|
#include <QTextDocument>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QTextStream>
|
|
|
|
|
#include <QTimer>
|
2012-12-06 17:20:58 +01:00
|
|
|
#include <QRegExp>
|
2014-04-11 23:07:52 +02:00
|
|
|
#include <QLibraryInfo>
|
|
|
|
|
#include <qglobal.h>
|
2009-10-01 16:38:08 +02:00
|
|
|
|
2013-08-30 09:22:42 +02:00
|
|
|
using namespace Core;
|
2010-01-25 14:18:53 +01:00
|
|
|
using namespace QmlJS;
|
2010-11-11 10:05:05 +01:00
|
|
|
using namespace QmlJSTools;
|
|
|
|
|
using namespace QmlJSTools::Internal;
|
2009-09-04 16:51:11 +02:00
|
|
|
|
2012-12-06 17:20:58 +01:00
|
|
|
|
2014-07-24 11:48:30 +02:00
|
|
|
ModelManagerInterface::ProjectInfo QmlJSTools::Internal::ModelManager::defaultProjectInfoForProject(
|
|
|
|
|
ProjectExplorer::Project *project) const
|
2012-12-06 17:20:58 +01:00
|
|
|
{
|
|
|
|
|
ModelManagerInterface::ProjectInfo projectInfo(project);
|
|
|
|
|
ProjectExplorer::Target *activeTarget = 0;
|
|
|
|
|
if (project) {
|
2013-08-30 09:22:42 +02:00
|
|
|
QList<MimeGlobPattern> globs;
|
2013-08-30 16:38:57 +02:00
|
|
|
foreach (const MimeType &mimeType, MimeDatabase::mimeTypes())
|
2012-12-06 17:20:58 +01:00
|
|
|
if (mimeType.type() == QLatin1String(Constants::QML_MIMETYPE)
|
|
|
|
|
|| mimeType.subClassesOf().contains(QLatin1String(Constants::QML_MIMETYPE)))
|
|
|
|
|
globs << mimeType.globPatterns();
|
2013-04-16 16:54:21 +02:00
|
|
|
if (globs.isEmpty()) {
|
2013-08-30 09:22:42 +02:00
|
|
|
globs.append(MimeGlobPattern(QLatin1String("*.qbs")));
|
|
|
|
|
globs.append(MimeGlobPattern(QLatin1String("*.qml")));
|
|
|
|
|
globs.append(MimeGlobPattern(QLatin1String("*.qmltypes")));
|
|
|
|
|
globs.append(MimeGlobPattern(QLatin1String("*.qmlproject")));
|
2013-04-16 16:54:21 +02:00
|
|
|
}
|
2014-04-11 23:07:52 +02:00
|
|
|
foreach (const QString &filePath,
|
|
|
|
|
project->files(ProjectExplorer::Project::ExcludeGeneratedFiles))
|
2013-08-30 09:22:42 +02:00
|
|
|
foreach (const MimeGlobPattern &glob, globs)
|
2013-04-16 16:54:21 +02:00
|
|
|
if (glob.matches(filePath))
|
2012-12-06 17:20:58 +01:00
|
|
|
projectInfo.sourceFiles << filePath;
|
|
|
|
|
activeTarget = project->activeTarget();
|
|
|
|
|
}
|
|
|
|
|
ProjectExplorer::Kit *activeKit = activeTarget ? activeTarget->kit() :
|
2013-08-21 12:48:46 +02:00
|
|
|
ProjectExplorer::KitManager::defaultKit();
|
2012-12-06 17:20:58 +01:00
|
|
|
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(activeKit);
|
|
|
|
|
|
|
|
|
|
bool preferDebugDump = false;
|
|
|
|
|
bool setPreferDump = false;
|
|
|
|
|
projectInfo.tryQmlDump = false;
|
|
|
|
|
|
|
|
|
|
if (activeTarget) {
|
|
|
|
|
if (ProjectExplorer::BuildConfiguration *bc = activeTarget->activeBuildConfiguration()) {
|
|
|
|
|
preferDebugDump = bc->buildType() == ProjectExplorer::BuildConfiguration::Debug;
|
|
|
|
|
setPreferDump = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!setPreferDump && qtVersion)
|
|
|
|
|
preferDebugDump = (qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild);
|
|
|
|
|
if (qtVersion && qtVersion->isValid()) {
|
|
|
|
|
projectInfo.tryQmlDump = project && (
|
|
|
|
|
qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|
|
|
|
|
|| qtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT));
|
2014-09-02 14:42:51 +02:00
|
|
|
projectInfo.qtQmlPath = QFileInfo(qtVersion->qmakeProperty("QT_INSTALL_QML")).canonicalFilePath();
|
|
|
|
|
projectInfo.qtImportsPath = QFileInfo(qtVersion->qmakeProperty("QT_INSTALL_IMPORTS")).canonicalFilePath();
|
2012-12-06 17:20:58 +01:00
|
|
|
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
2014-04-11 23:07:52 +02:00
|
|
|
} else {
|
2014-09-02 14:42:51 +02:00
|
|
|
projectInfo.qtQmlPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
|
|
|
|
|
projectInfo.qtImportsPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::ImportsPath)).canonicalFilePath();
|
2014-04-11 23:07:52 +02:00
|
|
|
projectInfo.qtVersionString = QLatin1String(qVersion());
|
2012-12-06 17:20:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (projectInfo.tryQmlDump) {
|
|
|
|
|
ProjectExplorer::ToolChain *toolChain =
|
|
|
|
|
ProjectExplorer::ToolChainKitInformation::toolChain(activeKit);
|
|
|
|
|
QtSupport::QmlDumpTool::pathAndEnvironment(project, qtVersion,
|
|
|
|
|
toolChain,
|
|
|
|
|
preferDebugDump, &projectInfo.qmlDumpPath,
|
|
|
|
|
&projectInfo.qmlDumpEnvironment);
|
2013-04-24 12:21:21 +02:00
|
|
|
projectInfo.qmlDumpHasRelocatableFlag = qtVersion->hasQmlDumpWithRelocatableFlag();
|
2012-12-06 17:20:58 +01:00
|
|
|
} else {
|
|
|
|
|
projectInfo.qmlDumpPath.clear();
|
|
|
|
|
projectInfo.qmlDumpEnvironment.clear();
|
2013-04-24 12:21:21 +02:00
|
|
|
projectInfo.qmlDumpHasRelocatableFlag = true;
|
2012-12-06 17:20:58 +01:00
|
|
|
}
|
|
|
|
|
setupProjectInfoQmlBundles(projectInfo);
|
|
|
|
|
return projectInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlJSTools::setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &projectInfo)
|
|
|
|
|
{
|
|
|
|
|
ProjectExplorer::Target *activeTarget = 0;
|
2013-11-11 22:20:47 +02:00
|
|
|
if (projectInfo.project)
|
2012-12-06 17:20:58 +01:00
|
|
|
activeTarget = projectInfo.project->activeTarget();
|
|
|
|
|
ProjectExplorer::Kit *activeKit = activeTarget
|
2013-08-21 12:48:46 +02:00
|
|
|
? activeTarget->kit() : ProjectExplorer::KitManager::defaultKit();
|
2012-12-06 17:20:58 +01:00
|
|
|
QHash<QString, QString> replacements;
|
|
|
|
|
replacements.insert(QLatin1String("$(QT_INSTALL_IMPORTS)"), projectInfo.qtImportsPath);
|
|
|
|
|
replacements.insert(QLatin1String("$(QT_INSTALL_QML)"), projectInfo.qtQmlPath);
|
|
|
|
|
|
|
|
|
|
QList<IBundleProvider *> bundleProviders =
|
|
|
|
|
ExtensionSystem::PluginManager::getObjects<IBundleProvider>();
|
|
|
|
|
|
|
|
|
|
foreach (IBundleProvider *bp, bundleProviders) {
|
|
|
|
|
if (bp)
|
|
|
|
|
bp->mergeBundlesForKit(activeKit, projectInfo.activeBundle, replacements);
|
|
|
|
|
}
|
|
|
|
|
projectInfo.extendedBundle = projectInfo.activeBundle;
|
|
|
|
|
|
|
|
|
|
if (projectInfo.project) {
|
|
|
|
|
QSet<ProjectExplorer::Kit *> currentKits;
|
|
|
|
|
foreach (const ProjectExplorer::Target *t, projectInfo.project->targets())
|
|
|
|
|
if (t->kit())
|
|
|
|
|
currentKits.insert(t->kit());
|
|
|
|
|
currentKits.remove(activeKit);
|
|
|
|
|
foreach (ProjectExplorer::Kit *kit, currentKits) {
|
|
|
|
|
foreach (IBundleProvider *bp, bundleProviders)
|
|
|
|
|
if (bp)
|
|
|
|
|
bp->mergeBundlesForKit(kit, projectInfo.extendedBundle, replacements);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-22 19:06:44 +02:00
|
|
|
QHash<QString,QmlJS::Dialect> ModelManager::languageForSuffix() const
|
2012-12-06 12:11:12 +01:00
|
|
|
{
|
2014-07-22 19:06:44 +02:00
|
|
|
QHash<QString,QmlJS::Dialect> res = ModelManagerInterface::languageForSuffix();
|
2011-09-09 10:55:11 +02:00
|
|
|
|
2013-08-30 09:22:42 +02:00
|
|
|
if (ICore::instance()) {
|
2013-08-30 16:38:57 +02:00
|
|
|
MimeType jsSourceTy = MimeDatabase::findByType(QLatin1String(Constants::JS_MIMETYPE));
|
2014-01-22 18:38:45 +01:00
|
|
|
foreach (const QString &suffix, jsSourceTy.suffixes())
|
2014-07-22 19:06:44 +02:00
|
|
|
res[suffix] = Dialect::JavaScript;
|
2013-08-30 16:38:57 +02:00
|
|
|
MimeType qmlSourceTy = MimeDatabase::findByType(QLatin1String(Constants::QML_MIMETYPE));
|
2014-01-22 18:38:45 +01:00
|
|
|
foreach (const QString &suffix, qmlSourceTy.suffixes())
|
2014-07-22 19:06:44 +02:00
|
|
|
res[suffix] = Dialect::Qml;
|
2013-08-30 16:38:57 +02:00
|
|
|
MimeType qbsSourceTy = MimeDatabase::findByType(QLatin1String(Constants::QBS_MIMETYPE));
|
2014-01-22 18:38:45 +01:00
|
|
|
foreach (const QString &suffix, qbsSourceTy.suffixes())
|
2014-07-22 19:06:44 +02:00
|
|
|
res[suffix] = Dialect::QmlQbs;
|
2013-08-30 16:38:57 +02:00
|
|
|
MimeType qmlProjectSourceTy = MimeDatabase::findByType(QLatin1String(Constants::QMLPROJECT_MIMETYPE));
|
2014-01-22 18:38:45 +01:00
|
|
|
foreach (const QString &suffix, qmlProjectSourceTy.suffixes())
|
2014-07-22 19:06:44 +02:00
|
|
|
res[suffix] = Dialect::QmlProject;
|
2013-08-30 16:38:57 +02:00
|
|
|
MimeType jsonSourceTy = MimeDatabase::findByType(QLatin1String(Constants::JSON_MIMETYPE));
|
2014-01-22 18:38:45 +01:00
|
|
|
foreach (const QString &suffix, jsonSourceTy.suffixes())
|
2014-07-22 19:06:44 +02:00
|
|
|
res[suffix] = Dialect::Json;
|
2011-09-09 10:55:11 +02:00
|
|
|
}
|
2014-01-22 18:38:45 +01:00
|
|
|
return res;
|
2011-09-09 10:55:11 +02:00
|
|
|
}
|
|
|
|
|
|
2010-02-15 13:49:00 +01:00
|
|
|
ModelManager::ModelManager(QObject *parent):
|
2014-01-23 14:28:31 +01:00
|
|
|
ModelManagerInterface(parent)
|
2009-09-04 16:51:11 +02:00
|
|
|
{
|
2012-04-13 11:57:34 +02:00
|
|
|
qRegisterMetaType<QmlJSTools::SemanticInfo>("QmlJSTools::SemanticInfo");
|
2014-01-23 14:28:31 +01:00
|
|
|
loadDefaultQmlTypeDescriptions();
|
2010-03-01 13:01:05 +01:00
|
|
|
}
|
|
|
|
|
|
2011-10-20 11:25:38 +02:00
|
|
|
ModelManager::~ModelManager()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-03 10:13:15 +01:00
|
|
|
void ModelManager::delayedInitialization()
|
|
|
|
|
{
|
2014-09-15 00:12:27 +02:00
|
|
|
CppTools::CppModelManager *cppModelManager =
|
|
|
|
|
CppTools::CppModelManager::instance();
|
2010-12-03 10:13:15 +01:00
|
|
|
if (cppModelManager) {
|
2011-08-23 12:02:29 +02:00
|
|
|
// It's important to have a direct connection here so we can prevent
|
|
|
|
|
// the source and AST of the cpp document being cleaned away.
|
2010-12-03 10:13:15 +01:00
|
|
|
connect(cppModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
|
2011-08-23 12:02:29 +02:00
|
|
|
this, SLOT(maybeQueueCppQmlTypeUpdate(CPlusPlus::Document::Ptr)), Qt::DirectConnection);
|
2010-12-03 10:13:15 +01:00
|
|
|
}
|
2011-08-26 13:31:18 +02:00
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
connect(ProjectExplorer::SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
|
2012-01-31 13:31:27 +01:00
|
|
|
this, SLOT(removeProjectInfo(ProjectExplorer::Project*)));
|
2014-06-30 11:56:28 +02:00
|
|
|
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(currentProjectChanged(ProjectExplorer::Project*)),
|
|
|
|
|
SLOT(updateDefaultProjectInfo()));
|
2014-05-06 09:46:05 +02:00
|
|
|
|
|
|
|
|
QmlJS::ViewerContext qbsVContext;
|
2014-07-22 19:06:44 +02:00
|
|
|
qbsVContext.language = Dialect::QmlQbs;
|
2014-05-06 09:46:05 +02:00
|
|
|
qbsVContext.maybeAddPath(ICore::resourcePath() + QLatin1String("/qbs"));
|
|
|
|
|
setDefaultVContext(qbsVContext);
|
2010-12-03 10:13:15 +01:00
|
|
|
}
|
|
|
|
|
|
2014-01-23 14:28:31 +01:00
|
|
|
void ModelManager::loadDefaultQmlTypeDescriptions()
|
2010-03-01 13:01:05 +01:00
|
|
|
{
|
2013-08-30 09:22:42 +02:00
|
|
|
if (ICore::instance()) {
|
2014-01-23 14:28:31 +01:00
|
|
|
loadQmlTypeDescriptionsInternal(ICore::resourcePath());
|
|
|
|
|
loadQmlTypeDescriptionsInternal(ICore::userResourcePath());
|
2010-11-10 16:21:05 +01:00
|
|
|
}
|
2010-09-08 10:11:44 +02:00
|
|
|
}
|
|
|
|
|
|
2014-01-23 14:28:31 +01:00
|
|
|
void ModelManager::writeMessageInternal(const QString &msg) const
|
2010-09-08 10:11:44 +02:00
|
|
|
{
|
2014-01-23 14:28:31 +01:00
|
|
|
MessageManager::write(msg, MessageManager::Flash);
|
2009-09-04 16:51:11 +02:00
|
|
|
}
|
|
|
|
|
|
2014-01-23 14:28:31 +01:00
|
|
|
ModelManagerInterface::WorkingCopy ModelManager::workingCopyInternal() const
|
2010-09-24 14:05:34 +02:00
|
|
|
{
|
|
|
|
|
WorkingCopy workingCopy;
|
2014-05-07 16:25:04 +02:00
|
|
|
foreach (IDocument *document, DocumentModel::openedDocuments()) {
|
2013-07-17 11:27:46 +02:00
|
|
|
const QString key = document->filePath();
|
2014-09-22 18:43:31 +02:00
|
|
|
if (TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(document)) {
|
2013-07-17 11:27:46 +02:00
|
|
|
// TODO the language should be a property on the document, not the editor
|
2014-05-07 16:25:04 +02:00
|
|
|
if (DocumentModel::editorsForDocument(document).first()->context().contains(ProjectExplorer::Constants::LANG_QMLJS))
|
2013-12-09 16:14:55 +01:00
|
|
|
workingCopy.insert(key, textDocument->plainText(), textDocument->document()->revision());
|
2010-09-24 14:05:34 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return workingCopy;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-30 11:56:28 +02:00
|
|
|
void ModelManager::updateDefaultProjectInfo()
|
2013-05-21 11:35:15 +02:00
|
|
|
{
|
2014-06-30 11:56:28 +02:00
|
|
|
// needs to be performed in the ui therad
|
2014-04-11 23:07:52 +02:00
|
|
|
ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectExplorerPlugin::currentProject();
|
2014-06-30 11:56:28 +02:00
|
|
|
ProjectInfo newDefaultProjectInfo = defaultProjectInfoForProject(currentProject);
|
|
|
|
|
setDefaultProject(projectInfo(currentProject,newDefaultProjectInfo), currentProject);
|
2010-03-16 16:34:33 +01:00
|
|
|
}
|
|
|
|
|
|
2014-06-30 11:56:28 +02:00
|
|
|
|
2010-01-20 16:43:50 +01:00
|
|
|
// Check whether fileMimeType is the same or extends knownMimeType
|
2013-08-30 09:22:42 +02:00
|
|
|
bool ModelManager::matchesMimeType(const MimeType &fileMimeType, const MimeType &knownMimeType)
|
2010-01-20 16:43:50 +01:00
|
|
|
{
|
|
|
|
|
const QStringList knownTypeNames = QStringList(knownMimeType.type()) + knownMimeType.aliases();
|
|
|
|
|
|
2011-04-19 15:42:14 +02:00
|
|
|
foreach (const QString &knownTypeName, knownTypeNames)
|
2010-01-20 16:43:50 +01:00
|
|
|
if (fileMimeType.matchesType(knownTypeName))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// recursion to parent types of fileMimeType
|
2013-08-30 16:38:57 +02:00
|
|
|
foreach (const QString &parentMimeType, fileMimeType.subClassesOf())
|
|
|
|
|
if (matchesMimeType(MimeDatabase::findByType(parentMimeType), knownMimeType))
|
2010-01-20 16:43:50 +01:00
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2010-03-16 16:34:33 +01:00
|
|
|
|
2014-01-23 14:28:31 +01:00
|
|
|
void ModelManager::addTaskInternal(QFuture<void> result, const QString &msg, const char *taskId) const
|
2012-12-06 17:20:58 +01:00
|
|
|
{
|
2014-01-23 14:28:31 +01:00
|
|
|
ProgressManager::addTask(result, msg, taskId);
|
2012-12-06 17:20:58 +01:00
|
|
|
}
|