Bug 136598 - External URLs open from /var/tmp cache
Summary: External URLs open from /var/tmp cache
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.4.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Bugs
URL:
Keywords:
: 136758 136863 136896 137054 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-31 22:39 UTC by Alf Eaton
Modified: 2007-01-09 05:25 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alf Eaton 2006-10-31 22:39:37 UTC
Version:           1.4.4 (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
OS:                Linux

I'm running Amarok compiled from svn, on top of Gnome (Ubuntu). Links in the ContextBrowser prefixed with externalurl: are supposed to open in the web browser set in Amarok's preferences. I've tried setting the browser there, and everywhere else I can think of, but linked pages are always downloaded and opened in Firefox from /var/tmp/kdecache...

This isn't a real solution, but it works for now:

Index: app.cpp
===================================================================
--- app.cpp	(revision 600791)
+++ app.cpp	(working copy)
@@ -1225,7 +1225,7 @@
     bool invokeBrowser( const QString& url )
     {
         //URL can be in whatever forms KURL::fromPathOrURL understands - ie most.
-        return KRun::run( AmarokConfig::externalBrowser(), KURL::List( KURL::fromPathOrURL( url ) ) ) > 0;
+        return KRun::runURL( KURL::fromPathOrURL( url ),  QString("text/html")) > 0;
     }
 
     namespace ColorScheme
Comment 1 Seb Ruiz 2006-10-31 23:27:55 UTC
i can confirm this bug, but i'm not convinced with the fix. seems like it wouldn't take the custom browser setting into account
Comment 2 Alexandre Oliveira 2006-11-01 20:41:52 UTC
It will run the browser set for kde.
Comment 3 Seb Ruiz 2006-11-03 08:46:41 UTC
*** Bug 136758 has been marked as a duplicate of this bug. ***
Comment 4 Alexandre Oliveira 2006-11-05 03:36:35 UTC
*** Bug 136863 has been marked as a duplicate of this bug. ***
Comment 5 Alf Eaton 2006-11-05 12:19:52 UTC
Apparently the browser preference setting in Amarok is there because people who aren't running KDE (allowing dependency on only kdelibs) wouldn't be able to set the default KDE browser to open URLs. Doesn't KDE respect the default browser set in Gnome, or by using 'update-alternatives --config x-www-browser'?
Comment 6 Jo Schulze 2006-11-05 14:50:15 UTC
1) Anything that worked in former versions but doesn't in a new one is _not_ apparent.
2) Setting General: External Web Browser to "konqueror" (instead of the "Default KDE Browser") results in a display w/o CSS and images, all HTML <form> elements are useless since they point to non-existent files on the local disk which aren't there and wouldn't work if they would be there since the functionality relies on server side scripting and DB retrieval.
Comment 7 Alexandre Oliveira 2006-11-05 17:48:50 UTC
*** Bug 136896 has been marked as a duplicate of this bug. ***
Comment 8 Alf Eaton 2006-11-05 18:05:42 UTC
Jo, I'm afraid you misunderstood my point above. I'd asked in IRC why there was a browser setting within Amarok, rather than just using the system setting, and was told that it was needed for people who aren't running KDE and so don't have access to kcontrol to set KDE's default browser. The patch posted above ignores Amarok's browser setting, so I was asking if there was another way to set KDE's default browser for people who aren't running the full KDE desktop.
Comment 9 Alexandre Oliveira 2006-11-05 18:37:53 UTC
SVN commit 602316 by aoliveira:

Url's would open in external browser from cache.
BUG: 136598


 M  +3 -2      app.cpp   [POSSIBLY UNSAFE: KRun::runCommand]


--- trunk/extragear/multimedia/amarok/src/app.cpp #602315:602316
@@ -1225,7 +1225,8 @@
     bool invokeBrowser( const QString& url )
     {
         //URL can be in whatever forms KURL::fromPathOrURL understands - ie most.
-        return KRun::run( AmarokConfig::externalBrowser(), KURL::List( KURL::fromPathOrURL( url ) ) ) > 0;
+        const QString cmd = "%1 \"%2\"";
+        return KRun::runCommand( cmd.arg( AmarokConfig::externalBrowser(), KURL::fromPathOrURL( url ).url() ) ) > 0;
     }
 
     namespace ColorScheme
@@ -1314,7 +1315,7 @@
             result.ref( i ) = c;
         }
         return result;
-    } 
+    }
 
     QString vfatPath( const QString &path )
     {
Comment 10 Alexandre Oliveira 2006-11-08 18:47:13 UTC
*** Bug 137054 has been marked as a duplicate of this bug. ***