Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
commit c72dd719b80aa6e53dd1b70d0e4f2f170e3b7852 2 parents b208a42 + a674c8d
Kris Moore kmoore134 authored
9 src-qt4/pc-mounttray/mountTray.cpp
View
@@ -119,13 +119,13 @@ int MountTray::findDeviceInList(QString newDev){
return -1;
}
-void MountTray::addDevice(QString dev, QString label, QString type, QString filesys){
+bool MountTray::addDevice(QString dev, QString label, QString type, QString filesys){
if(!dev.startsWith(DEVICEDIR)){ dev.prepend(DEVICEDIR); }
//Check if the device is already in the list
int tot=0;
for(int i=0; i<deviceList.length(); i++){
- if( deviceList[i]->device == dev ){ return; } //already exists, do nothing
+ if( deviceList[i]->device == dev ){ return false; } //already exists, do nothing
if( deviceList[i]->getDeviceName().startsWith(label) ){ tot++; }
}
//See if the label is unique as well, otherwise add a number to the end to make it unique
@@ -141,6 +141,7 @@ void MountTray::addDevice(QString dev, QString label, QString type, QString file
deviceList << tmp;
//Update the menu
updateMenu();
+ return true;
}
void MountTray::removeDevice(QString dev){
@@ -219,9 +220,9 @@ void MountTray::slotDevChanges(bool showPopup){
bool good = DCheck->devInfo(nsd[i],&dtype,&dlabel,&dfs,&dsize);
if(good){
//Now create a new entry for this device
- addDevice(nsd[i],dlabel,dtype,dfs);
+ bool added = addDevice(nsd[i],dlabel,dtype,dfs);
//Show a message bubble
- if(showPopup){
+ if(showPopup && added){ //make sure this is not shown for previously added devices
QString title = tr("New Device");
QString message = QString( tr("%1 can now be accessed")).arg(dlabel);
slotDisplayPopup(title, message);
2  src-qt4/pc-mounttray/mountTray.h
View
@@ -73,7 +73,7 @@ private slots:
void updateMenu();
void scanInitialDevices();
int findDeviceInList(QString);
- void addDevice(QString,QString,QString,QString);
+ bool addDevice(QString,QString,QString,QString);
void startupDevdProc();
void getInitialUsername();
void getDefaultFileManager();
Please sign in to comment.
Something went wrong with that request. Please try again.