Skip to content
Browse files

Merge branch 'master' of

  • Loading branch information...
2 parents b208a42 + a674c8d commit c72dd719b80aa6e53dd1b70d0e4f2f170e3b7852 @kmoore134 kmoore134 committed
9 src-qt4/pc-mounttray/mountTray.cpp
@@ -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
+ 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);
//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
@@ -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();

0 comments on commit c72dd71

Please sign in to comment.
Something went wrong with that request. Please try again.