]> git.saurik.com Git - wxWidgets.git/commitdiff
don't overwrite the existing local file if we failed to open it but it does exist
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 26 Aug 2007 20:40:33 +0000 (20:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 26 Aug 2007 20:40:33 +0000 (20:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fileconf.cpp

index 635c18a6ac516a417561b8fca372ebe23e780744..07da5e6ff2874f585bee22af703840078c4ff936 100644 (file)
@@ -372,7 +372,16 @@ void wxFileConfig::Init()
         }
         else
         {
-            wxLogWarning(_("can't open user configuration file '%s'."),  m_fnLocalFile.GetFullPath().c_str() );
+            const wxString path = m_fnLocalFile.GetFullPath();
+            wxLogWarning(_("can't open user configuration file '%s'."),
+                         path.c_str());
+
+            if ( m_fnLocalFile.FileExists() )
+            {
+                wxLogWarning(_("Changes won't be saved to avoid overwriting the existing file \"%s\""),
+                             path.c_str());
+                m_fnLocalFile.Clear();
+            }
         }
     }