extra: make the api pass a Extra_Theme

this makes the whole thing a bit nicer to read and better to use.
This commit is contained in:
Marcel Hollerbach 2017-01-09 16:07:19 +01:00
parent 10cb30eb41
commit d286cde3bd
3 changed files with 3 additions and 13 deletions

View File

@ -246,9 +246,6 @@ _extra_win_install_execute()
{
Evas_Object *progress;
_install_progress.id = _selected_theme->id;
_install_progress.is_theme = EINA_TRUE;
_install_progress.progress_cb = _extra_win_download_progress_cb;
_install_progress.done_cb = _extra_win_download_done_cb;
@ -262,7 +259,7 @@ _extra_win_install_execute()
elm_object_content_set(_popup, progress);
evas_object_show(_popup);
extra_theme_download(&_install_progress);
extra_theme_download(&_install_progress, _selected_theme);
}
static void

View File

@ -341,14 +341,10 @@ _download_progress_cb(void *data EINA_UNUSED, const char *file EINA_UNUSED,
}
EAPI void
extra_theme_download(Extra_Progress *progress)
extra_theme_download(Extra_Progress *progress, Extra_Theme *theme)
{
Extra_Theme *theme = NULL;
char *path, *urlstr = NULL;
if (progress->is_theme)
theme = extra_theme_get(progress->id);
if (theme)
{
urlstr = extra_theme_download_url_get(theme);

View File

@ -49,9 +49,6 @@ typedef struct _Extra_Theme
typedef struct _Extra_Progress
{
const char *id;
Eina_Bool is_theme;
void (*progress_cb)(double progress);
void (*done_cb)(void);
} Extra_Progress;
@ -150,7 +147,7 @@ EAPI char *extra_theme_download_url_get(Extra_Theme *theme);
*
* @ingroup Themes
*/
EAPI void extra_theme_download(Extra_Progress *progress);
EAPI void extra_theme_download(Extra_Progress *progress, Extra_Theme *theme);
/**
* @brief Set the theme as default and restart e