Bug 115539 - [PATCH] Patch Kaffeine for loading system:/media/ urls
Summary: [PATCH] Patch Kaffeine for loading system:/media/ urls
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jürgen Kofler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 14:52 UTC by Emanuele Tamponi
Modified: 2006-08-20 06:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The patch file (735 bytes, patch)
2005-11-02 14:54 UTC, Emanuele Tamponi
Details
handle local protocols (eg media:/, system:/) (1.94 KB, patch)
2006-03-31 13:50 UTC, Andre Woebbeking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuele Tamponi 2005-11-02 14:52:48 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.4.4 
OS:                Linux

I just noted that Kaffeine loads media:/ urls as local files (just well), but doesn't do the same with system:/media/ urls.

So I changed a bit the file src/playlist.cpp:

*** playlist.cpp        2005-10-26 15:10:33.000000000 +0200
--- playlist.cpp.new    2005-11-02 14:44:23.000000000 +0100
***************
*** 509,517 ****
        {
                mrl = MRL(urls[i]);

!               if (mrl.kurl().protocol() == "media")
                {
-                       QString url(mrl.kurl().prettyURL());
                        QString mediaName(url.mid(7));
                        int slash = mediaName.find("/");
                        QString filePath(mediaName.mid(slash));
--- 509,520 ----
        {
                mrl = MRL(urls[i]);

!               QString url(mrl.kurl().prettyURL());
!               if (url.startsWith("system:/media/"))
!                       url.replace(QRegExp("^system:/media/"),"media:/");
!
!               if (url.startsWith("media:/"))
                {
                        QString mediaName(url.mid(7));
                        int slash = mediaName.find("/");
                        QString filePath(mediaName.mid(slash));


Simply if the url start with "system:/media/", change it with "media:/"; then if the url starts with "media:/", continue normally.

It works perfectly in my system.

I hope this will help ;)

Thank you and good bye
Comment 1 Emanuele Tamponi 2005-11-02 14:54:15 UTC
Created attachment 13249 [details]
The patch file

Here is the patch for playlist.cpp
Comment 2 Thiago Macieira 2005-11-02 18:17:55 UTC
Please use diff -u when creating diffs :-)

This patch doesn't solve the underlying problem of hardcoding paths. Please see the latest k3b, which solves this bug correctly, by detecting UDS_LOCAL_PATH entries.
Comment 3 Emanuele Tamponi 2005-11-02 22:20:35 UTC
This patch can be used as a workaround until you get a better solution, so I haven't to manually modify the path in konqueror to watch a movie from the cd...

imho ;)

However today or tomorrow I'll get on this to solve the problem.
I'm working to a patch for kmplayer too (that doesn't read ANY kioslave...)

Thank you and bye
Comment 4 Stanislav Nikolov 2006-01-06 00:08:41 UTC
Emunuele: Hey, what's up with these patches ? :) Btw, on my Gentoo KDE 3.5 system it refuses to open a media:/* files, too. Strange :)
Comment 5 Andre Woebbeking 2006-03-31 13:48:36 UTC
Hi, 

I also tried to create a patch :) If it works for you I can commit it.
Comment 6 Andre Woebbeking 2006-03-31 13:50:18 UTC
Created attachment 15393 [details]
handle local protocols (eg media:/, system:/)
Comment 7 Andre Woebbeking 2006-03-31 13:54:45 UTC
BTW, this looks related to 124433.
Comment 8 Christophe Thommeret 2006-08-20 06:54:41 UTC
*** Bug has been marked as fixed ***.