Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.1
-
None
Description
Calling QFileSystemWatcher::addPath() on an external volume does not work as expected when the volume is FAT32. Instead the following lines are printed :
QKqueueFileSystemWatcherEngine::addPaths: kevent: Operation not supported
QFileSystemWatcher: failed to add paths: /Volumes/ANDYSIPOD/Test/foo.txt
This can be seen with the following example :
#include <QtGui>
class TestFileSystemWatcher : public QMainWindow
{
Q_OBJECT
public:
TestFileSystemWatcher(QWidget *parent = 0, Qt::WFlags flags = 0);
private slots:
void directoryChanged(const QString & path);
void fileChanged(const QString & path);
};
TestFileSystemWatcher::TestFileSystemWatcher(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
QFileSystemWatcher *FileSystemWatcher = new QFileSystemWatcher();
connect(FileSystemWatcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(directoryChanged(const QString &)));
connect(FileSystemWatcher, SIGNAL(fileChanged(const QString &)), this, SLOT(fileChanged(const QString &)));
//seems to work OK
//FileSystemWatcher->addPath("/Users/ddettman/tasks/223845/testfile.txt");
//errors
FileSystemWatcher->addPath("/Volumes/ANDYSIPOD/Test/foo.txt");
//here are the errrors on mac:
// QKqueueFileSystemWatcherEngine::addPaths: kevent: Operation not supported
// QFileSystemWatcher: failed to add paths: /Volumes/ANDYSIPOD/Test/foo.txt
}
void TestFileSystemWatcher::directoryChanged(const QString & path)
{
qDebug("directoryChanged");
}
void TestFileSystemWatcher::fileChanged(const QString & path)
{
qDebug("fileChanged");
}
#include "main.moc"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
TestFileSystemWatcher w;
w.show();
return a.exec();
}