D29385: Introduce KIO::OpenUrlJob, a rewrite and replacement for KRun

Ahmad Samir noreply at phabricator.kde.org
Fri May 8 12:07:33 BST 2020


ahmadsamir added a comment.


  In D29385#664552 <https://phabricator.kde.org/D29385#664552>, @dfaure wrote:
  
  > -void KIO::OpenUrlJob::setRunFlags(KIO::ApplicationLauncherJob::RunFlags runFlags)
  >  +void KIO::OpenUrlJob::setDeleteTemporaryFile(bool b)
  >
  > The more I think about it, the least I like the use of flags here.
  >
  > 1. they are from the wrong class as Kai-Uwe pointed out, but more importantly:
  > 2. the other bool setters here are for unrelated concerns, better keep them separate.
  >
  >   Are we doing lineEdit->setDragEnabled(true); lineEdit->setClearButtonEnabled(true); lineEdit->setReadOnly(true); or are we doing lineEdit->setFlags(QLineEdit::DragEnabled | QLineEdit::ClearButtonEnabled | QLineEdit::ReadOnly)?
  
  
  I vote:
  lineEdit->setDragEnabled(true); lineEdit->setClearButtonEnabled(true); lineEdit->setReadOnly(true);
  it's:
  
  - more readable, and easier to use (similar methods are used through out Qt code)
  - avoids the case you talked about, of the user setting nonsensical, from the code POV, flags.
  
  I was too slow working my way through this short story^W^W review, so I've gathered my other comments (mostly code style, docs changes...etc) in a diff, that I'll submit shortly.

REPOSITORY
  R241 KIO

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

To: dfaure, ahmadsamir, broulik, meven, kossebau, davidedmundson, nicolasfella, svuorela
Cc: feverfew, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200508/c403d014/attachment.htm>


More information about the Kde-frameworks-devel mailing list