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

QFileSystemWatcher does not work correctly with unicode paths on macOS

    XMLWordPrintable

    Details

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

      Description

      QFileSystemWatcher on macOS behave strange with unicode path names

      QString compare problem.
      https://bugreports.qt.io/browse/QTBUG-59778

      Or this: QFileSystemWatcher can't watch unicode paths ( closed )
      https://bugreports.qt.io/browse/QTBUG-55896

      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.

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes