예제 #1
0
 void Battery::setStatus(QString charge) {
     if (charge != fStatus) {
         fStatus = charge;
         emit statusChanged();
         emit summaryValueChanged();
     }
 }
예제 #2
0
 void Battery::setLevel(int level) {
     int changed = 0;
     
     if ( fLevel != level ) {
         fLevel = level;
         emit levelChanged();
         changed++;
     }
     
     if ( changed > 0 ) {
         emit statusChanged();
         emit summaryValueChanged();
     }
 }
예제 #3
0
파일: memory.cpp 프로젝트: gilav/lighthouse
    void Memory::setMemory(int total, int free) {
        int changed = 0;
        if ( fTotal != total ) {
            fTotal = total;
            emit totalChanged(total);
            changed++;
        }

        if ( fFree != free ) {
            fFree = free;
            emit freeChanged(free);
            changed++;
        }

        if ( changed > 0 ) {
            emit summaryValueChanged(getSummaryValue());
        }
    }
예제 #4
0
    void Process::setProcList(ProcMap* procMap) {
        int oldSize = fProcList.size();
        ProcList procList = procMap->values();
        sort(procList);
        int startRow;
        int endRow;
        diffProcLists(fProcList, procList, startRow, endRow);
        fProcList = procList;
        //qDebug() << "diff from " << startRow << " to " << endRow << "\n";

        if ( startRow <= endRow ) {
            emit dataChanged(createIndex(startRow, 0), createIndex(endRow, 0));
        }

        if ( oldSize != fProcList.size() ) {
            emit summaryValueChanged();
        }
    }
예제 #5
0
 void Battery::setTechnology(QString technology) {
     fTechnology = technology;
     emit summaryValueChanged();
     emit technologyChanged();
 }
예제 #6
0
 void Battery::setHealth(QString f) {
     fHealth = f;
     emit summaryValueChanged();
 }