Browse files

Make sure that we do not open up the filemanager during the mounttray…

… initialization. This should prevent opening a ton of file manager windows when you boot the system if you have a bunch of harddrive partitions set to automount.
  • Loading branch information...
Ken Moore
Ken Moore committed Aug 19, 2013
1 parent db5e0d0 commit 1a09105c905fbb00457376807707817fae3f1c3a
Showing with 4 additions and 0 deletions.
  1. +3 −0 src-qt4/pc-mounttray/mountTray.cpp
  2. +1 −0 src-qt4/pc-mounttray/mountTray.h
@@ -18,6 +18,7 @@ void MountTray::programInit()
DCheck = new DevCheck(); //initialize class for checking devices
qDebug() << "pc-mounttray: starting up";
+ MTINIT=true; //set the flag that the mount tray is initializing;
getInitialUsername(); //try to detect the non-root user who is running the program with root permissions
getDefaultFileManager(); //try to detect the default file-manager for opening the mount directory
@@ -70,6 +71,7 @@ void MountTray::programInit()
qDebug() << "-Program now ready for use";
+ MTINIT=false;
void MountTray::updateMenu(){
@@ -302,6 +304,7 @@ void MountTray::slotOpenMediaDir(){
void MountTray::openMediaDir(QString dir){
+ if(MTINIT){ return; } //don't open the FM during program initialization
//Open the default file-manager to the directory listed
if(dir.isEmpty()){ dir = MOUNTDIR; }
if(!dir.endsWith("/")){ dir.append("/"); } //make sure the filemanager knows it is a directory
@@ -72,6 +72,7 @@ private slots:
bool useDiskWatcher, useDiskTimerDevd;
int diskTimerMaxMS; //milliseconds
QString popupSave; //for saving the device for the latest pop-up message
+ bool MTINIT;
void updateMenu();
void scanInitialDevices();

0 comments on commit 1a09105

Please sign in to comment.