summaryrefslogtreecommitdiffstats
path: root/x11/kdebase3/files/patch-kioslave_media_mediamanager-fstabbackend.cpp
blob: 5fb2c123a6c2dca4101ac8efc7c9f79186f6b3f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- kioslave/media/mediamanager/fstabbackend.cpp.orig	Mon May 22 20:12:42 2006
+++ kioslave/media/mediamanager/fstabbackend.cpp	Fri Jun 16 08:56:20 2006
@@ -111,6 +111,7 @@
 	if ( mount->mountType() == "swap"
 	  || mount->mountType() == "tmpfs"
 	  || mount->mountType() == "sysfs"
+	  || mount->mountType() == "fdescfs"
 	  || mount->mountType() == "kernfs"
 	  || mount->mountType() == "usbfs"
 	  || mount->mountType().contains( "proc" )
@@ -144,7 +145,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 +163,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 +213,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 +232,6 @@
 	}
 
 	m_mtabIds = new_mtabIds;
-        m_mtabEntries = new_mtabEntries;
 }
 
 void FstabBackend::handleFstabChange(bool allowNotification)
OpenPOWER on IntegriCloud