Bug 259671

Summary: ram values not calculated on freebsd
Product: [Applications] gwenview Reporter: Alberto Villa <avilla>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.6   
Target Milestone: ---   
Platform: FreeBSD Ports   
OS: FreeBSD   
Latest Commit: Version Fixed In:
Attachments: patch to calculate ram values on freebsd (the same as in #214818)
new patch including sys/types.h

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>
 #endif
 
 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.

CCBUG:259671

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

M  +4    -0    lib/memoryutils.cpp     

http://commits.kde.org/gwenview/e3674c35d966773e49576d679789b954c2dd9694
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
BUG:259671

Conflicts:
	lib/document/document.cpp

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     

http://commits.kde.org/gwenview/adb03a845e3598d205ec1fee8ca6aed20b11549d