Skip site navigation (1) Skip section navigation (2)

SVN Commit by dpage: r4543 - in trunk/pgadmin3: pkg/mac src/utils

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4543 - in trunk/pgadmin3: pkg/mac src/utils
Date: 2005-10-14 12:57:03
Message-ID: 200510141257.j9ECv3EX028469@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgadmin-hackers
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;


pgadmin-hackers by date

Next:From: svnDate: 2005-10-14 13:06:59
Subject: SVN Commit by dpage: r4544 - in trunk/pgadmin3: . src/utils
Previous:From: Dave PageDate: 2005-10-14 12:03:04
Subject: wxFFile/wxLog on OSX

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group