[PC-BSD Commits] r21260 - pcbsd/current/src-qt4/pc-mounttray

svn at pcbsd.org svn at pcbsd.org
Thu Jan 31 07:29:36 PST 2013


Author: kenmoore
Date: 2013-01-31 15:29:35 +0000 (Thu, 31 Jan 2013)
New Revision: 21260

Modified:
   pcbsd/current/src-qt4/pc-mounttray/menuItem.cpp
   pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
Log:
Tweak the new partition detection stiff for pc-mounttray a bit more, now it will actually check for a slice (s#) or sub-partition (s#a) to make sure the other device exists before ignoring the parent device.



Modified: pcbsd/current/src-qt4/pc-mounttray/menuItem.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/menuItem.cpp	2013-01-31 10:21:36 UTC (rev 21259)
+++ pcbsd/current/src-qt4/pc-mounttray/menuItem.cpp	2013-01-31 15:29:35 UTC (rev 21260)
@@ -123,9 +123,17 @@
   devtype << "USB"<<"SATA"<< "SD"        << "CD9660" << "CD9660";
   QString node = dev.section("/",-1);
   QString detType;
+  QString sptype = node;
   for(int i=0; i<validdev.length(); i++){
-    if(node.startsWith(validdev[i])){ detType = devtype[i]; break; }
+    if(node.startsWith(validdev[i])){ 
+	detType = devtype[i]; 
+	sptype.remove(devtype[i]);
+	break; 
+    }
   }
+  if(sptype.startsWith("s")){ sptype = "SLICE"; }
+  else{ sptype = "PARTITION"; }
+  
   //Make sure we quit before running commands on any invalid device nodes
   if(detType.isEmpty() || !QFile::exists(dev) ){return;}
   else{type->append(detType);}
@@ -142,8 +150,12 @@
   bool isMounted = FALSE;
   //qDebug() << "tmp:" << tmp;
   if( !tmp.filter("partition ").isEmpty() ){
+    QString pdev = dev;
+    if(sptype == "PARTITION"){ pdev += "s1"; }
+    else if( sptype == "SLICE"){ pdev += "a"; }
+    //if neither type, it will always register as having partitions
+    
     //Find out if the partitions are available as seperate devices
-    QString pdev = dev + "s1";
     if( QFile::exists(pdev)){ hasPartitions = TRUE; }
   }
   if( !tmp.filter("last mounted on /").isEmpty() ){

Modified: pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2013-01-31 10:21:36 UTC (rev 21259)
+++ pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2013-01-31 15:29:35 UTC (rev 21260)
@@ -29,10 +29,6 @@
   //Set the default Tray Icon (will change once tray menus are set)
   trayIcon->setIcon(QIcon(":icons/CDdevices-inactive.png"));
   trayIcon->show();
-  
-  //Load the automount file and populate the list
-  //qDebug() << "-Loading automount device list:" << AMFILE;
-  //loadAutoMountFile();
 
   //Startup the devd watching process
   qDebug() << "-Starting up the DEVD watcher";



More information about the Commits mailing list