D22727: allow kio-extras to build with mingw on win32 and remove unnecessary includes

Pino Toscano noreply at phabricator.kde.org
Thu Jul 25 05:33:07 BST 2019


pino requested changes to this revision.
pino added a comment.
This revision now requires changes to proceed.


  other than building, please also check that it actually still works on Linux

INLINE COMMENTS

> kio_sftp.cpp:383
>          fileType = QT_STAT_MASK - 1;
> -#ifdef Q_OS_WIN
> -        access = static_cast<mode_t>(perms::owner_all | perms::group_all | perms::others_all);
> -#else
> -        access = S_IRWXU | S_IRWXG | S_IRWXO;
> -#endif
> +        access = QFileDevice::Permission::ReadOwner | QFileDevice::Permission::WriteOwner | QFileDevice::Permission::ExeOwner
> +                | QFileDevice::Permission::ReadGroup | QFileDevice::Permission::WriteGroup | QFileDevice::Permission::ExeGroup

sounds like you need to use the *User enums, not the *Owner ones

> kio_sftp.cpp:1757
>                      if (permissions != -1) {
> -#ifdef Q_OS_WIN
> -                        initialMode = permissions | static_cast<mode_t>(perms::owner_write | perms::owner_read);
> -#else
> -                        initialMode = permissions | S_IWUSR | S_IRUSR;
> -#endif
> +                        initialMode = permissions | QFileDevice::Permission::WriteOwner | QFileDevice::Permission::ReadOwner;
>                      } else {

ditto

> kio_sftp.cpp:1964
>      if (permissions != -1)
> -#ifdef Q_OS_WIN
> -        initialMode = permissions | static_cast<mode_t>(perms::owner_write);
> -#else
> -        initialMode = permissions | S_IWUSR;
> -#endif
> +        initialMode = permissions | QFileDevice::Permission::WriteOwner;
>      else

ditto

> kio_sftp.cpp:2222
>              fileType = QT_STAT_MASK - 1;
> -#ifdef Q_OS_WIN
> -            access = static_cast<mode_t>(perms::owner_all | perms::group_all | perms::others_all);
> -#else
> -            access = S_IRWXU | S_IRWXG | S_IRWXO;
> -#endif
> +            access = QFileDevice::Permission::ReadOwner | QFileDevice::Permission::WriteOwner | QFileDevice::Permission::ExeOwner
> +                | QFileDevice::Permission::ReadGroup | QFileDevice::Permission::WriteGroup | QFileDevice::Permission::ExeGroup

ditto

REPOSITORY
  R320 KIO Extras

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

To: brute4s99, vonreth, dfaure, pino
Cc: pino, kde-frameworks-devel, kfm-devel, aprcela, fprice, LeGast00n, sbergeron, fbampaloukas, alexde, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190725/f0279e7c/attachment.htm>


More information about the kfm-devel mailing list