Hi all,

attached is a patch against the current svn which addresses the following 
issues in Mac OS X:

(1) fix a crash in the Qt font rendering code on 10.6.x (src/CResources.cpp)
There have been strange crashes on /some/ boxes running Mac OS X 10.6.x in the Qt font rendering 
code, typically when QLGT is run for the very first time.  They are usually caused by broken fonts, 
but removing them doesn't help in all cases.  Apparently, the issue is fixed when the Mac default 
"Lucida Grande" is used instead of "Arial" for the map font.  Thanks a lot to 
Renaud de Rosa for testing this work-around as I don't have a 10.6 box...

(2) cosmetics: store path for downloaded WMS map descriptions 
(src/CDlgLoadOnlineMap.cpp)
On the Mac, these files are usually stored in the user's "Library/Application 
Support/QLandkarte GT" folder, instead of creating a new folder in the home path.

Opinions?

Oliver, if you don't mind, I'll build the Mac bundles for 1.5.0 from svn 3416 + 
these patches.

Cheers,
Albrecht.
Index: src/CResources.cpp
===================================================================
--- src/CResources.cpp	(Revision 3416)
+++ src/CResources.cpp	(Arbeitskopie)
@@ -81,7 +81,12 @@ CResources::CResources(QObject * parent)
 
     SETTINGS;
 
+#ifndef Q_WS_MAC
     QString family      = cfg.value("environment/mapfont/family","Arial").toString();
+#else
+    // Qt on Mac OS X 10.6 sometimes fails to render, so use the Mac default font here...
+    QString family      = cfg.value("environment/mapfont/family","Lucida Grande").toString();
+#endif
     int size            = cfg.value("environment/mapfont/size",8).toInt();
     bool bold           = cfg.value("environment/mapfont/bold",false).toBool();
     bool italic         = cfg.value("environment/mapfont/italic",false).toBool();
Index: src/CDlgLoadOnlineMap.cpp
===================================================================
--- src/CDlgLoadOnlineMap.cpp	(Revision 3416)
+++ src/CDlgLoadOnlineMap.cpp	(Arbeitskopie)
@@ -26,7 +26,10 @@
 #ifndef WIN32
 #include <unistd.h>
 #include <pwd.h>
+#ifdef Q_WS_MAC
+#include "config.h"
 #endif
+#endif
 
 const QString CDlgLoadOnlineMap::text =  QObject::tr(""
 "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'  'http://www.w3.org/TR/html4/loose.dtd'>"
@@ -60,8 +63,12 @@ CDlgLoadOnlineMap::CDlgLoadOnlineMap()
     }
     else
     {
+#ifndef Q_WS_MAC
         struct passwd * userInfo = getpwuid(getuid());
         tempDir = QDir::homePath() + "/qlandkartegt-" + userInfo->pw_name + "/maps/";
+#else
+	tempDir = QDir::home().filePath(CONFIGDIR) + "/Maps/";
+#endif
     }
 #else
     tempDir = QDir::homePath() + "/qlandkarteqt/cache/";

Attachment: pgpKJxga41WS9.pgp
Description: PGP signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to