Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
4.7.0
-
None
-
Win7
Description
If one adds both a directory and a file from this directory, the file cannot be removed from watch:
#include <QtCore/QCoreApplication> #include <QFileSystemWatcher> #include <QDebug> #include <QStringList> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QFileSystemWatcher* w = new QFileSystemWatcher; w->addPath("D:\\Pictures\\16225777_500.jpg"); w->addPath("D:\\Pictures"); // comment to "fix" qDebug()<<w->files(); // expected: ("D:\\Pictures\\16225777_500.jpg") w->removePath("D:\\Pictures"); // does not help! w->removePath("D:\\Pictures\\16225777_500.jpg"); //*** should remove the path qDebug()<<w->files();// ***unexpected: ("D:\\Pictures\\16225777_500.jpg") return a.exec(); }
If later the file is added again the unhelpful: "failed to add path" message appears, which by no means implies the path is already(still) included, making the bug even more annoying.
Attachments
Issue Links
- relates to
-
QTBUG-49411 QFileSystemWatcher::removePath return false but remove file successfuly
- Reported