Hello!
I have written on Wednesday, 12 September, at 13:08:
>a physical file. If you want implementation details then example:
>GFile * fm_file_new_for_uri (const char *uri);
The simplest content of src/base/fm-file.c for the start may be:
-----------------------------------------------------------------------
static GHashTable *schemes = NULL;
#define FM_FILE_MODULE_MIN_VERSION 1
#define FM_FILE_MODULE_MAX_VERSION 1
static inline FmFileIface *fm_find_scheme(const char *name)
{
return (FmFileIface*)g_hash_table_lookup(schemes, name);
}
static inline void fm_add_scheme(const char *name, FmFileIface *iface)
{
if(fm_find_scheme(name) == NULL)
g_hash_table_insert(schemes, g_strdup(name), iface);
}
GFile *fm_file_new_for_uri(const char *uri)
{
char *scheme;
FmFileIface *iface;
GFile *file = NULL;
scheme = g_uri_parse_scheme(uri);
if(scheme)
{
iface = fm_find_scheme(scheme);
if(iface && iface->new_for_uri_name)
file = iface->new_for_uri_name(&uri[strlen(scheme)+1]);
g_free(scheme);
if(file)
return file;
}
return g_file_new_for_uri(uri);
}
void _fm_file_initialize(void)
{
schemes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
//fm_add_scheme("menu", _fm_scheme_menu_interface);
//fm_add_scheme("search", _fm_scheme_search_interface);
//fm_module_register_type("scheme", FM_FILE_MODULE_MIN_VERSION,
// FM_FILE_MODULE_MAX_VERSION, fm_file_add_module);
}
-----------------------------------------------------------------------
What do you think?
With best wishes.
Andriy.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pcmanfm-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pcmanfm-develop