src/gui/util/qdesktopservices_x11.cpp
changeset 37 758a864f9613
parent 18 2f34d5167611
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    69         return false;
    69         return false;
    70 
    70 
    71     if (launch(url, QLatin1String("xdg-open")))
    71     if (launch(url, QLatin1String("xdg-open")))
    72         return true;
    72         return true;
    73 
    73 
    74     if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
    74     // Use the X11->desktopEnvironment value if X11 is non-NULL,
       
    75     //  otherwise just attempt to launch command regardless of the desktop environment
       
    76     if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
    75         return true;
    77         return true;
    76     } else {
    78     } else {
    77         if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient exec")))
    79         if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient exec")))
    78             return true;
    80             return true;
    79     }
    81     }
    80 
    82 
    81     if (launch(url, QLatin1String("firefox")))
    83     if (launch(url, QLatin1String("firefox")))
    82         return true;
    84         return true;
   102     if (launch(url, QString::fromLocal8Bit(getenv("DEFAULT_BROWSER"))))
   104     if (launch(url, QString::fromLocal8Bit(getenv("DEFAULT_BROWSER"))))
   103         return true;
   105         return true;
   104     if (launch(url, QString::fromLocal8Bit(getenv("BROWSER"))))
   106     if (launch(url, QString::fromLocal8Bit(getenv("BROWSER"))))
   105         return true;
   107         return true;
   106 
   108 
   107     if (X11->desktopEnvironment == DE_GNOME && launch(url, QLatin1String("gnome-open"))) {
   109     // Use the X11->desktopEnvironment value if X11 is non-NULL,
       
   110     //  otherwise just attempt to launch command regardless of the desktop environment
       
   111     if ((!X11 || (X11 && X11->desktopEnvironment == DE_GNOME)) && launch(url, QLatin1String("gnome-open"))) {
   108         return true;
   112         return true;
   109     } else {
   113     } else {
   110         if (X11->desktopEnvironment == DE_KDE && launch(url, QLatin1String("kfmclient openURL")))
   114         if ((!X11 || (X11 && X11->desktopEnvironment == DE_KDE)) && launch(url, QLatin1String("kfmclient openURL")))
   111             return true;
   115             return true;
   112     }
   116     }
   113 
   117 
   114     if (launch(url, QLatin1String("firefox")))
   118     if (launch(url, QLatin1String("firefox")))
   115         return true;
   119         return true;