Changeset b103b6c


Ignore:
Timestamp:
08/27/13 12:57:03 (13 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
24cce1d5
Parents:
f7d313c
Message:

Add a fix for differentiating between USB and SCSI devices (still needs testing with a SCSI device, but it is a relatively minor change and should work)

Location:
src-qt4/pc-mounttray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-mounttray/devCheck.cpp

    rf7d313c rb103b6c  
    55DevCheck::DevCheck(){ 
    66  //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"; 
    99  for(int i=0; i<validDevs.length(); i++){ 
    1010    devFilter << validDevs[i]+"*"; 
     
    102102    } 
    103103  } 
    104   if(detType == "USB"){ 
     104  if(detType == "USB" && QFile::exists(fullDev)){ 
    105105    //make sure that it is not a SCSI device 
    106      
    107   } 
    108    
     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  } 
    109110  //Make sure we quit before running commands on any invalid device nodes 
    110111  if(detType.isEmpty() || !QFile::exists(fullDev) ){return FALSE;} 
     
    126127    if( !tmp.filter("partition ").isEmpty() ){ 
    127128      //Check for actual sub-devices (*s[#][a/b/c/....]) 
    128       if( devChildren(node).length() > 0 ){ hasPartitions = TRUE; } //the main device will always make it length 1 
     129      if( devChildren(node).length() > 0 ){ hasPartitions = TRUE; } 
    129130    } 
    130131    if( !tmp.filter("last mounted on /").isEmpty() && (detType == "SATA")){ 
  • src-qt4/pc-mounttray/menuItem.cpp

    r22f21be rb103b6c  
    4949  else if(devType == "CD9660"){ devIcon->setPixmap(QPixmap(":icons/dvd.png")); } 
    5050  else if(devType == "ISO"){devIcon->setPixmap(QPixmap(":icons/dvd.png")); } 
     51  else if(devType == "SCSI"){devIcon->setPixmap(QPixmap(":icons/harddrive.png")); } 
    5152  //Start the automount procedure if necessary 
    5253  if(checkAutomount->isChecked() || devType=="ISO"){ 
Note: See TracChangeset for help on using the changeset viewer.