D10405: Stuff the "Couldn't find executable" message box into a queued lambda
David Faure
noreply at phabricator.kde.org
Tue Feb 13 10:55:39 UTC 2018
dfaure added inline comments.
INLINE COMMENTS
> krun.cpp:1616
> // (or with a full path, if m_executable is absolute), and then in the PATH.
> - if (!QFile(m_executable).exists() && QStandardPaths::findExecutable(m_executable).isEmpty()) {
> - QEventLoopLocker locker;
> - KMessageBox::sorry(nullptr, i18n("Could not find the program '%1'", m_executable));
> + if (!QFile(m_executable).exists() && QStandardPaths::findExecutable(m_executable).isEmpty() && qGuiApp) {
> + QMetaObject::invokeMethod(qGuiApp, [=]() {
if (qGuiApp) { your code } else { qWarning }
so we don't eat a possible error message completely.
Looks OK otherwise.
[we have KDialogJobUiDelegate::showErrorMessage which implements a mesagebox queue, but that goes back to the issue of not having a job or a uidelegate in the first place]
[Every 5 years I'm thinking KRun should be a KJob, we just found another reason why...]
REPOSITORY
R241 KIO
REVISION DETAIL
https://phabricator.kde.org/D10405
To: hein, dfaure, davidedmundson, mart, ngraham
Cc: #frameworks, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180213/50832f01/attachment.html>
More information about the Kde-frameworks-devel
mailing list