# # # patch "src/model/Inventory.cpp" # from [71b1d68fbad33d2b5325e725728b29a49c51e6a0] # to [373c92ab5041cd2c2784ff59052369d32166f2ec] # ============================================================ --- src/model/Inventory.cpp 71b1d68fbad33d2b5325e725728b29a49c51e6a0 +++ src/model/Inventory.cpp 373c92ab5041cd2c2784ff59052369d32166f2ec @@ -48,11 +48,19 @@ void Inventory::read(const QString & pat I(!workspacePath.isEmpty()); QStringList cmd = QStringList() << "inventory"; - if (!path.isEmpty()) - { - cmd << path; - } + QString query(path); + // remove the trailing slash from the query if there is any. + // there is usually one for automated queries from the filesystem + // watcher. we explicitely mark directories for it with a trailing + // slash to be able to distinguish them from normal files for the + // lru cache. + if (query.right(1) == "/") + query.chop(1); + + if (!query.isEmpty()) + cmd << query; + QStringList opts; // if requested, just read one directory level ahead @@ -196,13 +204,12 @@ void Inventory::processTaskResult(const QString baseDir = item->getBaseDirectory(); - ModelItem * parent = 0; + ModelItem * parent = parentItem; if (tempItemMap.contains(baseDir)) + { parent = tempItemMap.value(baseDir); - else - parent = parentItem; + } - I(parent); parentChildRelations[parent].append(item); tempItemMap.insert(path, item); }