Changeset 15028e5


Ignore:
Timestamp:
12/23/14 08:14:23 (3 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.1.1
Children:
fe2c10c
Parents:
091dd28
Message:

Fix the pc-systemupdatertray to properly detect when syscache is not running and use the fallback pc-systemflags detection routine to see if an update is running.

Location:
src-qt5/pc-systemupdatertray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/pc-systemupdatertray/SysStatus.cpp

    rc82bc50 r15028e5  
    2020    //Get all the possible flag files and only take the most recent (latest flag - they overwrite each other) 
    2121    QStringList upinfo = pcbsd::Utils::runShellCommand("syscache needsreboot isupdating"); 
    22     if(upinfo.length() < 2){ 
     22    if(upinfo.length() < 2 || upinfo.join("").contains("[ERROR]") ){ 
    2323      //Fallback method in case syscache is not working for some reason 
    2424      QDir procdir(UPDATE_PROC_DIR); 
    2525      QFileInfoList files = procdir.entryInfoList(QStringList() << UPDATE_PROC_FLAG_FILE_FILTER, QDir::Files, QDir::Time); 
     26      QStringList tmp; for(int i=0; i<files.length(); i++){ tmp << files[i].absoluteFilePath(); } 
    2627      QString flag; 
    2728      if(!files.isEmpty()){ flag = pcbsd::Utils::readTextFile(files.first().absoluteFilePath()).simplified().toLower(); } 
     29      //qDebug() << "No syscache running - use flags:" << tmp << flag; 
    2830      complete = (UPDATE_PROC_FINISHED == flag ); 
    2931      updating = (UPDATE_PROC_WORKING == flag ); 
  • src-qt5/pc-systemupdatertray/TrayUI.cpp

    rd780527 r15028e5  
    6161  //Initialize the backend systems   
    6262  UpdateAUNotice(); //make sure that we get an icon/info right away 
    63   QTimer::singleShot(30000, this, SLOT(checkForUpdates()) ); //Wait 30 seconds to perform the first update check 
     63  QTimer::singleShot(15000, this, SLOT(checkForUpdates()) ); //Wait 15 seconds to perform the first update check 
    6464} 
    6565 
     
    175175    reminderVisible = false; 
    176176  }else if(CSTAT.updating){ 
    177     this->showMessage(tr("Starting updates"), "", QSystemTrayIcon::NoIcon, 1000); //1 second timer (minor message) 
     177    this->showMessage(tr("Update Procedure Running"), "", QSystemTrayIcon::NoIcon, 1000); //1 second timer (minor message) 
    178178  }else if(AUval=="all"){  
    179179    return; //All updates handled automatically - don't show messages about them 
Note: See TracChangeset for help on using the changeset viewer.