logo       

SVN Commit by andreas: r4737 - in trunk/pgadmin3: . src/include src/utils: msg#00236

Subject: SVN Commit by andreas: r4737 - in trunk/pgadmin3: . src/include src/utils
Author: andreas
Date: 2005-11-11 17:42:42 +0000 (Fri, 11 Nov 2005)
New Revision: 4737

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/include/sysSettings.h
   trunk/pgadmin3/src/utils/sysSettings.cpp
Log:
leave pre-1.5 server config settings untouched

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt        2005-11-11 09:35:19 UTC (rev 4736)
+++ trunk/pgadmin3/CHANGELOG.txt        2005-11-11 17:42:42 UTC (rev 4737)
@@ -17,6 +17,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-11-11 AP         leave pre-1.5 server config settings untouched
     <li>2005-11-10 AP         Configurable indent in ctlSqlBox
     <li>2005-11-10 AP  1.4.1  Fix role rename (r: Antonio)
     <li>2005-11-09 AP         database and schema display restriction

Modified: trunk/pgadmin3/src/include/sysSettings.h
===================================================================
--- trunk/pgadmin3/src/include/sysSettings.h    2005-11-11 09:35:19 UTC (rev 
4736)
+++ trunk/pgadmin3/src/include/sysSettings.h    2005-11-11 17:42:42 UTC (rev 
4737)
@@ -151,8 +151,8 @@
 
 private:
 
-    void moveStringValue(wxChar *oldKey, wxChar *newKey, int index=-1);
-    void moveLongValue(wxChar *oldKey, wxChar *newKey, int index=-1);
+    bool moveStringValue(wxChar *oldKey, wxChar *newKey, int index=-1);
+    bool moveLongValue(wxChar *oldKey, wxChar *newKey, int index=-1);
 
     wxFont systemFont, sqlFont; 
 

Modified: trunk/pgadmin3/src/utils/sysSettings.cpp
===================================================================
--- trunk/pgadmin3/src/utils/sysSettings.cpp    2005-11-11 09:35:19 UTC (rev 
4736)
+++ trunk/pgadmin3/src/utils/sysSettings.cpp    2005-11-11 17:42:42 UTC (rev 
4737)
@@ -58,17 +58,18 @@
     Read(wxT("Servers/Count"), &serverCount, 0L);
     for (i=1 ; i <= serverCount ; i++)
     {
-        moveStringValue(wxT("Servers/Database%d"), wxT("Servers/%d/Database"), 
i);
-        moveStringValue(wxT("Servers/Description%d"), 
wxT("Servers/%d/Description"), i);
-        moveStringValue(wxT("Servers/LastDatabase%d"), 
wxT("Servers/%d/LastDatabase"), i);
-        moveStringValue(wxT("Servers/LastSchema%d"), 
wxT("Servers/%d/LastSchema"), i);
-        moveStringValue(wxT("Servers/Server%d"), wxT("Servers/%d/Server"), i);
-        moveStringValue(wxT("Servers/ServiceId%d"), 
wxT("Servers/%d/ServiceId"), i);
-        moveStringValue(wxT("Servers/StorePWD%d"), wxT("Servers/%d/StorePWD"), 
i);
-        moveStringValue(wxT("Servers/Username%d"), wxT("Servers/%d/Username"), 
i);
-        moveLongValue(wxT("Servers/Port%d"), wxT("Servers/%d/Port"), i);
-        moveLongValue(wxT("Servers/SSL%d"), wxT("Servers/%d/SSL"), i);
-        moveLongValue(wxT("Servers/LastSSL%d"), wxT("Servers/%d/LastSSL"), i);
+        if (moveStringValue(wxT("Servers/Database%d"), 
wxT("Servers/%d/Database"), i))
+        {
+            moveStringValue(wxT("Servers/Description%d"), 
wxT("Servers/%d/Description"), i);
+            moveStringValue(wxT("Servers/LastDatabase%d"), 
wxT("Servers/%d/LastDatabase"), i);
+            moveStringValue(wxT("Servers/LastSchema%d"), 
wxT("Servers/%d/LastSchema"), i);
+            moveStringValue(wxT("Servers/Server%d"), wxT("Servers/%d/Server"), 
i);
+            moveStringValue(wxT("Servers/ServiceId%d"), 
wxT("Servers/%d/ServiceId"), i);
+            moveStringValue(wxT("Servers/StorePWD%d"), 
wxT("Servers/%d/StorePWD"), i);
+            moveStringValue(wxT("Servers/Username%d"), 
wxT("Servers/%d/Username"), i);
+            moveLongValue(wxT("Servers/Port%d"), wxT("Servers/%d/Port"), i);
+            moveLongValue(wxT("Servers/SSL%d"), wxT("Servers/%d/SSL"), i);
+        }
     }
 
         
@@ -207,7 +208,7 @@
 }
 
 
-void sysSettings::moveStringValue(wxChar *oldKey, wxChar *newKey, int index)
+bool sysSettings::moveStringValue(wxChar *oldKey, wxChar *newKey, int index)
 {
     wxString k1, k2;
     if (index >= 0)
@@ -221,18 +222,21 @@
         k2=newKey;
     }
 
-    if (Exists(k1))
+    if (!Exists(k2) && Exists(k1))
     {
         wxString value;
         Read(k1, &value, wxEmptyString);
         Write(k2, value);
-        DeleteEntry(k1);
+
+        return true;
     }
+
+    return false;
 }
 
 
 
-void sysSettings::moveLongValue(wxChar *oldKey, wxChar *newKey, int index)
+bool sysSettings::moveLongValue(wxChar *oldKey, wxChar *newKey, int index)
 {
     wxString k1, k2;
     if (index >= 0)
@@ -246,13 +250,16 @@
         k2=newKey;
     }
 
-    if (Exists(k1))
+    if (!Exists(k2) && Exists(k1))
     {
         long value;
         Read(k1, &value, 0L);
         Write(k2, value);
-        DeleteEntry(k1);
+
+        return true;
     }
+
+    return false;
 }
 
 void sysSettings::Save()


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe