Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Tue, 01 Aug 2023 21:08:41 UTC Commit: b1ba03c3edc70677df578ee7282456e38f965af5 https://github.com/geany/geany-plugins/commit/b1ba03c3edc70677df578ee7282456...
Log Message: ----------- Use DOC_VALID macro across the Addons plugin
Modified Paths: -------------- addons/src/addons.c addons/src/ao_tasks.c
Modified: addons/src/addons.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -137,15 +137,15 @@ static gboolean ao_editor_notify_cb(GObject *object, GeanyEditor *editor, static void ao_update_editor_menu_cb(GObject *obj, const gchar *word, gint pos, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_open_uri_update_menu(ao_info->openuri, doc, pos); }
static void ao_document_activate_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_bookmark_list_update(ao_info->bookmarklist, doc); ao_tasks_update_single(ao_info->tasks, doc); @@ -154,7 +154,7 @@ static void ao_document_activate_cb(GObject *obj, GeanyDocument *doc, gpointer d
static void ao_document_new_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_mark_document_new(ao_info->markword, doc); ao_color_tip_document_new(ao_info->colortip, doc); @@ -163,7 +163,7 @@ static void ao_document_new_cb(GObject *obj, GeanyDocument *doc, gpointer data)
static void ao_document_open_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_tasks_update(ao_info->tasks, doc); ao_mark_document_open(ao_info->markword, doc); @@ -173,7 +173,7 @@ static void ao_document_open_cb(GObject *obj, GeanyDocument *doc, gpointer data)
static void ao_document_close_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_tasks_remove(ao_info->tasks, doc); ao_mark_document_close(ao_info->markword, doc); @@ -183,23 +183,23 @@ static void ao_document_close_cb(GObject *obj, GeanyDocument *doc, gpointer data
static void ao_document_save_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_tasks_update(ao_info->tasks, doc); }
static void ao_document_before_save_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_blanklines_on_document_before_save(obj, doc, data); }
static void ao_document_reload_cb(GObject *obj, GeanyDocument *doc, gpointer data) { - g_return_if_fail(doc != NULL && doc->is_valid); + g_return_if_fail(DOC_VALID(doc));
ao_tasks_update(ao_info->tasks, doc); }
Modified: addons/src/ao_tasks.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -580,7 +580,7 @@ static gboolean update_tasks_for_doc_idle_cb(gpointer data) priv = AO_TASKS_GET_PRIVATE(arguments->t); doc = arguments->doc;
- if (doc->is_valid && priv->active && priv->enable_tasks) + if (DOC_VALID(doc) && priv->active && priv->enable_tasks) { if (arguments->clear) ao_tasks_remove(arguments->t, doc); @@ -641,7 +641,7 @@ static void update_tasks_for_doc(AoTasks *t, GeanyDocument *doc, gboolean clear) arguments->doc = doc; arguments->clear = clear;
- if (!doc->is_valid) + if (!DOC_VALID(doc)) return;
/* Check for task tokens in an idle callback to wait until Geany applied Scintilla highlighting
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org