Skip to content
This repository
  • 3 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
13  src-qt4/pc-mounttray/devCheck.cpp
@@ -4,8 +4,8 @@
4 4
 
5 5
 DevCheck::DevCheck(){
6 6
   //Initialize the lists of valid device types
7  
-  validDevs << "da" << "ad" << "mmcsd" << "cd" << "acd" << "md";
8  
-  validDevTypes << "USB" << "SATA" << "SD" << "CD9660" << "CD9660" << "ISO";
  7
+  validDevs << "da" << "ad" << "mmcsd" << "cd" << "acd" << "md" << "da";
  8
+  validDevTypes << "USB" << "SATA" << "SD" << "CD9660" << "CD9660" << "ISO" << "SCSI";
9 9
   for(int i=0; i<validDevs.length(); i++){
10 10
     devFilter << validDevs[i]+"*";
11 11
   }
@@ -101,7 +101,12 @@ bool DevCheck::devInfo(QString dev, QString* type, QString* label, QString* file
101 101
 	break; 
102 102
     }
103 103
   }
104  
-  
  104
+  if(detType == "USB" && QFile::exists(fullDev)){
  105
+    //make sure that it is not a SCSI device
  106
+    QString camctl = "camcontrol identify "+node;
  107
+    camctl = pcbsd::Utils::runShellCommand( camctl ).join(" ");
  108
+    if(camctl.contains(" SCSI ")){ detType = "SCSI"; } //USB devices do not have any output
  109
+  }
105 110
   //Make sure we quit before running commands on any invalid device nodes
106 111
   if(detType.isEmpty() || !QFile::exists(fullDev) ){return FALSE;}
107 112
   else{type->append(detType);}
@@ -121,7 +126,7 @@ bool DevCheck::devInfo(QString dev, QString* type, QString* label, QString* file
121 126
     QStringList tmp = output.split(",");
122 127
     if( !tmp.filter("partition ").isEmpty() ){
123 128
       //Check for actual sub-devices (*s[#][a/b/c/....])
124  
-      if( devChildren(node).length() > 1 ){ hasPartitions = TRUE; } //the main device will always make it length 1
  129
+      if( devChildren(node).length() > 0 ){ hasPartitions = TRUE; }
125 130
     }
126 131
     if( !tmp.filter("last mounted on /").isEmpty() && (detType == "SATA")){
127 132
       isMounted = TRUE;
1  src-qt4/pc-mounttray/menuItem.cpp
@@ -48,6 +48,7 @@ MenuItem::MenuItem(QWidget* parent, QString newdevice, QString newlabel, QString
48 48
   else if(devType == "SD"){ devIcon->setPixmap(QPixmap(":icons/sdcard.png")); }
49 49
   else if(devType == "CD9660"){ devIcon->setPixmap(QPixmap(":icons/dvd.png")); }
50 50
   else if(devType == "ISO"){devIcon->setPixmap(QPixmap(":icons/dvd.png")); }
  51
+  else if(devType == "SCSI"){devIcon->setPixmap(QPixmap(":icons/harddrive.png")); }
51 52
   //Start the automount procedure if necessary
52 53
   if(checkAutomount->isChecked() || devType=="ISO"){
53 54
     QTimer::singleShot(500,this,SLOT( slotMountClicked() ));

No commit comments for this range

Something went wrong with that request. Please try again.