public:
wxGnomeVFSLibrary();
~wxGnomeVFSLibrary();
+ bool IsOk();
private:
- bool IsOk();
bool InitializeMethods();
wxDynamicLibrary m_libGnomeVFS;
public:
wxDL_METHOD_DEFINE( gboolean, gnome_vfs_init,
(), (), FALSE )
- wxDL_METHOD_DEFINE( void, gnome_vfs_shutdown,
- (), (), /**/ )
+ wxDL_VOIDMETHOD_DEFINE( gnome_vfs_shutdown,
+ (), () )
wxDL_METHOD_DEFINE( GnomeVFSResult, gnome_vfs_mime_set_icon,
(const char *mime_type, const char *filename), (mime_type, filename), GNOME_VFS_OK )
wxGnomeVFSLibrary::~wxGnomeVFSLibrary()
{
+ // we crash on exit later (i.e. after main() finishes) if we unload this
+ // library, apparently it inserts some hooks in other libraries to which we
+ // link implicitly (GTK+ itself?) which are not uninstalled when it's
+ // unloaded resulting in this crash, so just leave it in memory -- it's a
+ // lesser evil
+ m_libGnomeVFS.Detach();
}
bool wxGnomeVFSLibrary::IsOk()
bool wxGnomeVFSLibrary::InitializeMethods()
{
- wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_init )
- wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_shutdown )
+ wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_init );
+ wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_shutdown );
return true;
}
const wxArrayString& strExtensions,
const wxString& strDesc)
{
- int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true);
-
- if ( nIndex == wxNOT_FOUND )
- return false;
-
- if (m_mailcapStylesInited & wxMAILCAP_GNOME)
- {
- // User modificationt to the MIME database
- // are not supported :-)
- }
-
- return false;
+ return AddToMimeData
+ (
+ strType,
+ strIcon,
+ entry,
+ strExtensions,
+ strDesc,
+ true
+ ) != wxNOT_FOUND;
}
//----------------------------------------------------------------------------