Author: dpage
Date: 2005-10-14 14:06:59 +0100 (Fri, 14 Oct 2005)
New Revision: 4544

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/utils/sysSettings.cpp
Log:
Use a sensible default location for the logfile (v2.0 :-) )

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt        2005-10-14 12:57:03 UTC (rev 4543)
+++ trunk/pgadmin3/CHANGELOG.txt        2005-10-14 13:06:59 UTC (rev 4544)
@@ -17,6 +17,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-10-14 DP  1.4B3 Use a sensible default location for the logfile
     <li>2005-10-12 AP  1.4B3 Fix count crash on tables (r: Merlin Moncure)
     <li>2005-10-12 AP  1.4B3 Fix slony detection on tables for pgsql7.x
     <li>2005-10-08 AP  1.4B2 Fix "New" context menu crash on disconnected 
server (r: Tomasz Rybak)

Modified: trunk/pgadmin3/src/utils/sysSettings.cpp
===================================================================
--- trunk/pgadmin3/src/utils/sysSettings.cpp    2005-10-14 12:57:03 UTC (rev 
4543)
+++ trunk/pgadmin3/src/utils/sysSettings.cpp    2005-10-14 13:06:59 UTC (rev 
4544)
@@ -38,19 +38,30 @@
 
     // Log. Try to get a vaguely usable default path.
     char *homedir;
+#ifdef __WXMSW__
+    char *homedrive;
+#endif
+
     wxString deflog;
     
-    if ((homedir = getenv("HOME")) == NULL)
-        homedir = getenv("HOMEPATH");
+#ifdef __WXMSW__
+    homedrive = getenv("HOMEDRIVE");
+    homedir = getenv("HOMEPATH");
+#else
+    homedir = getenv("HOME");
+#endif
 
     if (!homedir)
         deflog = wxT("pgadmin.log");
     else 
     {
-        deflog = wxString::FromAscii(homedir);
+        
 #ifdef __WXMSW__
+        deflog = wxString::FromAscii(homedrive);
+        deflog += wxString::FromAscii(homedir);
         deflog += wxT("\\pgadmin.log");
 #else
+        deflog = wxString::FromAscii(homedir);
         deflog += wxT("/pgadmin.log");
 #endif
     }


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to