Create helper for opening URLs
This commit is contained in:
parent
498049cba1
commit
f1d55e70e8
|
@ -909,6 +909,21 @@ edi_close()
|
|||
elm_exit();
|
||||
}
|
||||
|
||||
void
|
||||
edi_open_url(const char *url)
|
||||
{
|
||||
const char *format;
|
||||
char *cmd;
|
||||
|
||||
format = "xdg-open \"%s\"";
|
||||
|
||||
cmd = malloc(sizeof(char) * (strlen(format) + strlen(url) - 1));
|
||||
sprintf(cmd, format, url);
|
||||
ecore_exe_run(cmd, NULL);
|
||||
|
||||
free(cmd);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_edi_log_init()
|
||||
{
|
||||
|
|
|
@ -33,6 +33,8 @@ Evas_Object *edi_open(const char *path);
|
|||
|
||||
void edi_close();
|
||||
|
||||
void edi_open_url();
|
||||
|
||||
// TODO remove this once our filepanel is updating gracefully
|
||||
void _edi_filepanel_reload();
|
||||
|
||||
|
|
|
@ -16,17 +16,7 @@ _edi_about_exit(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
|
|||
static void
|
||||
_edi_about_url_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
const char *url, *format;
|
||||
char *cmd;
|
||||
|
||||
url = (const char *)data;
|
||||
format = "xdg-open \"%s\"";
|
||||
|
||||
cmd = malloc(sizeof(char) * (strlen(format) + strlen(url) - 1));
|
||||
sprintf(cmd, format, url);
|
||||
ecore_exe_run(cmd, NULL);
|
||||
|
||||
free(cmd);
|
||||
edi_open_url((const char *)data);
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
|
|
Loading…
Reference in New Issue