summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/gui.h16
-rw-r--r--desktop/gui_factory.c6
-rw-r--r--desktop/searchweb.c2
3 files changed, 23 insertions, 1 deletions
diff --git a/desktop/gui.h b/desktop/gui.h
index 724355d10..da609b1e3 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -319,6 +319,22 @@ struct gui_fetch_table {
*/
const char *(*filetype)(const char *unix_path);
+ /**
+ * Convert a pathname to a file: URL.
+ *
+ * \param path pathname
+ * \return URL, allocated on heap, or NULL on failure
+ */
+ char *(*path_to_url)(const char *path);
+
+ /**
+ * Convert a file: URL to a pathname.
+ *
+ * \param url a file: URL
+ * \return pathname, allocated on heap, or NULL on failure
+ */
+ char *(*url_to_path)(const char *url);
+
/* Optional entries */
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index 06b5383ba..dfe775571 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -317,6 +317,12 @@ static nserror verify_fetch_register(struct gui_fetch_table *gft)
if (gft->filetype == NULL) {
return NSERROR_BAD_PARAMETER;
}
+ if (gft->path_to_url == NULL) {
+ return NSERROR_BAD_PARAMETER;
+ }
+ if (gft->url_to_path == NULL) {
+ return NSERROR_BAD_PARAMETER;
+ }
/* fill in the optional entries with defaults */
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index d42919d2d..b3f6162a6 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -236,7 +236,7 @@ void search_web_retrieve_ico(bool localdefault)
if (localdefault) {
if (search_default_ico_location == NULL)
return;
- url = path_to_url(search_default_ico_location);
+ url = guit->fetch->path_to_url(search_default_ico_location);
} else {
url = search_web_ico_name();
}