- added locale support to MeshLab&MeshLabServer -fixed "not enough memory" bug in MeshLabServer

This commit is contained in:
Guido Ranzuglia 2017-01-09 17:51:01 +01:00
parent c5785d22b2
commit 1e2a54cee2
2 changed files with 18 additions and 5 deletions

View File

@ -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

View File

@ -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;