QmlDesigner: Remove the watched dir after removing a bundle user dir

Fixes: QDS-15322
Change-Id: If8fbb6d5d4396242c434c3683de763087ed5723c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2025-05-09 16:19:29 +03:00
parent f3cd0191b2
commit 3337c266e9

View File

@@ -197,6 +197,8 @@ void ContentLibraryUserModel::addTextures(const Utils::FilePaths &paths, const U
void ContentLibraryUserModel::reloadTextureCategory(const Utils::FilePath &dirPath) void ContentLibraryUserModel::reloadTextureCategory(const Utils::FilePath &dirPath)
{ {
int catIdx = bundlePathToIndex(dirPath); int catIdx = bundlePathToIndex(dirPath);
QTC_ASSERT(catIdx > -1, return);
UserTextureCategory *texCat = qobject_cast<UserTextureCategory *>(m_userCategories.at(catIdx)); UserTextureCategory *texCat = qobject_cast<UserTextureCategory *>(m_userCategories.at(catIdx));
QTC_ASSERT(texCat, return); QTC_ASSERT(texCat, return);
@@ -268,6 +270,8 @@ void ContentLibraryUserModel::removeBundleDir(int catIdx)
auto texCat = qobject_cast<UserTextureCategory *>(m_userCategories.at(catIdx)); auto texCat = qobject_cast<UserTextureCategory *>(m_userCategories.at(catIdx));
QTC_ASSERT(texCat, return); QTC_ASSERT(texCat, return);
m_fileWatcher->removeDirectory(texCat->bundlePath());
QString dirPath = texCat->bundlePath().toFSPathString(); QString dirPath = texCat->bundlePath().toFSPathString();
// remove from json // remove from json