Changeset 7c8b8a0


Ignore:
Timestamp:
11/15/13 08:09:29 (10 months ago)
Author:
yurkis <yurkis@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
7ad7f46
Parents:
2c537e8
Message:

Parsing pkg install output

Location:
src-qt4/pc-updatecenter
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-updatecenter/mainwindow.cpp

    r2c537e8 r7c8b8a0  
    7373#if 1 
    7474    mPkgController.setEmulateCheckFile("/home/yurkis/_pkgcheck.txt"); 
    75     mPkgController.setEmulateUpdateFile("/home/yurkis/_pkguc.txt"); 
     75    mPkgController.setEmulateUpdateFile("/home/yurkis/_pkgupd.txt"); 
     76    //mPkgController.setEmulateDelay(1); 
    7677#endif 
    7778 
  • src-qt4/pc-updatecenter/pkgcontroller.cpp

    r2c537e8 r7c8b8a0  
    2424static const char* const PKG_CONFLICTS_LIST= "PKGCONFLICTS: "; 
    2525static const char* const PKG_CONFLICTS_REPLY= "PKGREPLY: "; 
     26static const char* const PKG_INSTALL_START_MARKER= "Upgrades have been requested for the following"; 
     27static const char* const PKG_INSTALL_DONE = "... done"; 
     28 
    2629 
    2730typedef enum{ 
     
    276279    } 
    277280 
     281    if (line.indexOf(PKG_INSTALL_START_MARKER) == 0) 
     282    { 
     283        mCurrentPkgNo=0; 
     284        misDownloadComplete= true; 
     285    } 
     286    else 
     287    if (line.contains(UPDATES_AVAIL_DL_SIZE_STRING)) 
     288    { 
     289        // Checking integrity 
     290 
     291    } 
     292    else 
     293    if ((line[0] == '[') && misDownloadComplete) 
     294    { 
     295        //Example: 
     296        // [2/717] Reinstalling a2ps-4.13b_5... done 
     297        // ^0      ^1           ^2 
     298 
     299        QStringList line_list = line.split(" "); 
     300        QString state; 
     301        if (line_list[1] == INSTALLING) 
     302            state= tr("Installed"); 
     303        if (line_list[1] == UPGRADING) 
     304            state= tr("Upgraded"); 
     305        if (line_list[1] == REINSTALLING) 
     306            state= tr("Reinstalled"); 
     307        QString pkg_name = line_list[2].replace(PKG_INSTALL_DONE, ""); 
     308        pkg_name= pkg_name.left(pkg_name.lastIndexOf("-")); 
     309 
     310        QString msg = line_list[0] + QString(" ") + state + QString(" ") + pkg_name; 
     311        progress.mMessage = msg; 
     312    } 
     313 
    278314    mLastLine = line; 
    279315 
  • src-qt4/pc-updatecenter/updatecontroller.cpp

    r2c537e8 r7c8b8a0  
    152152        if (mEmulationDelay) 
    153153        { 
    154            usleep(mEmulationDelay / 1000); 
     154           usleep(mEmulationDelay ); 
    155155        } 
    156156#endif 
  • src-qt4/pc-updatecenter/updatecontroller.h

    r2c537e8 r7c8b8a0  
    121121    void setEmulateUpdateFile(QString fileName) 
    122122        { mEmulateUpd= fileName;} 
     123    void setEmulateDelay(int ms) 
     124        {mEmulationDelay= ms;} 
    123125 
    124126private: 
Note: See TracChangeset for help on using the changeset viewer.