Bug 259671 - ram values not calculated on freebsd
Summary: ram values not calculated on freebsd
Alias: None
Product: gwenview
Classification: Unclassified
Component: general (show other bugs)
Version: 2.6
Platform: FreeBSD Ports FreeBSD
: NOR normal (vote)
Target Milestone: ---
Assignee: Gwenview Bugs
Depends on:
Reported: 2010-12-13 02:27 UTC by Alberto Villa
Modified: 2012-10-19 13:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

patch to calculate ram values on freebsd (the same as in #214818) (1.84 KB, patch)
2010-12-13 02:27 UTC, Alberto Villa
new patch including sys/types.h (1.86 KB, patch)
2010-12-13 11:25 UTC, Alberto Villa

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Villa 2010-12-13 02:27:27 UTC
Created attachment 54479 [details]
patch to calculate ram values on freebsd (the same as in #214818)

Version:           2.6 (using KDE 4.5.85) 
OS:                FreeBSD

gwenview doesn't calculate ram values (total and free) on freebsd (the same as okular: see #214818)

Reproducible: Always

Steps to Reproduce:
when editing pictures (e.g. rotating them), even with 4 gib of ram the message "it's time to save your modifications or ram will fill" appears every 7-8 pictures
Comment 1 Alberto Villa 2010-12-13 11:25:51 UTC
Created attachment 54492 [details]
new patch including sys/types.h

here's a new patch which includes sys/types.h, as we can't rely on it being included somewhere else
Comment 2 Pino Toscano 2010-12-13 19:50:18 UTC
Aurelien copied the code from Okular, FYI.
Comment 3 Alberto Villa 2010-12-13 21:49:21 UTC
i saw that, that's why the patch is the same :)
Comment 4 Aurelien Gateau 2011-02-14 12:14:05 UTC
Hi Alberto,

I just applied synced Gwenview code from Okular, so it should be all good. Can you check and confirm it works so that I can backport to 4.6?
Comment 5 Alberto Villa 2011-02-14 12:29:06 UTC
thanks aurelien

with the patches side to side everything looks good apart from the missing includes:

@@ -32,6 +32,10 @@
 #ifdef Q_OS_WIN
 #define _WIN32_WINNT 0x0500
 #include <windows.h>
+#elif defined(Q_OS_FREEBSD)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <vm/vm_param.h>
 namespace Gwenview {
Comment 6 Aurelien Gateau 2011-02-21 10:15:15 UTC
Git commit e3674c35d966773e49576d679789b954c2dd9694 by Aur��lien G��teau.
Committed on 21/02/2011 at 10:14.
Pushed by gateau into branch 'master'.

Add missing freebsd includes

Thanks to Alberto Villa for noticing this.


@Alberto: Should be good for 4.6 backport. Can you confirm?

M  +4    -0    lib/memoryutils.cpp     

Comment 7 Alberto Villa 2011-02-21 11:45:50 UTC
it is! thanks again :)
Comment 8 Aurelien Gateau 2011-03-05 21:35:59 UTC
Git commit adb03a845e3598d205ec1fee8ca6aed20b11549d by Aur��lien G��teau.
Committed on 05/03/2011 at 21:33.
Pushed by gateau into branch 'KDE/4.6'.

Merge branch 'master' into KDE/4.6

Brings FreeBSD memory fixes


I  +19   -2    CMakeLists.txt     
I  +1    -0    lib/CMakeLists.txt     
I  +23   -21   lib/libjpeg-80/transupp.c     
I  +30   -0    lib/memoryutils.cpp     
I  +2    -0    tests/testutils.h