mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 13:11:41 +00:00
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
This commit is contained in:
parent
f1f52f4124
commit
27e703f878
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue