forked from qt-creator/qt-creator
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:
@@ -245,18 +245,6 @@ void ContentLibraryUserModel::removeTexture(ContentLibraryTexture *tex, bool ref
|
|||||||
emit dataChanged(index(catIdx), index(catIdx));
|
emit dataChanged(index(catIdx), index(catIdx));
|
||||||
updateIsEmpty();
|
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)
|
void ContentLibraryUserModel::removeFromContentLib(QObject *item)
|
||||||
|
Reference in New Issue
Block a user