Hi,

Sending some 3 small fixes in separate emails for issues that me and my
colleagues found really annoying. This is my first try at Pgadmin and I
haven't done too much C++ though so in case something should be corrected
let me know and I'd be happy to do that.

Cheers,
Kaarel
From f5a6a227e3417d8d098f3d75dee1739ccd504c74 Mon Sep 17 00:00:00 2001
From: kmoppel <kaarel.mop...@zalando.de>
Date: Tue, 31 Dec 2013 11:48:54 +0100
Subject: [PATCH] Forcing flush of .pgadmin3 to disk in
 frmMain::StoreServers() to not to lose newly added servers
 when crashing

---
 pgadmin/frm/frmMain.cpp             |    1 +
 pgadmin/include/utils/sysSettings.h |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pgadmin/frm/frmMain.cpp b/pgadmin/frm/frmMain.cpp
index 675940a..7cefc1b 100644
--- a/pgadmin/frm/frmMain.cpp
+++ b/pgadmin/frm/frmMain.cpp
@@ -1254,6 +1254,7 @@ void frmMain::StoreServers()
 
 	// Write the server count
 	settings->WriteInt(wxT("Servers/Count"), numServers);
+        settings->Flush(false);
 	wxLogInfo(wxT("Stored %d servers."), numServers);
 }
 
diff --git a/pgadmin/include/utils/sysSettings.h b/pgadmin/include/utils/sysSettings.h
index 37bdf4d..f2aabf8 100644
--- a/pgadmin/include/utils/sysSettings.h
+++ b/pgadmin/include/utils/sysSettings.h
@@ -20,7 +20,7 @@
 #include <wx/fileconf.h>
 
 // Class declarations
-class sysSettings : private wxConfig
+class sysSettings : public wxConfig
 {
 public:
 	sysSettings(const wxString &name);
@@ -767,6 +767,10 @@ public:
 		WriteSize(key, size);
 		return true;
 	}
+	virtual bool Flush(bool bCurrentOnly)
+	{
+            return wxConfig::Flush(bCurrentOnly);
+	}
 
 	// Functions for reading settings
 	bool Read(const wxString &key, wxString *str, const wxString &defaultVal) const;
-- 
1.7.9.5

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to