D23384: [WIP] Adding support for mounting KIOFuse URLs for applications that don't use KIO

David Edmundson noreply at phabricator.kde.org
Tue Oct 1 12:29:54 BST 2019


davidedmundson added a comment.


  How does kio-fuse know when to unmount?

INLINE COMMENTS

> krun.cpp:529
> +                        // Lets try a KIOFuse mount instead.
> +                        QDBusInterface kiofused(QStringLiteral("org.kde.kded5"), 
> +                                                QStringLiteral("/modules/kiofuse"), 

Generally QDBusInterface is a class to be avoided.

I would recommend  copy/pasting your XML file and then using the generated interface from that.

QDBusInterface sucks as it makes a blocking call introspecting (which isn't a huge problem considering we're going to block anyway!) but also leads to going crazy figuring out typos in methods/arguments.

> krun.cpp:533
> +                                                QDBusConnection::sessionBus());
> +                        if (!kiofused.isValid() || kiofused.lastError().isValid()) {
> +                            // Module isn't loaded...

We rarely check lastError(), that's for if you use the lower level API calls.

> krun.cpp:556
> +                // Empty string means mounting failed...
> +                if(reply.isValid() && !reply.value().isEmpty()) {
> +                    *it = QUrl::fromLocalFile(reply.value());

All DBus replies are a union of their success value and an error.

Returning an error reply when mounting fails would allow us to provide a more helpful message back to the user

REPOSITORY
  R241 KIO

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

To: feverfew, fvogt, chinmoyr
Cc: davidedmundson, kde-frameworks-devel, ngraham, LeGast00n, GB_2, michaelh, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191001/a107e173/attachment.html>


More information about the Kde-frameworks-devel mailing list