summaryrefslogtreecommitdiff
path: root/graphics/meshlab/patches/1e2a54cee2fcb2f0fc15fd83c1014e1813eb75df.patch
blob: 3d4638bdeb33b6223902e09beb5e6a8152a79c09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 1e2a54cee2fcb2f0fc15fd83c1014e1813eb75df Mon Sep 17 00:00:00 2001
From: Guido Ranzuglia <guido.ranzuglia@isti.cnr.it>
Date: Mon, 9 Jan 2017 17:51:01 +0100
Subject: [PATCH] - added locale support to MeshLab&MeshLabServer -fixed "not
 enough memory" bug in MeshLabServer

---
 src/meshlab/main.cpp             |  2 ++
 src/meshlabserver/mainserver.cpp | 21 ++++++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/meshlab/main.cpp b/src/meshlab/main.cpp
index eee69b9..068e8ab 100644
--- a/src/meshlab/main.cpp
+++ b/src/meshlab/main.cpp
@@ -24,11 +24,13 @@
 #include <QMessageBox>
 #include "mainwindow.h"
 #include <QString>
+#include <clocale>
 
 int main(int argc, char *argv[])
 {
 
     MeshLabApplication app(argc, argv);
+	std::setlocale(LC_ALL, "C");
     QLocale::setDefault(QLocale::C);
     QCoreApplication::setOrganizationName(MeshLabApplication::organization());
 #if QT_VERSION >= 0x050100
diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp
index ab9a7c0..28b86c3 100644
--- a/src/meshlabserver/mainserver.cpp
+++ b/src/meshlabserver/mainserver.cpp
@@ -29,7 +29,10 @@
 #include <common/filterscript.h>
 #include <common/meshlabdocumentxml.h>
 #include <common/mlexception.h>
+#include <common/filterparameter.h>
 #include <wrap/qt/qt_thread_safe_memory_info.h>
+#include "../meshlab/mainwindow.h"
+#include <clocale>
 
 #include <QFileInfo>
 
@@ -619,11 +622,11 @@ struct OutProject
 
 int main(int argc, char *argv[])
 {
-
-
     FILE* logfp = stdout;
     FILE* dumpfp = NULL;
     MeshLabApplication app(argc, argv);
+	std::setlocale(LC_ALL, "C");
+	QLocale::setDefault(QLocale::C);
     if(argc == 1)
     {
         commandline::usage();
@@ -645,9 +648,17 @@ int main(int argc, char *argv[])
         exit(-1);
     }
 
-	QSettings st;
-	QVariant mbvar = st.value("MeshLab::System::maxGPUMemDedicatedToGeometry");
-	std::ptrdiff_t maxgpumem = (std::ptrdiff_t)mbvar.toInt() * (float)(1024 * 1024);
+	QSettings settings(MeshLabApplication::organization(),MeshLabApplication::appArchitecturalName(MeshLabApplication::HW_64BIT));
+
+	QVariant xmlgpupar = settings.value(MainWindowSetting::maximumDedicatedGPUMem());
+
+	QDomDocument doc;
+	doc.setContent(xmlgpupar.toString(), false);
+
+	QDomElement paramelem = doc.firstChild().toElement();
+	int gpumemmb = paramelem.attribute("value").toInt();
+
+	std::ptrdiff_t maxgpumem = (std::ptrdiff_t) gpumemmb * (float)(1024 * 1024);
 	vcg::QtThreadSafeMemoryInfo gpumeminfo(maxgpumem);
 
 	MeshDocument meshDocument;