diff options
Diffstat (limited to 'desktop/gui_factory.c')
-rw-r--r-- | desktop/gui_factory.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index ecedf417b..8e3ce178d 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -19,6 +19,7 @@ #include "content/hlcache.h" #include "desktop/download.h" #include "desktop/gui_factory.h" +#include "utils/file.h" /** The global GUI interface table */ struct gui_table *guit = NULL; @@ -418,12 +419,6 @@ static nserror verify_fetch_register(struct gui_fetch_table *gft) } /* check the mandantory fields are set */ - if (gft->filename_from_path == NULL) { - return NSERROR_BAD_PARAMETER; - } - if (gft->path_add_part == NULL) { - return NSERROR_BAD_PARAMETER; - } if (gft->filetype == NULL) { return NSERROR_BAD_PARAMETER; } @@ -446,6 +441,25 @@ static nserror verify_fetch_register(struct gui_fetch_table *gft) return NSERROR_OK; } +/** verify file table is valid */ +static nserror verify_file_register(struct gui_file_table *gft) +{ + /* check table is present */ + if (gft == NULL) { + return NSERROR_BAD_PARAMETER; + } + + /* check the mandantory fields are set */ + if (gft->mkpath == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (gft->basename == NULL) { + return NSERROR_BAD_PARAMETER; + } + + return NSERROR_OK; +} + static void gui_default_quit(void) { } @@ -559,6 +573,15 @@ nserror gui_factory_register(struct gui_table *gt) return err; } + /* file table */ + if (gt->file == NULL) { + gt->file = default_file_table; + } + err = verify_file_register(gt->file); + if (err != NSERROR_OK) { + return err; + } + /* download table */ if (gt->download == NULL) { /* set default download table */ |