[PC-BSD Commits] r17284 - pcbsd/current/src-qt4/pc-mounttray
svn at pcbsd.org
svn at pcbsd.org
Thu Jun 14 11:13:29 PDT 2012
Author: kenmoore
Date: 2012-06-14 18:13:28 +0000 (Thu, 14 Jun 2012)
New Revision: 17284
Modified:
pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
Log:
Make the pc-mounttray devd algorithm a bit smarter, now it will not try to autodetect devices (such as dsp* or pass*) that do not actually have a filesystem
Modified: pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp 2012-06-14 16:54:57 UTC (rev 17283)
+++ pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp 2012-06-14 18:13:28 UTC (rev 17284)
@@ -119,7 +119,11 @@
filesys = fslabel[i];
}
}
- if(filesys.isEmpty()){filesys = "UNKNOWN"; }
+ //If the filesystem could not be detected or is not supported
+ if(filesys.isEmpty()){
+ filesys = "UNKNOWN";
+ return newdev;
+ }
//Set the Device type and file system type
if(type.isEmpty()){ type = "USB"; }
@@ -475,12 +479,12 @@
bool deviceFound=FALSE;
QString cdev,cdevtype;
if(line.startsWith("!system=DEVFS")){
- qDebug() << line;
+ //qDebug() << line;
QString type = line.section("type=",1,1).section(" ",0,0).simplified();
cdev = line.section("cdev=",1,1).section(" ",0,0).simplified();
if(type=="CREATE"){isAttached=TRUE;}
//Parse out cdev to try and only get a single handle for each device
- if(!cdev.contains("/") && !cdev.contains("pass")){
+ if(!cdev.contains("/") && !cdev.contains("pass") ){
cdev.prepend("/dev/");
if( QFile::symLinkTarget(cdev).isEmpty() && isAttached && QFile::exists(cdev) ){
deviceFound=TRUE;
@@ -500,9 +504,11 @@
QAction* newdev = newDeviceAction(cdev,cdevtype);
if(isAttached){
qDebug() << "New device detected:" << newdev->text() << newdev->whatsThis() << newdev->statusTip();
- if( updateDeviceList( 1 , newdev ) ){
- showDeviceNotification(1,newdev);
- }
+ if( !newdev->statusTip().isEmpty() ){ //make sure the device is valid
+ if( updateDeviceList( 1 , newdev ) ){
+ showDeviceNotification(1,newdev);
+ }
+ }
}else{
qDebug() << "Device removal detected:" << newdev->whatsThis();
if( updateDeviceList( 4 , newdev ) ){
More information about the Commits
mailing list