D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-29 Thread Roman Inflianskas
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:f1ab805c4ebc: Fix build on FreeBSD broken by 
d7cce9937d5e9af2753fadb82d11f308b58bb8fa (authored by rominf).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11716?vs=30696&id=30864

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/CMakeLists.txt
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: ngraham, bcooksley, #frameworks, michaelh


D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-27 Thread Roman Inflianskas
rominf updated this revision to Diff 30696.
rominf added a comment.


  - Replace #ifdef with #if

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11716?vs=30629&id=30696

BRANCH
  fix-ntfs-hidden-files-on-freebsd

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/CMakeLists.txt
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: #frameworks, michaelh, ngraham


D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-26 Thread Roman Inflianskas
rominf updated this revision to Diff 30629.
rominf added a comment.


  - Consider criticism

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11716?vs=30627&id=30629

BRANCH
  fix-ntfs-hidden-files-on-freebsd

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/CMakeLists.txt
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: #frameworks, michaelh, ngraham


D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-26 Thread Roman Inflianskas
rominf updated this revision to Diff 30627.
rominf added a comment.


  - Add a trailing newline to the end of the file

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11716?vs=30626&id=30627

BRANCH
  fix-ntfs-hidden-files-on-freebsd

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: #frameworks, michaelh, ngraham


D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-26 Thread Roman Inflianskas
rominf updated this revision to Diff 30626.
rominf added a comment.


  - Actualy fixing build

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11716?vs=30625&id=30626

BRANCH
  fix-ntfs-hidden-files-on-freebsd

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: #frameworks, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-26 Thread Roman Inflianskas
rominf added inline comments.

INLINE COMMENTS

> kossebau wrote in file_unix.cpp:40
> This unconditional include sadly breaks the build at least on FreeBSD (see 
> https://build.kde.org/view/Frameworks/job/Frameworks%20kio%20kf5-qt5%20FreeBSDQt5.9/164/console
>  ) and other systems where this header is not part of the libc (?) headers.
> 
> So this needs to get some condition checking before using it. Compare other 
> code doing that:
> https://lxr.kde.org/search?_filestring=&_string=xattr.h&_casesensitive=1
> 
> While the xattr.h is already checked for in KIO in the FindACL.cmake file, an 
> explicite check like
> 
>   check_include_files(sys/xattr.h HAVE_SYS_XATTR_H)
> 
> and passing HAVE_SYS_XATTR_H via config-kioslave-file.h.cmake into 
> file_unix.cpp and checking the condition additionally to or instead of 
> Q_OS_LINUX for the new code should solve this issue properly.

I'm sorry for breaking the build. Here is the fix: D11716 


REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, dfaure
Cc: kossebau, dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, 
broulik, #frameworks, #dolphin, michaelh, ngraham


D11716: Fix build on FreeBSD broken by d7cce9937d5e9af2753fadb82d11f308b58bb8fa

2018-03-26 Thread Roman Inflianskas
rominf created this revision.
rominf added reviewers: Dolphin, kossebau, dfaure.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
rominf requested review of this revision.

REVISION SUMMARY
  Support hidden NTFS files only on OS that support extended file attributes. 
For this purpose check if `sys/xattr.h` exist via CMake.

REPOSITORY
  R241 KIO

BRANCH
  fix-ntfs-hidden-files-on-freebsd

REVISION DETAIL
  https://phabricator.kde.org/D11716

AFFECTED FILES
  src/ioslaves/file/config-kioslave-file.h.cmake
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, kossebau, dfaure
Cc: #frameworks, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-26 Thread Roman Inflianskas
rominf marked 8 inline comments as done.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, dfaure
Cc: kossebau, dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, 
broulik, #frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-26 Thread Roman Inflianskas
rominf closed this revision.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-25 Thread Roman Inflianskas
rominf edited the summary of this revision.

REPOSITORY
  R241 KIO

BRANCH
  ntfs-hidden (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-25 Thread Roman Inflianskas
rominf updated this revision to Diff 30474.
rominf added a comment.


  - Consider criticism
  - Split multiple statements to put one statement on a line

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11204?vs=30468&id=30474

BRANCH
  ntfs-hidden (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, #frameworks, markg, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-25 Thread Roman Inflianskas
rominf added inline comments.

INLINE COMMENTS

> dfaure wrote in file_unix.cpp:422
> Doesn't this need to be static, for the next line to be standards compliant? 
> Not 100% sure.

No, it's enough for array length to be `constexpr`.

> dfaure wrote in file_unix.cpp:431
> QVarLengthArray might be useful here to avoid an allocation every time

TIL about `QVarLengthArray`. Thank you.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, markg, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-25 Thread Roman Inflianskas
rominf updated this revision to Diff 30468.
rominf marked 4 inline comments as done.
rominf added a comment.


  - Consider criticism

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11204?vs=29475&id=30468

BRANCH
  ntfs-hidden (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, #frameworks, markg, dfaure
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-14 Thread Roman Inflianskas
rominf added inline comments.

INLINE COMMENTS

> markg wrote in file_unix.cpp:546-550
> Why here?
> This should be done inside the createUDSEntry function (it's in file.cpp).

The logic behind this is that `getxattr` exists only on Linux 
(https://www.gnu.org/software/gnulib/manual/html_node/getxattr.html#getxattr) 
and `file_unix.cpp` is more Linux-y than `file.cpp`. If you think that I'm 
wrong, I can move it.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks, markg
Cc: dfaure, markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, 
#frameworks, #dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-14 Thread Roman Inflianskas
rominf updated this revision to Diff 29475.
rominf added a comment.


  - Cleanup

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11204?vs=29473&id=29475

BRANCH
  ntfs-hidden

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, #frameworks, markg
Cc: markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, #frameworks, 
#dolphin, michaelh, ngraham


D11318: Support NTFS hidden files

2018-03-14 Thread Roman Inflianskas
rominf created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
rominf requested review of this revision.

REPOSITORY
  R241 KIO

BRANCH
  ntfs-hidden

REVISION DETAIL
  https://phabricator.kde.org/D11318

AFFECTED FILES
  src/ioslaves/file/file_unix.cpp

To: rominf
Cc: #frameworks, michaelh, ngraham


D11318: Support NTFS hidden files

2018-03-14 Thread Roman Inflianskas
rominf abandoned this revision.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11318

To: rominf
Cc: #frameworks, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-14 Thread Roman Inflianskas
rominf updated this revision to Diff 29473.
rominf added a comment.


  - Move isNtfsHidden to file ioslave

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11204?vs=29141&id=29473

BRANCH
  ntfs-hidden

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/core/kfileitem.cpp
  src/core/kfileitem.h
  src/ioslaves/file/file_unix.cpp

To: rominf, #dolphin, #frameworks, markg
Cc: markg, elvisangelaccio, ltoscano, anthonyfieroni, broulik, #frameworks, 
#dolphin, michaelh, ngraham


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf added inline comments.

INLINE COMMENTS

> anthonyfieroni wrote in kfileitem.cpp:1116-1136
> Indeed this should be done in different way, about me
> 
>   std::uint64_t attr;
>   length = getxattr(fileName, attrName, &attr, sizeof attr);
>   if (length <= 0) {
>   return false;
>   }

I wish your code to work, but it doesn't. I took an inspiration from `attr`: 
http://git.savannah.nongnu.org/cgit/attr.git/tree/tools/getfattr.c#n235 and 
http://git.savannah.nongnu.org/cgit/attr.git/tree/tools/getfattr.c#n169.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks
Cc: anthonyfieroni, broulik, #frameworks, #dolphin, michaelh


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf updated this revision to Diff 29141.
rominf marked an inline comment as done.
rominf added a comment.


  Use delete[] for array deletion

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D11204?vs=29137&id=29141

BRANCH
  ntfs-hidden

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/core/kfileitem.cpp
  src/core/kfileitem.h

To: rominf, #dolphin, #frameworks
Cc: anthonyfieroni, broulik, #frameworks, #dolphin, michaelh


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf added a comment.


  In D11204#222421 , @broulik wrote:
  
  > Shouldn't that rather go into the `file` KIO slave so it sets the 
`UDS_HIDDEN` attribute?
  
  
  I think you are right, but I don't have an idea what "`file` KIO slave" 
means. Can you point me out to appropriate files?

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks
Cc: broulik, #frameworks, #dolphin, michaelh


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf edited the summary of this revision.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks
Cc: #frameworks, #dolphin, michaelh


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf edited the summary of this revision.
rominf added a reviewer: Frameworks.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D11204

To: rominf, #dolphin, #frameworks
Cc: #frameworks, #dolphin, michaelh


D11204: Support NTFS hidden files

2018-03-10 Thread Roman Inflianskas
rominf created this revision.
rominf added a reviewer: Dolphin.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
rominf requested review of this revision.

REVISION SUMMARY
  This patch implements function isHiddenNtfs which checks extended attribute 
HIDDEN of files from NTFS partitions and complements isHidden function.
  FEATURE: 171537

TEST PLAN
  1. Open Dolphin on Windows partition
  2. Check that "$Recycle.Bin", "MSOCache", "System Volume Information", etc. 
are hidden
  3. Show hidden files
  4. Check that Windows hidden files are displayed now

REPOSITORY
  R241 KIO

BRANCH
  ntfs-hidden

REVISION DETAIL
  https://phabricator.kde.org/D11204

AFFECTED FILES
  src/core/kfileitem.cpp
  src/core/kfileitem.h

To: rominf, #dolphin
Cc: #frameworks, #dolphin, michaelh