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

int QApt::Backend::packageCount ( const Package::States &  states  )  const

Queries the backend for the total number of packages in the Apt database, discarding no-longer-existing packages that linger on in the status cache (That have a version of 0)

Parameters:
states The package state(s) for which you wish to count packages for
Returns:
The total number of packages of the given PackageState in the Apt database

Definition at line 255 of file backend.cpp.

References package(), packageCount(), and QApt::Package::state().

{
    Q_D(const Backend);

    int packageCount = 0;

    foreach(const Package *package, d->packages) {
        if ((package->state() & states)) {
            packageCount++;
        }
    }

    return packageCount;
}


Generated by  Doxygen 1.6.0   Back to index