From 608299859db6a162b7346b39235f8bf95da90acf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Oct 2004 22:18:27 +0000 Subject: [PATCH] use wxFileName::MacSetTypeAndCreator() in Flush() instead of duplicating its code here git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fileconf.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index ac4e2a53ea..442fb4fc15 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -983,29 +983,18 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */) } } - bool ret = file.Commit(); + if ( !file.Commit() ) + { + wxLogError(_("Failed to update user configuration file.")); -#if defined(__WXMAC__) - if ( ret ) - { - FSRef fsRef ; - FSCatalogInfo catInfo; - FileInfo *finfo ; + return false; + } - if ( wxMacPathToFSRef( m_strLocalFile , &fsRef ) == noErr ) - { - if ( FSGetCatalogInfo (&fsRef, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL) == noErr ) - { - finfo = (FileInfo*)&catInfo.finderInfo; - finfo->fileType = 'TEXT' ; - finfo->fileCreator = 'ttxt' ; - FSSetCatalogInfo( &fsRef, kFSCatInfoFinderInfo, &catInfo ) ; - } - } - } +#if defined(__WXMAC__) + wxFileName(m_strLocalFile).MacSetTypeAndCreator('TEXT', 'ttxt'); #endif // __WXMAC__ - return ret; + return true; } // ---------------------------------------------------------------------------- -- 2.45.2