Changeset 2c537e8


Ignore:
Timestamp:
11/15/13 05:06:09 (11 months ago)
Author:
yurkis <yurkis@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
7c8b8a0
Parents:
3dec5de
Message:

Added update execution emulation ability (parsing log file without pc-updatemanager or pbi_update execution). I hate to wait until all of over 700 packages will be checked and downloaded. Also now I can debug normally (without execution as super user). Conflict dialog is now showing good. Update log now also fixed for downloading

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

Legend:

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

    rb913d3a r2c537e8  
    7171    } 
    7272 
     73#if 1 
     74    mPkgController.setEmulateCheckFile("/home/yurkis/_pkgcheck.txt"); 
     75    mPkgController.setEmulateUpdateFile("/home/yurkis/_pkguc.txt"); 
     76#endif 
     77 
     78 
    7379    mSysController.check(); 
    7480    mPkgController.check(); 
     
    99105            this, SLOT(pkgProgress(CAbstractUpdateController::SProgress))); 
    100106    connect(&mPkgController, SIGNAL(packageConflict(QString)), 
    101             this, SLOT(packageConflict(QString))); 
     107            this, SLOT(pkgConflict(QString))); 
    102108    connect(&mPBIController, SIGNAL(stateChanged(CAbstractUpdateController::EUpdateControllerState)), 
    103109            this, SLOT(pbiStateChanged(CAbstractUpdateController::EUpdateControllerState))); 
  • src-qt4/pc-updatecenter/pkgcontroller.cpp

    r453e63a r2c537e8  
    260260    { 
    261261        //----------- package conflict 
    262         mConflictList= line.replace(PKG_CONFLICTS_LIST, ""); 
     262        mConflictList= line.replace(PKG_CONFLICTS_LIST, "");         
     263        return; 
     264    } 
     265    else 
     266    if (line.indexOf(PKG_CONFLICTS_REPLY) == 0) 
     267    { 
    263268        progress.misCanCancel= true; 
    264269        progress.mLogMessages= QStringList()<<QString("ERROR: Package upgrade conflict for packages: ")<<mConflictList; 
     
    266271 
    267272        reportError(tr("Package conflict: ") + mConflictList); 
    268         return; 
    269     } 
    270     else 
    271     if (line.indexOf(PKG_CONFLICTS_REPLY)) 
    272     { 
    273         mConflictsReply= line.replace(PKG_CONFLICTS_REPLY, ""); 
     273         mConflictsReply= line.replace(PKG_CONFLICTS_REPLY, ""); 
    274274        emit packageConflict(mConflictList); 
    275275        return; 
  • src-qt4/pc-updatecenter/updatecontroller.cpp

    r5c7262b r2c537e8  
    22 
    33#include <QDebug> 
     4#include <unistd.h> 
     5 
     6const char* const EMULATION_PROC = "cat"; 
     7const QStringList EMULATION_DEF_ARGS; 
    48 
    59CAbstractUpdateController::CAbstractUpdateController() 
    610{ 
     11#ifdef CONTROLLER_EMULATION_ENABLED 
     12    mEmulationDelay= 0; 
     13#endif 
    714    mCurrentState= eNOT_INITIALIZED; 
    815    mUpdProc.setProcessChannelMode(QProcess::MergedChannels); 
     
    7885    QStringList args; 
    7986    updateShellCommand(proc, args); 
     87#ifdef CONTROLLER_EMULATION_ENABLED 
     88    if (mEmulateUpd.length()) 
     89    { 
     90        proc = EMULATION_PROC; 
     91        args = EMULATION_DEF_ARGS; 
     92        args<<mEmulateUpd; 
     93    } 
     94#endif 
    8095    mUpdProc.start(proc,args); 
    8196    if (!mUpdProc.waitForStarted()) 
     
    95110    QStringList args; 
    96111    checkShellCommand(proc, args); 
     112#ifdef CONTROLLER_EMULATION_ENABLED 
     113    if (mEmulateCheck.length()) 
     114    { 
     115        proc = EMULATION_PROC; 
     116        args = EMULATION_DEF_ARGS; 
     117        args<<mEmulateCheck; 
     118    } 
     119#endif 
    97120    mUpdProc.start(proc,args); 
    98121    if (!mUpdProc.waitForStarted()) 
     
    125148{ 
    126149    while (mUpdProc.canReadLine()) 
     150    { 
     151#ifdef CONTROLLER_EMULATION_ENABLED 
     152        if (mEmulationDelay) 
     153        { 
     154           usleep(mEmulationDelay / 1000); 
     155        } 
     156#endif 
    127157        parseProcessLine(currentState(), mUpdProc.readLine().simplified()); 
     158    } 
    128159} 
    129160 
  • src-qt4/pc-updatecenter/updatecontroller.h

    r5c7262b r2c537e8  
    55#include <QString> 
    66#include <QProcess> 
     7 
     8#define CONTROLLER_EMULATION_ENABLED 
    79 
    810#define USES_CHECK_SHELL_COMMAND(command, arguments)\ 
     
    112114    void slotProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); 
    113115 
     116#ifdef CONTROLLER_EMULATION_ENABLED 
     117public: 
     118    void setEmulateCheckFile(QString fileName) 
     119        { mEmulateCheck= fileName; } 
     120 
     121    void setEmulateUpdateFile(QString fileName) 
     122        { mEmulateUpd= fileName;} 
     123 
     124private: 
     125    QString mEmulateCheck; 
     126    int     mEmulationDelay; 
     127    QString mEmulateUpd; 
     128#endif 
    114129}; 
    115130 
Note: See TracChangeset for help on using the changeset viewer.