~ubuntu-branches/ubuntu/quantal/gwenview/quantal-proposed

« back to all changes in this revision

Viewing changes to lib/memoryutils.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-06-11 22:01:17 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120611220117-d5bohpvq9roevjyh
Tags: upstream-4.8.90
ImportĀ upstreamĀ versionĀ 4.8.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    while (true) {
64
64
        QString entry = readStream.readLine();
65
65
        if (entry.isNull()) break;
66
 
        if (entry.startsWith("MemTotal:"))
 
66
        if (entry.startsWith(QLatin1String("MemTotal:")))
67
67
            return (cachedValue = (Q_UINT64_C(1024) * entry.section(' ', -2, -2).toULongLong()));
68
68
    }
69
69
#elif defined(Q_OS_FREEBSD)
104
104
    while (true) {
105
105
        entry = readStream.readLine();
106
106
        if (entry.isNull()) break;
107
 
        if (entry.startsWith("MemFree:") ||
108
 
                entry.startsWith("Buffers:") ||
109
 
                entry.startsWith("Cached:") ||
110
 
                entry.startsWith("SwapFree:"))
 
107
        if (entry.startsWith(QLatin1String("MemFree:")) ||
 
108
                entry.startsWith(QLatin1String("Buffers:")) ||
 
109
                entry.startsWith(QLatin1String("Cached:")) ||
 
110
                entry.startsWith(QLatin1String("SwapFree:")))
111
111
            memoryFree += entry.section(' ', -2, -2).toULongLong();
112
 
        if (entry.startsWith("SwapTotal:"))
 
112
        if (entry.startsWith(QLatin1String("SwapTotal:")))
113
113
            memoryFree -= entry.section(' ', -2, -2).toULongLong();
114
114
    }
115
115
    memFile.close();