Changeset 5675b55


Ignore:
Timestamp:
01/23/14 11:29:08 (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
065b890
Parents:
d55a8b3
Message:

Make sure that linsysfs is skipped by the mount tray disk watcher, and also move the nullfs skip to the actual disk watcher as well.

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

Legend:

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

    r14a1caf r5675b55  
    3131      QString filesystem = fsList[i].section("::",1,1); 
    3232      //Don't show NULLFS filesystem (prevent showing all the PBI mountpoints) 
    33       if(filesystem.toLower()=="nullfs"){ continue; } 
     33      //if(filesystem.toLower()=="nullfs"){ continue; } 
    3434      double totalK = fsList[i].section("::",2,2).toDouble(); 
    3535      double usedK = fsList[i].section("::",3,3).toDouble(); 
  • src-qt4/pc-mounttray/fsWatcher.cpp

    r03aedf0 r5675b55  
    5151    else if(dfout[i].startsWith("procfs")){} 
    5252    else if(dfout[i].startsWith("linprocfs")){} 
     53    else if(dfout[i].startsWith("linsysfs")){} 
    5354    else{ 
    5455      //Now parse out the info   
    5556      dfout[i].replace("\t"," "); 
    5657      QString fs = dfout[i].section("  ",1,1,QString::SectionSkipEmpty).simplified(); 
    57       if(fs != "zfs" && fs!="cd9660"){  //ignore zfs filesystems (already taken care of) 
     58      if(fs != "zfs" && fs!="cd9660" && fs!="nullfs"){  //ignore zfs filesystems (already taken care of) 
    5859        QString name = dfout[i].section("  ",6,6,QString::SectionSkipEmpty).simplified(); 
    5960        QString total = dfout[i].section("  ",2,2,QString::SectionSkipEmpty).simplified(); 
  • src-qt4/pc-mounttray/menuItem.cpp

    rc69425e r5675b55  
    33 
    44 
    5 MenuItem::MenuItem(QWidget* parent, QString newdevice, QString newlabel, QString newtype, QString newfs) : QWidgetAction(parent) 
     5MenuItem::MenuItem(QWidget* parent, QString newdevice, QString newlabel, QString newtype, QString newfs, QString user) : QWidgetAction(parent) 
    66{ 
    77  AMFILE= QDir::homePath() + "/.pc-automounttray";   //File to save/load all the devices to be automounted 
     
    1111  devType = newtype; 
    1212  filesystem = newfs; 
     13  currentUser = user; 
    1314  //Create the layout 
    1415  QGridLayout* layout = new QGridLayout(); 
     
    223224  QString cmd1 = "mkdir " + mntpoint; 
    224225  QString cmd2 = fstype + " " +fsopts + " " + device + " " + mntpoint; 
    225   QString cmd3 = "chmod 777 " + mntpoint; //to set full user/root access 
    226    
     226  cmd2 = "su -m "+currentUser+" -c \""+cmd2+"\""; //add command to run as user 
     227  QString cmd3 = "chmod 755 " + mntpoint; //to set full user/root access 
     228  QString cmd4 = "chown "+currentUser+":"+currentUser+" "+mntpoint; //make the current user the owner 
    227229  qDebug() << "Mounting device" << device << "on" << mntpoint << "("<<filesystem<<")"; 
    228230  if(DEBUG_MODE){ qDebug() << " - command:" << cmd2; } 
     
    234236  if( output.join(" ").simplified().isEmpty() ){ 
    235237    //directory created, run the next commands 
    236     system(cmd3.toUtf8()); //set directory permissions before mounting device 
     238    system(cmd4.toUtf8()); //set directory permissions before mounting device 
     239    system(cmd3.toUtf8()); //set directory ownership to the user 
    237240    output = pcbsd::Utils::runShellCommand(cmd2); 
    238241    if( output.join(" ").simplified().isEmpty() ){ 
  • src-qt4/pc-mounttray/menuItem.h

    rc69425e r5675b55  
    2626 
    2727  public: 
    28         MenuItem(QWidget* parent = 0, QString newdevice="", QString newlabel="", QString newtype="", QString newfs=""); 
     28        MenuItem(QWidget* parent = 0, QString newdevice="", QString newlabel="", QString newtype="", QString newfs="", QString user=""); 
    2929        ~MenuItem(); 
    3030         
     
    3636        QString currentSize; //number in KB saved as a QString 
    3737        QString AMFILE; 
     38        QString currentUser; //username of current user (for setting mount dir ownership) 
    3839         
    3940        //Setters 
     
    5960        QCheckBox* checkAutomount; 
    6061 
    61         //void mountItem(); 
    6262        void unmountItem(bool force = false); 
    6363        void updateSizes(); 
  • src-qt4/pc-mounttray/mountTray.cpp

    re6c1b6c r5675b55  
    139139  qDebug() << "Valid Device Connection:" << dev << type << label << filesys; 
    140140  //Create the menu item (will automount if necessary) 
    141   MenuItem *tmp = new MenuItem(this, dev, label, type, filesys); 
     141  MenuItem *tmp = new MenuItem(this, dev, label, type, filesys, USERNAME); 
    142142  //connect the signals/slots 
    143143  connect(tmp, SIGNAL(itemMounted(QString)), this, SLOT(openMediaDir(QString)) ); 
Note: See TracChangeset for help on using the changeset viewer.