Hi Oliver:

> that's a valid point. The patch is in svn. You are cleaning up the OS X port 
> right before the end of the year, don't you?

Yes... ;-)  BTW, what does the DBus stuff do?  I didn't find anything about it 
in the docs...

And here I have an other one:  can't we use 
QDesktopServices::storageLocation(QDesktopServices::CacheLocation) to 
initialise the cache folder?  The docs 
<http://doc.qt.nokia.com/4.7-snapshot/qdesktopservices.html#StandardLocation-enum>
 say that this "Returns a directory location where user-specific non-essential 
(cached) data should be written."

I have no idea what you get on Win or Linux; on OS X the returned path is 
"/Users/<user name>/Library/Caches/QLandkarteGT/QLandkarteGT" (as both the 
application and the organisation name are set to "QLandkarteGT") which is the 
"usual" place a OS X user would expect (actually *including* the space in 
"QLandkarte GT", but that would be nitpicking...).  The advantage is that if 
the user has an encrypted home folder (FileVault), the cache will also be 
protected.

Maybe it is possible to drop the conditional compilation for Win if a 
"reasonable" value is returned.  As the value is configurable through the GUI, 
I also think checking the environment variable might be dropped.

The trivial patch is included below.

Cheers, Albrecht.

Index: src/CResources.cpp
===================================================================
--- src/CResources.cpp  (Revision 3147)
+++ src/CResources.cpp  (Arbeitskopie)
@@ -178,12 +178,12 @@
     }
     else
     {
-        struct passwd * userInfo = getpwuid(getuid());
-        cacheFolder = QDir::tempPath() + "/qlandkarteqt-" + userInfo->pw_name 
+ "/cache/";
+       cacheFolder = 
QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
     }
 #else
     cacheFolder = m_pathMapCache.absolutePath();
 #endif
+    qDebug() << "default cache folder:" << cacheFolder;
 
     m_pathMapCache = QDir(cfg.value("network/mapcache/path", 
cacheFolder).toString());
     m_sizeMapCache = cfg.value("network/mapcache/size", 
m_sizeMapCache).toInt();

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to