D21760: Add KListOpenFiles::listProcessesWithOpenFiles
David Hallas
noreply at phabricator.kde.org
Fri Aug 30 06:19:12 BST 2019
hallas added a comment.
@dfaure - Overall, what do you think about the approach of subclassing KJob? Did it turn out like you had thought? And is this the solution we should go with, or was one of the other solutions better?
INLINE COMMENTS
> dfaure wrote in klistopenfiles.cpp:29
> I wonder if this actually needs to be a QObject, given that you use connect-to-pointer-to-member-function?
The primary motivation was memory-management, but I could also just make the d-pointer in ListOpenFilesJob a QScopedPointer, would that be better?
> dfaure wrote in klistopenfiles.cpp:44
> KIO::ERR_DOES_NOT_EXIST would fit well here, but that's in kio...
>
> I suggest adding enum { ERR_DOES_NOT_EXIST = KJob::UserDefinedError + 11 }
> in the header file for this job and using that here.
>
> And yes, you should do something like
>
> setErrorText(i18n("Directory does not exist: %1", path));
I have added the error enum entries, but I am a little hesitant to add to error texts since KCoreAddons doesn't today depend on KDE::I18n and this would introduce that dependency, do we really want that? When I look at the KIO classes then they usually set som non-translated string as the error text, would that be an option?
REPOSITORY
R244 KCoreAddons
REVISION DETAIL
https://phabricator.kde.org/D21760
To: hallas, davidedmundson, broulik, #frameworks, dfaure, bruns, #plasma
Cc: meven, cfeck, 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/20190830/ef55b65c/attachment.html>
More information about the Kde-frameworks-devel
mailing list