From 27e703f878844da8f4099a28bfdb9fbbe737b65f Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 4 Oct 2008 19:31:36 +0000 Subject: [PATCH] always deal with memory measures as ulonglong, this way systems with >4 GB of memory work for real now svn path=/trunk/KDE/kdegraphics/okular/; revision=867871 --- core/document.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/document.cpp b/core/document.cpp index 40e8ff8d3..877896460 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -228,7 +228,7 @@ qulonglong DocumentPrivate::getTotalMemory() QString entry = readStream.readLine(); if ( entry.isNull() ) break; if ( entry.startsWith( "MemTotal:" ) ) - return (cachedValue = (1024 * entry.section( ' ', -2, -2 ).toInt())); + return (cachedValue = (Q_UINT64_C(1024) * entry.section( ' ', -2, -2 ).toULongLong())); } #elif defined(Q_OS_WIN) MEMORYSTATUSEX stat; @@ -267,15 +267,15 @@ qulonglong DocumentPrivate::getFreeMemory() entry.startsWith( "Buffers:" ) || entry.startsWith( "Cached:" ) || entry.startsWith( "SwapFree:" ) ) - memoryFree += entry.section( ' ', -2, -2 ).toInt(); + memoryFree += entry.section( ' ', -2, -2 ).toULongLong(); if ( entry.startsWith( "SwapTotal:" ) ) - memoryFree -= entry.section( ' ', -2, -2 ).toInt(); + memoryFree -= entry.section( ' ', -2, -2 ).toULongLong(); } memFile.close(); lastUpdate = QTime::currentTime(); - return ( cachedValue = (1024 * memoryFree) ); + return ( cachedValue = (Q_UINT64_C(1024) * memoryFree) ); #elif defined(Q_OS_WIN) MEMORYSTATUSEX stat;