Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/e431e6181b2cd480fc4ec...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/e431e6181b2cd480fc4ec2f...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/e431e6181b2cd480fc4ec2fb0...
The branch, master has been updated
via e431e6181b2cd480fc4ec2fb0d7f7474470d5669 (commit)
via ad3da6c1393ea69268f545e6581af668b5f337c9 (commit)
via 06baaa9f7c037d2aa9d9c67e0b9b07724372e0f0 (commit)
from 6c726473eff8a352d51e3931356347384bd8686a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=e431e6181b2cd480fc4...
commit e431e6181b2cd480fc4ec2fb0d7f7474470d5669
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RISC OS: Init core hotlist in read-only mode for external hotlist.
Note, the core hotlist is initialised in either normal or read-only
modes. This is done once on application startup. Toggling the
external hotlist option at runtime may cause loss of hotlist changes
made during the session.
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index f84e084..d3ce31c 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -1186,7 +1186,9 @@ static nserror gui_init(int argc, char** argv)
urldb_load(nsoption_charp(url_path));
urldb_load_cookies(nsoption_charp(cookie_file));
hotlist_init(nsoption_charp(hotlist_path),
- nsoption_charp(hotlist_save));
+ nsoption_bool(external_hotlists) ?
+ NULL :
+ nsoption_charp(hotlist_save));
/* Initialise with the wimp */
error = xwimp_initialise(wimp_VERSION_RO38, task_name,
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=ad3da6c1393ea69268f...
commit ad3da6c1393ea69268f545e6581af668b5f337c9
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Core hotlist: Improve hotlist_init documentation.
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index a16b3e8..571f4de 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -40,8 +40,11 @@ struct rect;
* be called before URLs can be added to the hotlist, and before the
* hotlist can be queried to ask if URLs are present in the hotlist.
*
+ * In read-only mode the hotlist can be modified, but changes will not
+ * persist over sessions.
+ *
* \param load_path The path to load hotlist from.
- * \param save_path The path to save hotlist to, or NULL for read-only.
+ * \param save_path The path to save hotlist to, or NULL for read-only mode.
* \return NSERROR_OK on success, appropriate error otherwise
*/
nserror hotlist_init(
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=06baaa9f7c037d2aa9d...
commit 06baaa9f7c037d2aa9d9c67e0b9b07724372e0f0
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Core hotlist: A NULL save_path makes the hotlist read-only.
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 3e2fced..0f5be77 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -107,7 +107,7 @@ static nserror hotlist_get_temp_path(const char *path, char
**temp_path)
/* Save the hotlist to to a file at the given path
*
- * \param path Path to save hostlist file to.
+ * \param path Path to save hotlist file to. NULL path is a no-op.
* \return NSERROR_OK on success, or appropriate error otherwise
*/
static nserror hotlist_save(const char *path)
@@ -115,6 +115,11 @@ static nserror hotlist_save(const char *path)
nserror res = NSERROR_OK;
char *temp_path;
+ /* NULL path is a no-op. */
+ if (path == NULL) {
+ return NSERROR_OK;
+ }
+
/* Get path to export to */
res = hotlist_get_temp_path(path, &temp_path);
if (res != NSERROR_OK) {
@@ -163,7 +168,7 @@ static void hotlist_schedule_save_cb(void *p)
*/
static nserror hotlist_schedule_save(void)
{
- if (hl_ctx.save_scheduled == false) {
+ if (hl_ctx.save_scheduled == false && hl_ctx.save_path != NULL) {
nserror err = guit->misc->schedule(10 * 1000,
hotlist_schedule_save_cb, NULL);
if (err != NSERROR_OK) {
@@ -1285,9 +1290,13 @@ nserror hotlist_init(
hl_ctx.default_folder = NULL;
/* Store the save path */
- hl_ctx.save_path = strdup(save_path);
- if (hl_ctx.save_path == NULL) {
- return NSERROR_NOMEM;
+ if (save_path != NULL) {
+ hl_ctx.save_path = strdup(save_path);
+ if (hl_ctx.save_path == NULL) {
+ return NSERROR_NOMEM;
+ }
+ } else {
+ hl_ctx.save_path = NULL;
}
/* Init. hotlist treeview entry fields */
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index e38eac1..a16b3e8 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -41,7 +41,7 @@ struct rect;
* hotlist can be queried to ask if URLs are present in the hotlist.
*
* \param load_path The path to load hotlist from.
- * \param save_path The path to save hotlist to.
+ * \param save_path The path to save hotlist to, or NULL for read-only.
* \return NSERROR_OK on success, appropriate error otherwise
*/
nserror hotlist_init(
-----------------------------------------------------------------------
Summary of changes:
desktop/hotlist.c | 19 ++++++++++++++-----
desktop/hotlist.h | 5 ++++-
frontends/riscos/gui.c | 4 +++-
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/desktop/hotlist.c b/desktop/hotlist.c
index 3e2fced..0f5be77 100644
--- a/desktop/hotlist.c
+++ b/desktop/hotlist.c
@@ -107,7 +107,7 @@ static nserror hotlist_get_temp_path(const char *path, char
**temp_path)
/* Save the hotlist to to a file at the given path
*
- * \param path Path to save hostlist file to.
+ * \param path Path to save hotlist file to. NULL path is a no-op.
* \return NSERROR_OK on success, or appropriate error otherwise
*/
static nserror hotlist_save(const char *path)
@@ -115,6 +115,11 @@ static nserror hotlist_save(const char *path)
nserror res = NSERROR_OK;
char *temp_path;
+ /* NULL path is a no-op. */
+ if (path == NULL) {
+ return NSERROR_OK;
+ }
+
/* Get path to export to */
res = hotlist_get_temp_path(path, &temp_path);
if (res != NSERROR_OK) {
@@ -163,7 +168,7 @@ static void hotlist_schedule_save_cb(void *p)
*/
static nserror hotlist_schedule_save(void)
{
- if (hl_ctx.save_scheduled == false) {
+ if (hl_ctx.save_scheduled == false && hl_ctx.save_path != NULL) {
nserror err = guit->misc->schedule(10 * 1000,
hotlist_schedule_save_cb, NULL);
if (err != NSERROR_OK) {
@@ -1285,9 +1290,13 @@ nserror hotlist_init(
hl_ctx.default_folder = NULL;
/* Store the save path */
- hl_ctx.save_path = strdup(save_path);
- if (hl_ctx.save_path == NULL) {
- return NSERROR_NOMEM;
+ if (save_path != NULL) {
+ hl_ctx.save_path = strdup(save_path);
+ if (hl_ctx.save_path == NULL) {
+ return NSERROR_NOMEM;
+ }
+ } else {
+ hl_ctx.save_path = NULL;
}
/* Init. hotlist treeview entry fields */
diff --git a/desktop/hotlist.h b/desktop/hotlist.h
index e38eac1..571f4de 100644
--- a/desktop/hotlist.h
+++ b/desktop/hotlist.h
@@ -40,8 +40,11 @@ struct rect;
* be called before URLs can be added to the hotlist, and before the
* hotlist can be queried to ask if URLs are present in the hotlist.
*
+ * In read-only mode the hotlist can be modified, but changes will not
+ * persist over sessions.
+ *
* \param load_path The path to load hotlist from.
- * \param save_path The path to save hotlist to.
+ * \param save_path The path to save hotlist to, or NULL for read-only mode.
* \return NSERROR_OK on success, appropriate error otherwise
*/
nserror hotlist_init(
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
index f84e084..d3ce31c 100644
--- a/frontends/riscos/gui.c
+++ b/frontends/riscos/gui.c
@@ -1186,7 +1186,9 @@ static nserror gui_init(int argc, char** argv)
urldb_load(nsoption_charp(url_path));
urldb_load_cookies(nsoption_charp(cookie_file));
hotlist_init(nsoption_charp(hotlist_path),
- nsoption_charp(hotlist_save));
+ nsoption_bool(external_hotlists) ?
+ NULL :
+ nsoption_charp(hotlist_save));
/* Initialise with the wimp */
error = xwimp_initialise(wimp_VERSION_RO38, task_name,
--
NetSurf Browser