forked from openkylin/ukui-search
Merge branch 'ukss-dev' into 'ukss-dev'
解决移除监听失败的问题。 See merge request kylin-desktop/ukui-search!359
This commit is contained in:
commit
64eb691ca4
|
@ -104,15 +104,16 @@ QStringList FileSystemWatcherPrivate::removeWatch(const QString &path)
|
|||
{
|
||||
m_pool->waitForDone();
|
||||
QStringList paths;
|
||||
for(QHash<int, QString>::Iterator i = m_watchPathHash.begin(); i != m_watchPathHash.end();) {
|
||||
if(i.value().length() > path.length()) {
|
||||
if(FileUtils::isOrUnder(i.value(), path)) {
|
||||
for(int wd : m_watchPathHash.keys()) {
|
||||
QString tmpPath = m_watchPathHash.value(wd);
|
||||
if(tmpPath.length() >= path.length()) {
|
||||
if(FileUtils::isOrUnder(tmpPath, path)) {
|
||||
//fix me:This function can be slow (O(n))
|
||||
paths.append(removeWatch(m_watchPathHash.key(path)));
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue