diff --git a/src/ioslaves/file/config-kioslave-file.h.cmake b/src/ioslaves/file/config-kioslave-file.h.cmake --- a/src/ioslaves/file/config-kioslave-file.h.cmake +++ b/src/ioslaves/file/config-kioslave-file.h.cmake @@ -10,3 +10,6 @@ /* Defined to if you have a d_type member in struct dirent */ #cmakedefine01 HAVE_DIRENT_D_TYPE +/* Defined if system has extended file attributes support. */ +#cmakedefine01 HAVE_SYS_XATTR_H + diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp --- a/src/ioslaves/file/file_unix.cpp +++ b/src/ioslaves/file/file_unix.cpp @@ -37,7 +37,9 @@ #include #include +#ifdef HAVE_SYS_XATTR_H #include +#endif #include #include @@ -411,7 +413,7 @@ return (QString::compare(url.host(), QLatin1String(hostname), Qt::CaseInsensitive) == 0); } -#ifdef Q_OS_LINUX +#ifdef HAVE_SYS_XATTR_H static bool isNtfsHidden(const QString &filename) { constexpr auto attrName = "system.ntfs_attrib_be"; @@ -545,7 +547,7 @@ } else { if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details)) { -#ifdef Q_OS_LINUX +#ifdef HAVE_SYS_XATTR_H if (isNtfsHidden(filename)) { entry.insert(KIO::UDSEntry::UDS_HIDDEN, 1); }