Author: dpage
Date: 2005-10-14 13:57:03 +0100 (Fri, 14 Oct 2005)
New Revision: 4543

Modified:
   trunk/pgadmin3/pkg/mac/complete-bundle.sh
   trunk/pgadmin3/src/utils/sysSettings.cpp
Log:
Get a sensible default value for the log file to try to avoid defaulting to 
read-only directorys. Like the root dir.


Modified: trunk/pgadmin3/pkg/mac/complete-bundle.sh
===================================================================
--- trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-10-14 12:53:07 UTC (rev 
4542)
+++ trunk/pgadmin3/pkg/mac/complete-bundle.sh   2005-10-14 12:57:03 UTC (rev 
4543)
@@ -15,6 +15,8 @@
        xargs file | \
        sed -n 's/^\([^:][^:]*\):[[:space:]]*Mach-O executable ppc$/\1/p' \
 )
+todo=../src/pgadmin3
+
 echo "Found executables: $todo"
 while test "$todo" != ""; do
        todo_old=$todo ;

Modified: trunk/pgadmin3/src/utils/sysSettings.cpp
===================================================================
--- trunk/pgadmin3/src/utils/sysSettings.cpp    2005-10-14 12:53:07 UTC (rev 
4542)
+++ trunk/pgadmin3/src/utils/sysSettings.cpp    2005-10-14 12:57:03 UTC (rev 
4543)
@@ -36,8 +36,26 @@
     Read(wxT("ShowTipOfTheDay"), &showTipOfTheDay, true); 
     Read(wxT("NextTipOfTheDay"), &nextTipOfTheDay, 0); 
 
-    // Log
-    Read(wxT("LogFile"), &logFile, wxT("pgadmin.log")); 
+    // Log. Try to get a vaguely usable default path.
+    char *homedir;
+    wxString deflog;
+    
+    if ((homedir = getenv("HOME")) == NULL)
+        homedir = getenv("HOMEPATH");
+
+    if (!homedir)
+        deflog = wxT("pgadmin.log");
+    else 
+    {
+        deflog = wxString::FromAscii(homedir);
+#ifdef __WXMSW__
+        deflog += wxT("\\pgadmin.log");
+#else
+        deflog += wxT("/pgadmin.log");
+#endif
+    }
+
+    Read(wxT("LogFile"), &logFile, deflog); 
     Read(wxT("LogLevel"), &logLevel, LOG_ERRORS);
     sysLogger::logFile = logFile;
     sysLogger::logLevel = logLevel;


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