[Portland] xdg-tools in non-DE sessions

Petr Vanek petr at scribus.info
Sun Feb 13 04:47:49 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi all,

I use Qt4 apps in custom Xorg session (no KDE, GNOME, or LXDE). It looks like xdg-tools are not prepared for this situation. There is used "webbrowser fail back" In current xdg-tools (see example below).

Se we (people around QtDesktop, http://code.google.com/p/qtdesktop/) prepared some patch for xdg-utils:

http://public.yarpen.cz/xdg-utils-patched-2/

It contains (in our opinion) better handling of default applications for Qt's QDesktopServices calls (qt uses xdg-open internally in X11 builds). Please let me know if is it good approach for you.

cheers,
Petr


P.S.: testcase

#include <QApplication>
#include <QDesktopServices>
#include <QUrl>

int main(int argc, char ** argv)
{
    QApplication a(argc, argv);

    // this is opened in browser. May be correct as it's JPEG
    //QDesktopServices::openUrl(QUrl("/home/subzero/jimg_a100.jpg"));

    // And now - this is opened in browser too.
    // Mozilla -> "open with" dialog -> suggested "Enqueue in Qmmp"
    // which is music player
    // But when I query XDG database directly:
    //
    // subzero at vladkyne-karen:~/razor/trunk> xdg-mime query filetype /home/subzero/agnes-LookUp.mp3
    // audio/mpeg; charset=binary
    // subzero at vladkyne-karen:~/razor/trunk> xdg-mime query default audio/mpeg
    // qmmp_enqueue.desktop
    //
    // I expect to open qmmp *without* web browser - and it works with patched xdg-tools
    QDesktopServices::openUrl(QUrl("/home/subzero/agnes-LookUp.mp3"));

    return a.exec();
}

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQEcBAEBAgAGBQJNV9L1AAoJEC8yRjM4uE2tKj4IAMHTnnvrQQtr1PphmX2bdqDu
9D+a66lXQFtwr3XETtz79SBdE93iwgrPH7xkeT/S/8ivZI9XS51AOUk2VPUCqzfy
ZPZikpUArwuUu5ZqHPJoLHpzJdGOXHkD2Fv8qI2DtEJKJSJNvh/eGNxmRf7kYml5
nkXOg/XYRz4VLgad0Mgnljodd6d0b1+0bxRoPhjAR/Djre2Hqk/xZRn+NZerfyL9
Heaw27kLFEvAo8oAXQnBa1wO3trzlq3/pmpL8G0SSO8Ep28PQugCna5Uv+SdDhXo
OANximMnHDjmmk7b4Yq+uSpkOhnkj/DiZX3v5rDM2wG0Qvl01cCXw4L9hGG7IKo=
=m1iz
-----END PGP SIGNATURE-----


More information about the Portland mailing list