ICore: Change some path API to use FilePath

Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2021-04-22 16:15:26 +02:00
parent b2c0554733
commit c1f90aeca2
79 changed files with 260 additions and 244 deletions

View File

@@ -51,16 +51,15 @@ QmlBundle BasicBundleProvider::defaultBundle(const QString &bundleInfoName)
{
static bool wroteErrors = false;
QmlBundle res;
QString defaultBundlePath = Core::ICore::resourcePath()
+ QLatin1String("/qml-type-descriptions/")
+ bundleInfoName;
if (!QFileInfo::exists(defaultBundlePath)) {
const Utils::FilePath defaultBundlePath = Core::ICore::resourcePath() / "qml-type-descriptions"
/ bundleInfoName;
if (!defaultBundlePath.exists()) {
qWarning() << "BasicBundleProvider: ERROR " << defaultBundlePath
<< " not found";
return res;
}
QStringList errors;
if (!res.readFrom(defaultBundlePath, &errors) && ! wroteErrors) {
if (!res.readFrom(defaultBundlePath.toString(), &errors) && !wroteErrors) {
qWarning() << "BasicBundleProvider: ERROR reading " << defaultBundlePath
<< " : " << errors;
wroteErrors = true;

View File

@@ -220,15 +220,15 @@ void ModelManager::delayedInitialization()
ViewerContext qbsVContext;
qbsVContext.language = Dialect::QmlQbs;
qbsVContext.paths.append(ICore::resourcePath() + QLatin1String("/qbs"));
qbsVContext.paths.append(ICore::resourcePath().pathAppended("qbs").toString());
setDefaultVContext(qbsVContext);
}
void ModelManager::loadDefaultQmlTypeDescriptions()
{
if (ICore::instance()) {
loadQmlTypeDescriptionsInternal(ICore::resourcePath());
loadQmlTypeDescriptionsInternal(ICore::userResourcePath());
loadQmlTypeDescriptionsInternal(ICore::resourcePath().toString());
loadQmlTypeDescriptionsInternal(ICore::userResourcePath().toString());
}
}

View File

@@ -43,7 +43,10 @@ void QmlJSToolsPlugin::test_basic()
{
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
const QString qmlFilePath = Core::ICore::resourcePath() + QLatin1String("/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml");
const QString qmlFilePath = Core::ICore::resourcePath()
.pathAppended(
"qmldesigner/itemLibraryQmlSources/ItemDelegate.qml")
.toString();
modelManager->updateSourceFiles(QStringList(qmlFilePath), false);
modelManager->test_joinAllThreads();