Logo Search packages:      
Sourcecode: qapt version File versions  Download package

CacheState QApt::Backend::currentCacheState (  )  const

Takes a snapshot of the current state of the package cache. (E.g. which packages are marked for removal, install, etc)

Returns:
The current state of the cache as a CacheState

Definition at line 476 of file backend.cpp.

Referenced by redo(), saveCacheState(), and undo().

{
    Q_D(const Backend);

    CacheState state;
    int pkgSize = d->packages.size();
    #if QT_VERSION >= 0x040700
    state.reserve(pkgSize);
    #endif
    for (unsigned i = 0; i < pkgSize; ++i) {
        state.append(d->packages[i]->state());
    }

    return state;
}


Generated by  Doxygen 1.6.0   Back to index