Changeset e417b8a


Ignore:
Timestamp:
02/04/14 12:42:54 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
7cfa95e
Parents:
9cf580a
Message:

Clean up the device naming scheme in the mount tray:
1) Do not use glabel for NTFS devices (when mounted through fuse glabel is not consistent in giving the label)
2) Use device's camcontrol identifyier for SATA devices as well as USB devices. This should provide a more specific name than "SATA-Device".
3) For a camcontrol name, append "-" followed by the partition number (so ada0s1a will have a "-1a" appended to the end. Again, this should help devices have unique names.

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

Legend:

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

    rb34565c re417b8a  
    7272    index = glout.indexOf("Geom name: "+node, index); //move to the next index if there is one 
    7373  } 
     74  dlabel.replace("%20", " "); //quick check to make sure it does not have that special character 
    7475  return dlabel; 
    7576} 
     
    101102  if(detType == "USB" && QFile::exists(fullDev)){ 
    102103    //make sure that it is not a SCSI device 
    103     camctl = pcbsd::Utils::runShellCommand( QString("camcontrol inquiry ")+node ).join(" "); 
    104     if(camctl.contains(" Fixed Direct Access SCSI")){ detType = "SCSI"; } //USB devices do not have any output 
     104    camctl = pcbsd::Utils::runShellCommand( QString("camcontrol inquiry ")+node.section("s",0,0) ).join(" "); 
     105    if(camctl.contains(" Fixed Direct Access SCSI")){ detType = "SCSI"; } 
    105106    if(camctl.contains("camcontrol")){ camctl.clear(); } //error or invalid device type 
     107  }else if(detType == "SATA" && QFile::exists(fullDev)){ 
     108    camctl = pcbsd::Utils::runShellCommand( QString("camcontrol identify ")+node.section("s",0,0) ).join(" "); 
     109    if(camctl.contains("camcontrol")){ camctl.clear(); } //error or invalid device type 
     110  } 
     111  if(!camctl.isEmpty()){ 
     112    //Alternate Device name for label later 
     113    camctl = camctl.section(">",0,0).section("<",-1).section(" ",0,0).simplified(); 
     114    QString partition = node.section("s",1,1); 
     115    if(!partition.isEmpty()){ camctl.append("-"+partition); } 
    106116  } 
    107117  //Make sure we quit before running commands on any invalid device nodes 
     
    183193  bool hasLabel = FALSE; 
    184194  QString glabel; 
    185   if(!isCD){ glabel = devLabel(node, filesys); } 
     195  //Don't use glabel for SATA devices right now because it is inconsistent 
     196  if(!isCD && filesys!="NTFS"){ glabel = devLabel(node, filesys); } 
    186197  //Check to see if we have a label, otherwise assign one 
    187198  if( !glabel.isEmpty() ){ dlabel = glabel; hasLabel = TRUE; } //glabel 
     
    189200  else if( !camctl.isEmpty() ){  
    190201    //not necessarily a "detected" label, but just an alternate fallback name 
    191     dlabel = camctl.section(">",0,0).section("<",-1).section(" ",0,0).simplified(); 
     202    dlabel = camctl; 
    192203  }else{ 
    193204    //Assign a device label 
  • src-qt4/pc-mounttray/menuItem.cpp

    rdb3bc52 re417b8a  
    1919    devLabel->setToolTip(device); 
    2020    devLabel->setText(newlabel); 
    21      
    2221  devIcon = new QLabel; 
    2322    devIcon->setToolTip(device); 
     
    114113  for(int i=0; i<chk.length(); i++){ 
    115114    mounted = chk[i].contains(device) || chk[i].contains(devLabel->text()) || chk[i].contains(devLabel->text().replace(" ","-")); 
     115    if(!mounted && chk[i].startsWith("/dev/fuse on ") ){ 
     116      //No method of probing fuse devices to find the original parent (yet) 
     117    } 
    116118    if(mounted){  
    117119      //Save the mountpoint if it is mounted 
Note: See TracChangeset for help on using the changeset viewer.