Changeset fd5dfb8


Ignore:
Timestamp:
08/05/13 06:32:38 (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
a674c8d
Parents:
92c27ca
Message:

Fix a bug with the mounttray popup notification happening more often than necessary

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

Legend:

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

    r6e77702 rfd5dfb8  
    120120} 
    121121 
    122 void MountTray::addDevice(QString dev, QString label, QString type, QString filesys){ 
     122bool MountTray::addDevice(QString dev, QString label, QString type, QString filesys){ 
    123123  if(!dev.startsWith(DEVICEDIR)){ dev.prepend(DEVICEDIR); } 
    124124   
     
    126126  int tot=0; 
    127127  for(int i=0; i<deviceList.length(); i++){ 
    128     if( deviceList[i]->device == dev ){ return; } //already exists, do nothing 
     128    if( deviceList[i]->device == dev ){ return false; } //already exists, do nothing 
    129129    if( deviceList[i]->getDeviceName().startsWith(label) ){ tot++; } 
    130130  } 
     
    142142  //Update the menu 
    143143  updateMenu(); 
     144  return true; 
    144145} 
    145146 
     
    220221    if(good){ 
    221222      //Now create a new entry for this device 
    222       addDevice(nsd[i],dlabel,dtype,dfs);   
     223      bool added = addDevice(nsd[i],dlabel,dtype,dfs);   
    223224      //Show a message bubble 
    224       if(showPopup){ 
     225      if(showPopup && added){ //make sure this is not shown for previously added devices 
    225226        QString title = tr("New Device"); 
    226227        QString message = QString( tr("%1 can now be accessed")).arg(dlabel); 
  • src-qt4/pc-mounttray/mountTray.h

    r891636a rfd5dfb8  
    7474  void scanInitialDevices(); 
    7575  int findDeviceInList(QString); 
    76   void addDevice(QString,QString,QString,QString); 
     76  bool addDevice(QString,QString,QString,QString); 
    7777  void startupDevdProc(); 
    7878  void getInitialUsername(); 
Note: See TracChangeset for help on using the changeset viewer.