Changeset 781fd04


Ignore:
Timestamp:
04/18/13 08:18:55 (15 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
89ee0d8
Parents:
aa082fc8
Message:

Make sure the mount tray disk space notifier only displays the warning for new devices that are over 90% full.

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

Legend:

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

    r891636a r781fd04  
    112112      //Device greater than 90% full, warn the user 
    113113      badDevs << devList[i].section("::",0,0); //list the mountpoint 
    114       qDebug() << "WARNING: Device almost full:" << devList[i].section("::",0,0)+": "+QString::number(percent)+"% full"; 
     114      qDebug() << "WARNING: Device almost full:" << devList[i].section("::",0,0)+": "+QString::number(percent)+"% full: Time: "+QTime::currentTime().toString(); 
    115115    } 
    116116  } 
    117117  if(!badDevs.isEmpty()){ 
    118     QString title = tr("Disk(s) Almost Full"); 
    119     QString message = badDevs.join(", "); 
    120     emit FSWarning(title,message); 
     118    //check to make sure these are new "bad" devices 
     119    bool newFound = FALSE; 
     120    for(int i=0; i<badDevs.length(); i++){ 
     121      if( oldBadDevs.indexOf(badDevs[i]) == -1){ newFound = TRUE; }          
     122    } 
     123    if(newFound){ 
     124      QString title = tr("Disk(s) Almost Full"); 
     125      QString message = badDevs.join(", "); 
     126      emit FSWarning(title,message); 
     127    } 
    121128  } 
     129  //Save the current badDevs as the old list 
     130  oldBadDevs = badDevs; 
     131  //Reset the timer for the next time this function is to be called 
    122132  timer->start(); //reset the timer again 
    123133} 
  • src-qt4/pc-mounttray/fsWatcher.h

    r891636a r781fd04  
    1010#include <QCoreApplication> 
    1111#include <QDebug> 
     12#include <QTime> 
    1213 
    1314 
     
    2930private: 
    3031  QTimer *timer; 
     32  QStringList oldBadDevs; 
     33   
    3134  static QStringList runCMD(QString); 
    3235  static int calculatePercentage(int,int); 
Note: See TracChangeset for help on using the changeset viewer.