Version: (using KDE KDE 3.5.3) Installed from: FreeBSD Ports OS: FreeBSD This commit http://websvn.kde.org/branches/KDE/3.5/kdebase/kioslave/media/mediamanager/fstabbackend.cpp?rev=521680&r1=503760&r2=521680 effectively breaks media:/ on FreeBSD - the contents of a mounted drive show up for a few seconds, then vanish. Reverting the change restores expected behaviour.
Dirk: you committed the incriminated code. Could you provide some insight on this commit?
Interesting.
Created attachment 16540 [details] possible fix I've not tested it yet, but I guess this should resolve the bug. Could you please verify?
Yes, that patch fixes this bug, but introduces another: After starting KDE, all my desktop device-icons (I have some for my CD devices) are missing now - they appear only once I go to media:/ in Konqueror and mount/browse a cd device from there.
N.B. - these are actually not 'device-icons' but "Links to Devices" created from the kdesktop context menu (Create New -> Link to Device -> ...)
Actually these links have nothing to do with kio media... I doubt the behavior you see now has anything to do with Dirk's patch. Are you sure you didn't modify something else?
I'm sorry, I was confused - those icons which are now disappearing on me are indeed 'device-icons', not 'Links to Devices'. I used to use the latter, but switched to the former once media:/ started to work on FreeBSD. :)
I can see the same problem on Linux (r548000), fstab-backend without any patch applied: the media applet in Kicker shows empty until I mount something.
Thiago: lets not confuse people. that seems to be a different bug.
Probably, the media applet works okay here.
SVN commit 551306 by mueller: fix media handling regression caused by stat-avoidance patch BUG:128757 M +10 -6 fstabbackend.cpp M +2 -1 fstabbackend.h --- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/fstabbackend.cpp #551305:551306 @@ -144,7 +144,7 @@ void FstabBackend::handleMtabChange(bool allowNotification) { - QStringList new_mtabIds, new_mtabEntries; + QStringList new_mtabIds; KMountPoint::List mtab = KMountPoint::currentMountPoints(); KMountPoint::List::iterator it = mtab.begin(); @@ -162,18 +162,19 @@ nothing has changed, do not stat the mount point. Avoids hang if network shares are stalling */ QString mtabEntry = dev + "*" + mp + "*" + fs; - bool isOldEntry = m_mtabEntries.contains(mtabEntry); - new_mtabEntries+=mtabEntry; - if (isOldEntry) continue; + if(m_mtabEntries.contains(mtabEntry)) { + new_mtabIds += m_mtabEntries[mtabEntry]; + continue; + } QString id = generateId(dev, mp); new_mtabIds+=id; + m_mtabEntries[mtabEntry] = id; if ( !m_mtabIds.contains(id) && m_fstabIds.contains(id) ) { QString mime, icon, label; guess(dev, mp, fs, true, mime, icon, label); - m_mediaList.changeMediumState(id, true, false, mime, icon, label); } @@ -211,6 +212,10 @@ QString mp = medium->mountPoint(); QString fs = medium->fsType(); + + QString mtabEntry = dev + "*" + mp + "*" + fs; + m_mtabEntries.remove(mtabEntry); + QString mime, icon, label; guess(dev, mp, fs, false, mime, icon, label); @@ -226,7 +231,6 @@ } m_mtabIds = new_mtabIds; - m_mtabEntries = new_mtabEntries; } void FstabBackend::handleFstabChange(bool allowNotification) --- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/fstabbackend.h #551305:551306 @@ -23,6 +23,7 @@ #include <qobject.h> #include <qstringlist.h> +#include <qmap.h> #ifdef Q_OS_FREEBSD #include <qtimer.h> @@ -53,7 +54,7 @@ bool m_networkSharesOnly; QStringList m_mtabIds; - QStringList m_mtabEntries; + QMap<QString, QString> m_mtabEntries; QStringList m_fstabIds; #ifdef Q_OS_FREEBSD QTimer m_mtabTimer;