QmlDesigner: Fix undeletable custom folder in Content Lib

Fixes: QDS-15323
Change-Id: Ia4131d0144458ad54077624f2bd3df43e409a16d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Shrief Gabr
2025-05-22 16:44:45 +03:00
parent dc520b4681
commit 28563c52bf

View File

@@ -245,18 +245,6 @@ void ContentLibraryUserModel::removeTexture(ContentLibraryTexture *tex, bool ref
emit dataChanged(index(catIdx), index(catIdx));
updateIsEmpty();
}
const QString bundlePathStr = itemCat->bundlePath().toFSPathString();
if (m_customCatsObj.contains(bundlePathStr)) {
m_customCatsObj.remove(bundlePathStr);
m_customCatsRootObj["items"] = m_customCatsObj;
auto userBundlePath = Utils::FilePath::fromString(Paths::bundlesPathSetting() + "/User");
auto jsonFilePath = userBundlePath.pathAppended(Constants::CUSTOM_BUNDLES_JSON_FILENAME);
auto result = jsonFilePath.writeFileContents(QJsonDocument(m_customCatsRootObj).toJson());
QTC_ASSERT_EXPECTED(result,);
}
}
void ContentLibraryUserModel::removeFromContentLib(QObject *item)