digiKam
|
Public Types | |
enum | MemoryDetail { TotalRam = 1 << 0 , AvailableRam = 1 << 1 , TotalSwap = 1 << 10 , AvailableSwap = 1 << 11 , AvailableMemory = AvailableRam | AvailableSwap } |
Public Member Functions | |
qint64 | bytes (MemoryDetails detail) const |
int | isValid () const |
double | kilobytes (MemoryDetails detail) const |
KMemoryInfo () | |
KMemoryInfo (const KMemoryInfo &info) | |
QDateTime | lastUpdate () const |
double | megabytes (MemoryDetails detail) const |
KMemoryInfo & | operator= (const KMemoryInfo &info) |
int | update () |
~KMemoryInfo () | |
Static Public Member Functions | |
static KMemoryInfo | currentInfo () |
|
explicit |
Constructs a memory information object which has no updated information.
Digikam::KMemoryInfo::KMemoryInfo | ( | const KMemoryInfo & | info | ) |
Copy constructor.
Digikam::KMemoryInfo::~KMemoryInfo | ( | ) |
Destructor.
qint64 Digikam::KMemoryInfo::bytes | ( | MemoryDetails | detail | ) | const |
Returns the specified memory details
, as it was read by the last update(). If you combine the flags, they will either be added, or, when nonsensical, the larger of two values is returned (if you request TotalRam and FreeRam, you get TotalRam).
References AvailableRam, AvailableSwap, TotalRam, TotalSwap, and value.
Referenced by Digikam::DImgLoader::checkAllocation(), kilobytes(), Digikam::LibsInfoDlg::LibsInfoDlg(), and megabytes().
|
static |
Returns a KMemoryInfo object already updated to the current memory situation.
References update().
Referenced by Digikam::DImgLoader::checkAllocation(), and Digikam::LibsInfoDlg::LibsInfoDlg().
int Digikam::KMemoryInfo::isValid | ( | ) | const |
Returns status if last update was successful and the data is valid. -1 : not valid : unsupported platform 0 : not valid : parse failure from supported platform 1 : valid : parse done with success from supported platform
Referenced by Digikam::DImgLoader::checkAllocation(), and Digikam::LibsInfoDlg::LibsInfoDlg().
double Digikam::KMemoryInfo::kilobytes | ( | MemoryDetails | detail | ) | const |
References bytes().
QDateTime Digikam::KMemoryInfo::lastUpdate | ( | ) | const |
Returns the timestamp of the last update, or a null one if the current memory information was never updated.
double Digikam::KMemoryInfo::megabytes | ( | MemoryDetails | detail | ) | const |
References bytes().
KMemoryInfo & Digikam::KMemoryInfo::operator= | ( | const KMemoryInfo & | info | ) |
int Digikam::KMemoryInfo::update | ( | ) |
Request an update of the system memory.
Referenced by currentInfo().