D10567: Remove handling of privilege operation confirmation prompts from KIO::Job

David Faure noreply at phabricator.kde.org
Thu Mar 1 07:13:48 UTC 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> job.cpp:269
>  
> +    QByteArray jobData;
>      if (m_parentJob) {

This feels like C code ;)

> job.cpp:271
>      if (m_parentJob) {
> -        if (!m_parentJob->d_func()->m_privilegeExecutionEnabled) {
> -            return OperationNotAllowed;
> -        }
> +        jobData = m_parentJob->d_func()->privilegeOperationData();
> +        // Copy meta-data from parent job

Either declare a var here, or return that directly (after swapping with next statement of course).

> job.cpp:329
>  
> -    switch (m_operationType) {
> -    case ChangeAttr:
> -        m_caption = i18n("Change Attribute");
> -        m_message = i18n("Root privileges are required to change file attributes. "
> -                         "Do you want to continue?");
> -        break;
> -    case Copy:
> -        m_caption = i18n("Copy Files");
> -        m_message = i18n("Root privileges are required to complete the copy operation. "
> -                         "Do you want to continue?");
> -        break;
> -    case Delete:
> -        m_caption = i18n("Delete Files");
> -        m_message = i18n("Root privileges are required to complete the delete operation. "
> -                         "However, doing so may damage your system. Do you want to continue?");
> -        break;
> -    case MkDir:
> -        m_caption = i18n("Create Folder");
> -        m_message = i18n("Root privileges are required to create this folder. "
> -                         "Do you want to continue?");
> -        break;
> -    case Move:
> -        m_caption = i18n("Move Items");
> -        m_message = i18n("Root privileges are required to complete the move operation. "
> -                         "Do you want to continue?");
> -        break;
> -    case Rename:
> -        m_caption = i18n("Rename");
> -        m_message = i18n("Root privileges are required to complete renaming. "
> -                         "Do you want to continue?");
> -        break;
> -    case Symlink:
> -        m_caption = i18n("Create Symlink");
> -        m_message = i18n("Root privileges are required to create a symlink. "
> -                         "Do you want to continue?");
> -        break;
> -    case Transfer:
> -        m_caption = i18n("Transfer data");
> -        m_message = i18n("Root privileges are required to complete transferring data. "
> -                         "Do you want to continue?");
> -    default:
> -        break;
> -    }
> +    QDataStream ds(&jobData, QIODevice::WriteOnly);
> +    ds << status << m_caption << m_message;

And here you can declare another QByteArray, more locally.

REPOSITORY
  R241 KIO

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

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


More information about the Kde-frameworks-devel mailing list