Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59780

QFileSystemWatcher does not work correctly with unicode paths on macOS



    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 5.8.0
    • Fix Version/s: None
    • Labels:
    • Environment:
      macOS 10.12.3 (16D32), Qt 5.8.0 precompiled binary
    • Platform/s:


      QFileSystemWatcher on macOS behave strange with unicode path names

      QString compare problem.

      Or this: QFileSystemWatcher can't watch unicode paths ( closed )

      Assume this: I have folder on my disk: "/Users/fbucek/ř" - it exists all programs can work with it. My program can work with it, everything works as expected except QFileSystemWatcher and QString.

      1) I cannot watch path using QFileSystemWatcher when I use addPath("/User/fbucek/ř)

      • It will be added but signals wont be called.

      2) I can watch path using QFileSystemWatcher when the path name came from internal macOS functions.

      QString name = QString::fromLocal8Bit(attrs.name + attrs.name_info.attr_dataoffset); // It is correct name and it works even for chinese of thai letters / there is no problem I guess
      • signals will be called
      • but return string will be different ( will look same, but wont be )

      void directoryChanged(const QString &path, QPrivateSignal);

      • So added path will be "/Users/fbucek/ř",
      • Returned path will be "/Users/fbucek/ř",
      • But when I use QString compare it wont be the same.

      How it is possible that QString looks the same, but it is different.
      How it is possible that QFileSystem watcher can store both version, but emiting only when added version is from macOS internal functions.
      When use path hardcoded, or from QDir::fileInfoList it does not work correctly. Path wont be emited.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            • Assignee:
              erikv Erik Verbruggen
              fbucek fbucek
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes