Changeset 133c504


Ignore:
Timestamp:
01/13/14 01:27:42 (11 months ago)
Author:
yurkis <yurkis@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
021abd6, d7a088d
Parents:
b8bb18a
Message:

Finally, looks like I've fixed control panel freeze (I hope). Also added some items for mate and cinnamon

Location:
src-qt4/pc-controlpanel
Files:
8 added
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-controlpanel/pbiinfo.cpp

    r1620346 r133c504  
    2929#include <QCoreApplication> 
    3030#include <QTextStream> 
     31#include <QDebug> 
    3132 
    3233static const char* const GENERIC_NAME_FIELD = "PBI Information for:"; 
     
    7071    loadPBIs->setProcessChannelMode(QProcess::MergedChannels); 
    7172    loadPBIs->start(QString("pbi_info"), QStringList() << "-v"); 
     73 
     74    int timeoutMs = 5000; 
     75    const int waitTaime = 200; 
     76    bool isTimeoutEnded = false; 
     77 
    7278    while(loadPBIs->state() == QProcess::Starting || loadPBIs->state() == QProcess::Running) { 
    73       loadPBIs->waitForFinished(200); 
     79      loadPBIs->waitForFinished(waitTaime); 
    7480      QCoreApplication::processEvents(); 
     81      if (timeoutMs<=0) 
     82      { 
     83          isTimeoutEnded = true; 
     84          qDebug()<<"Timeout while pbi_info!"; 
     85          break; 
     86      } 
    7587    } 
    76     QString line; 
     88 
    7789    while ( loadPBIs->canReadLine() ) 
    7890    { 
    7991        Str = loadPBIs->readLine().simplified(); 
     92        if (isTimeoutEnded) 
     93            qDebug()<<Str; 
    8094        if (Str.contains(GENERIC_NAME_FIELD)) 
    8195        { 
Note: See TracChangeset for help on using the changeset viewer.