I hate being caught in a situation when after the last update from kdedev team broke other functionality that was not a problem in the version before. And this time the problem after updating kde from 4.5.1 to 4.5.2 there were an issue on vlc and any other video player when playing the video files on samba share network. Rather playing the video files instantly like before now if I click the video files at dolphin that will download first into /tmp/kdecache and then continue playing normally. This must be not a big problem if the video file is just several megabytes and you are not browsing playing the video just like I did. The long wait is a must, since the download speed on my home network is not gigabit and this begin worse and worse because I like browsing the video files on my home NAS (for my work not pr0n LOL) that was share using samba. At first, I thought this should be samba problem because there is parallel samba update from 3.4.3 to 3.5.5 along with this kde updates, but after spent a lot of time narrowing the problem I found out this is definetely kde4.5.2 issue especially with the service name called kioexec.
If I play the video over konsole, I got this behaviour :
{code}$ vlc smb://<smb-host>/<smb-share-name>/<video-filename>{/code}
I got streaming video instantly over vlc, just like I want
but if I play the video with kioexec (just like dolphin and other kde4 desktop file manager will do) :
{code}$ kioexec vlc smb://<smb-host>/<smb-share-name>/<video-filename>{/code}
the video file will downloaded first to /tmp/kdecache-<username)/krun, not the way I want
Dig and dig deeper into kde and kioexec, and kioexec, kdelibs4, etc, etc, … until reaching krun.cpp … and I found this :
{code}static QStringList supportedProtocols(const KService& _service)
{
// Check which protocols the application supports.
// This can be a list of actual protocol names, or just KIO for KDE apps.
QStringList supportedProtocols = _service.property(“X-KDE-Protocols”).toStringList();
KRunMX1 mx1(_service);
QString exec = _service.exec();
if (mx1.expandMacrosShellQuote(exec) && !mx1.hasUrls) {
Q_ASSERT(supportedProtocols.isEmpty()); // huh? If you support protocols you need %u or %U…
}
else {
if (supportedProtocols.isEmpty()) {
// compat mode: assume KIO if not set and it’s a KDE app
const QStringList categories = _service.property(“Categories”).toStringList();
if (categories.contains(“KDE”)) {
supportedProtocols.append(“KIO”);
}
else { // if no KDE app, be a bit over-generic
supportedProtocols.append(“http”);
supportedProtocols.append(“ftp”);
}
}
}
kDebug(7010) << “supportedProtocols:” << supportedProtocols;
return supportedProtocols;
}
// FIXME: the current way of invoking kioexec disables term and su use{/code}
Dang !! It seems the kdedev guy did some play on the code and arising this problem.
I’m not really understood what the kdedev team trying up to with this bugfix, but for you who can read cpp, here is what I found.
Opening remote URLs does not work well with non-KDE applications that claim to support remote URLs (%u/%U in Exec in .desktop) but do not support the particular protocol. For example opening a smb:// share in Dolphin and trying to open a document using OpenOffice.org launches OOo with the smb:// URL, which fails (silently, because OOo couldn’t be bothered with an error message apparently).
This patch makes KIO fall back to using kioexec also for these cases.
I download the source rpm of both kdelibs version, then pull out krun.cpp from kdelibs4 kde 4.5.1 src rpm and put it back on kdelibs4 on kde 4.5.2. Rebuild the src rpm and the devel package and installing them to my laptop … voila !!! VLC now run the video files share over samba instanly !!! and also all the video player that support streaming such as mplayer and SMPlayer. Problem solved. Now I can browse through samba share on my NAS, KLIXs Samba server, Winblows share and play the video files instantly without downloading them first.
I’ve been using this kdelibs4 modif for two days and found nothing wrong on my system except from mmc about page link that doesn’t work because it opens konqueror with the wrong link like this : file:///opt/mmc/http://ffmpeg.sourceforge.net/ Despite that minor problems, I think this kdelibs4 modif was only my temporary solution and keep cross my finger hope it will fix soon by kdedev team on 4.5.3 series.
For you who want to go farther, maybe it’s a simple fix by appending the samba protocol on this line below :
{code}else { // if no KDE app, be a bit over-generic
supportedProtocols.append(“http”);
supportedProtocols.append(“ftp”);
supportedProtocols.append(“https”); // #fixes bug 253294
supportedProtocols.append(“smb”);{/code}
EDIT :
Mr. David Faure from KDE dev from the comments below said that this patch was was wrong and could mislead to another problem since not all kde apps support this smb protocol. I tried his suggestion to pullout the patch and added some extra options to the vlc.desktop file :
X-KDE-Protocols=smb
it works good !! 🙂 , so I jump to conclusion, this is why kdedev guy edit the kdelibs for the first place, and this is the right solution.
Thank you David.