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
This commit is contained in:
@@ -983,29 +983,18 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = file.Commit();
|
if ( !file.Commit() )
|
||||||
|
{
|
||||||
|
wxLogError(_("Failed to update user configuration file."));
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
if ( ret )
|
wxFileName(m_strLocalFile).MacSetTypeAndCreator('TEXT', 'ttxt');
|
||||||
{
|
|
||||||
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__
|
#endif // __WXMAC__
|
||||||
|
|
||||||
return ret;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user