D25010: [StatJob] Use A QFlag to specify the details returned by statJob

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Tue Oct 29 12:40:44 GMT 2019


kossebau added inline comments.

INLINE COMMENTS

> jobremotetest.cpp:70
>  {
> -    KIO::Job *job = KIO::stat(url, KIO::StatJob::DestinationSide, 0, KIO::HideProgressInfo);
> +    KIO::Job *job = KIO::stat(url, KIO::StatJob::DestinationSide, KIO::StatJob::Basic, KIO::HideProgressInfo);
>      job->setUiDelegate(nullptr);

As reader of this code here alone, I wonder what KIO::StatJob::Basic means. To understand what this code does, I would first have to look at the API dox, not good.
So possibly Basic should get a different name, at least contain "Detail" term perhaps. "Basic" also needs context to have semantics, I could e.g. not tell instantly what basic details are. So perhaps needs to be more expliciti here.

> copyjob.cpp:365
>      const QUrl dest = m_asMethod ? m_dest.adjusted(QUrl::RemoveFilename) : m_dest;
> -    KIO::Job *job = KIO::stat(dest, StatJob::DestinationSide, 2, KIO::HideProgressInfo);
> +    KIO::Job *job = KIO::stat(dest, StatJob::DestinationSide, KIO::StatDefaultDetails, KIO::HideProgressInfo);
>      qCDebug(KIO_COPYJOB_DEBUG) << "CopyJob: stating the dest" << m_dest;

Fear the same as said for Basic is true with Default. I would prefer explicit flags here as code reader.

> statjob.h:181
> +/// @since 5.64
> +constexpr static StatJob::StatDetails StatDefaultDetails = StatJob::StatDetail::Basic | StatJob::StatDetail::User | StatJob::StatDetail::Time | StatJob::StatDetail::Acl | StatJob::StatDetail::ResolveSymlink;
> +

I wonder if this should not be rather a member of StatJob, instead of being on generic KIO namespace level.
It feels unbalanced to have the enum being in the class, but a util flag set not.

REPOSITORY
  R241 KIO

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

To: meven, #frameworks, dfaure, kossebau
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191029/4ac84c6e/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list