]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileconf.cpp
typo in last commit
[wxWidgets.git] / src / common / fileconf.cpp
index 670fa59a51f855373c39f2a47164f6d076aab6be..ef5c6c6d137540b6fc253bc5ca9b0c60c367a3c2 100644 (file)
@@ -7,7 +7,7 @@
 // RCS-ID:      $Id$
 // Copyright:   (c) 1997 Karsten Ballüder   &  Vadim Zeitlin
 //                       Ballueder@usa.net     <zeitlin@dptmaths.ens-cachan.fr>
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -997,19 +997,23 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
   bool ret = file.Commit();
 
 #if defined(__WXMAC__)
-  if ( ret )
-  {
-       FSSpec spec ;
-
-       wxMacFilename2FSSpec( m_strLocalFile , &spec ) ;
-       FInfo finfo ;
-       if ( FSpGetFInfo( &spec , &finfo ) == noErr )
-       {
-               finfo.fdType = 'TEXT' ;
-               finfo.fdCreator = 'ttxt' ;
-               FSpSetFInfo( &spec , &finfo ) ;
-       }
-  }
+    if ( ret )
+    {
+        FSRef fsRef ;
+        FSCatalogInfo catInfo;
+           FileInfo *finfo ;
+       
+           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 ) ;
+           }
+           }
+    }
 #endif // __WXMAC__
 
 #ifdef __UNIX__