SVN Commit by dpage: r4958 - branches/REL-1_4_0_PATCHES/pgadmin3/src/frm

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4958 - branches/REL-1_4_0_PATCHES/pgadmin3/src/frm
Date: 2006-01-25 08:37:27
Message-ID: 200601250837.k0P8bRN5008235@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2006-01-25 08:37:27 +0000 (Wed, 25 Jan 2006)
New Revision: 4958

Modified:
branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmConfig.cpp
Log:
Andreas' multibyte patch from trunk: read/write config files with wxUtfFile and wxFONTENCODING_SYSTEM

Modified: branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmConfig.cpp
===================================================================
--- branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmConfig.cpp 2006-01-24 19:00:17 UTC (rev 4957)
+++ branches/REL-1_4_0_PATCHES/pgadmin3/src/frm/frmConfig.cpp 2006-01-25 08:37:27 UTC (rev 4958)
@@ -301,20 +301,18 @@

void frmConfig::OpenLastFile()
{
- wxFile file(lastPath, wxFile::read);
+ wxUtfFile file(lastPath, wxFile::read, wxFONTENCODING_SYSTEM);
if (file.IsOpened())
{
#ifdef __WXMSW__
_setmode(file.fd(), _O_BINARY);
#endif
- char *buffer=new char[file.Length()+1];
- int cnt=file.Read(buffer,file.Length());
- buffer[cnt] = 0;
+ wxString buffer;
+ file.Read(buffer);
file.Close();

- DisplayFile(wxString(buffer, wxConvLibc));
+ DisplayFile(buffer);

- delete buffer;
statusBar->SetStatusText(wxString::Format(_(" Configuration read from %s"), lastPath.c_str()));

fileMenu->Enable(MNU_SAVE, false);
@@ -373,9 +371,12 @@
}
else
{
- wxFile file(lastPath, wxFile::write);
+ wxUtfFile file(lastPath, wxFile::write, wxFONTENCODING_SYSTEM);
if (file.IsOpened())
{
+#ifdef __WXMSW__
+ _setmode(file.fd(), _O_BINARY);
+#endif
file.Write(str);
file.Close();
done=true;

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2006-01-25 09:44:42 Re: Patch: Config editors
Previous Message Susemail 2006-01-25 03:21:13 Re: Missing make files, etc