D6833: Add support for PrivilegeExecution in KIO jobs

David Faure noreply at phabricator.kde.org
Mon Jul 24 17:44:43 UTC 2017


dfaure added inline comments.

INLINE COMMENTS

> chmodjob.cpp:238
>          KIO::SimpleJob *job = KIO::chmod(info.url, info.permissions);
> +        if (m_privilegeExecutionEnabled) {
> +            job->setParentJob(q);

Maybe all these if()s can be removed? I assume setParentJob just stores a pointer, we could do this in all case --- it's less code, and just in case we need the parent job for something else later, it'll be available.

> copyjob.cpp:284
> +            FileOperationType copyType;
> +            if (mode == CopyJob::Copy) {
> +                copyType = Copy;

switch() ?

> copyjob.cpp:1674
>          } else if (m_mode == CopyJob::Move) { // Moving a file
> -            KIO::FileCopyJob *moveJob = KIO::file_move(uSource, uDest, permissions, flags | HideProgressInfo/*no GUI*/);
> +            KIO::FileCopyJob *moveJob = KIO::file_move(uSource, uDest, permissions, flags | HideProgressInfo/*no GUI*/ | PrivilegeExecution);
> +            if (m_privilegeExecutionEnabled) {

Should the flag always be set here? Or only if m_privilegeExecutionEnabled is true?

REPOSITORY
  R241 KIO

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

To: chinmoyr, dfaure, #frameworks
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170724/c0746353/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list