Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Sun, 23 Mar 2014 10:29:20 UTC Commit: 41a2971d15558bb92a94b2d6f57fffc5f80fdc00 https://github.com/geany/geany-plugins/commit/41a2971d15558bb92a94b2d6f57fff...
Log Message: ----------- Merge pull request #110 from frlan/generell/replace_NZV
Replacement of NZV-makro #2
Modified Paths: -------------- addons/src/addons.c addons/src/ao_bookmarklist.c addons/src/ao_openuri.c addons/src/ao_tasks.c addons/src/ao_xmltagging.c geanydoc/src/config.c geanydoc/src/geanydoc.c gproject/src/gproject-utils.c spellcheck/src/gui.c spellcheck/src/scplugin.c spellcheck/src/speller.c treebrowser/src/treebrowser.c
Modified: addons/src/addons.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -504,7 +504,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) _("Whether to show the tasks of all open documents in the list or only those of the current document."));
entry_tasks_tokens = gtk_entry_new(); - if (NZV(ao_info->tasks_token_list)) + if (!EMPTY(ao_info->tasks_token_list)) gtk_entry_set_text(GTK_ENTRY(entry_tasks_tokens), ao_info->tasks_token_list); ui_entry_add_clear_icon(GTK_ENTRY(entry_tasks_tokens)); ui_widget_set_tooltip_text(entry_tasks_tokens,
Modified: addons/src/ao_bookmarklist.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -178,7 +178,7 @@ static void add_line(AoBookmarkList *bm, ScintillaObject *sci, gint line_nr) AoBookmarkListPrivate *priv = AO_BOOKMARK_LIST_GET_PRIVATE(bm);
line = g_strstrip(sci_get_line(sci, line_nr)); - if (! NZV(line)) + if (EMPTY(line)) line = g_strdup(_("(Empty Line)")); tooltip = g_markup_escape_text(line, -1);
Modified: addons/src/ao_openuri.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -129,7 +129,7 @@ static void ao_menu_open_activate_cb(GtkMenuItem *item, AoOpenUri *self) { AoOpenUriPrivate *priv = AO_OPEN_URI_GET_PRIVATE(self);
- if (NZV(priv->uri)) + if (!EMPTY(priv->uri)) utils_open_browser(priv->uri);
} @@ -139,7 +139,7 @@ static void ao_menu_copy_activate_cb(GtkMenuItem *item, AoOpenUri *self) { AoOpenUriPrivate *priv = AO_OPEN_URI_GET_PRIVATE(self);
- if (NZV(priv->uri)) + if (!EMPTY(priv->uri)) gtk_clipboard_set_text(gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE)), priv->uri, -1); }
Modified: addons/src/ao_tasks.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -127,7 +127,7 @@ static void ao_tasks_set_property(GObject *object, guint prop_id, case PROP_TOKENS: { const gchar *t = g_value_get_string(value); - if (! NZV(t)) + if (EMPTY(t)) t = "TODO;FIXME"; /* fallback */ g_strfreev(priv->tokens); priv->tokens = g_strsplit(t, ";", -1); @@ -573,14 +573,14 @@ static void update_tasks_for_doc(AoTasks *t, GeanyDocument *doc) token = priv->tokens; while (*token != NULL) { - if (NZV(*token) && (task_start = strstr(line_buf, *token)) != NULL) + if (!EMPTY(*token) && (task_start = strstr(line_buf, *token)) != NULL) { /* skip the token and additional whitespace */ task_start += strlen(*token); while (*task_start == ' ' || *task_start == ':') task_start++; /* reset task_start in case there is no text following */ - if (! NZV(task_start)) + if (EMPTY(task_start)) task_start = line_buf; /* create the task */ create_task(t, doc, line, *token, line_buf, task_start, display_name);
Modified: addons/src/ao_xmltagging.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -93,7 +93,7 @@ void ao_xmltagging(void) /* Getting the tag */ tag = g_string_new(gtk_entry_get_text(GTK_ENTRY(textbox)));
- if (tag->len > 0) + if (!EMPTY(tag) && tag->len > 0) { gsize end = 0; gchar *end_tag;
Modified: geanydoc/src/config.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -111,12 +111,12 @@ gchar *key = g_strdup_printf("command%d", cmd_num); ret = utils_get_setting_string(config, lang, key, ""); g_free(key); - if (!NZV(ret)) + if (EMPTY(ret)) return ret; key = g_strdup_printf("command%d", cmd_num + 1); tmp = utils_get_setting_string(config, lang, key, ""); g_free(key); - if (NZV(tmp)) + if (! EMPTY(tmp)) *intern = TRUE; else *intern = utils_get_setting_boolean(config, lang, "internal", FALSE);
Modified: geanydoc/src/geanydoc.c 8 files changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -185,7 +185,7 @@
ftype = doc->file_type->name; command = config_get_command(ftype, cmd_num, &intern); - if (!NZV(command)) + if (EMPTY(command)) { g_free(command); return; @@ -201,7 +201,7 @@ if (intern) { g_spawn_command_line_sync(command, &tmp, NULL, NULL, NULL); - if (NZV(tmp)) + if (! EMPTY(tmp)) { show_output(tmp, "*DOC*", NULL, doc->file_type->id); } @@ -271,11 +271,11 @@
if (from != NULL) { - if (NZV(cmd0_txt)) + if (! EMPTY(cmd0_txt)) g_key_file_set_string(config, from, "command0", cmd0_txt); else g_key_file_remove_key(config, from, "command0", NULL); - if (NZV(cmd1_txt)) + if (! EMPTY(cmd1_txt)) g_key_file_set_string(config, from, "command1", cmd1_txt); else g_key_file_remove_key(config, from, "command1", NULL);
Modified: gproject/src/gproject-utils.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -36,7 +36,7 @@ static gchar *relpath(const gchar *origin_dir, const gchar *dest_dir) origin = tm_get_real_path(origin_dir); dest = tm_get_real_path(dest_dir);
- if (!NZV(origin) || !NZV(dest) || origin[0] != dest[0]) + if (EMPTY(origin) || EMPTY(dest) || origin[0] != dest[0]) { g_free(origin); g_free(dest); @@ -65,7 +65,7 @@ static gchar *relpath(const gchar *origin_dir, const gchar *dest_dir) g_free(dest); g_strfreev(originv); g_strfreev(destv); - + return ret; }
Modified: spellcheck/src/gui.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -297,7 +297,7 @@ void sc_gui_update_editor_menu_cb(GObject *obj, const gchar *word, gint pos, search_word = g_strdup(word);
/* ignore numbers or words starting with digits and non-text */ - if (! NZV(search_word) || isdigit(*search_word) || ! sc_speller_is_text(doc, pos)) + if (EMPTY(search_word) || isdigit(*search_word) || ! sc_speller_is_text(doc, pos)) { g_free(search_word); return;
Modified: spellcheck/src/scplugin.c 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -219,7 +219,7 @@ static void dictionary_dir_button_clicked_cb(GtkButton *button, gpointer item) GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
text = utils_get_locale_from_utf8(gtk_entry_get_text(GTK_ENTRY(item))); - if (NZV(text)) + if (!EMPTY(text)) gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), text);
/* run it */ @@ -294,7 +294,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) ui_widget_set_tooltip_text(entry_dir, _("Read additional dictionary files from this directory. " "For now, this only works with myspell dictionaries.")); - if (NZV(sc_info->dictionary_dir)) + if (! EMPTY(sc_info->dictionary_dir)) gtk_entry_set_text(GTK_ENTRY(entry_dir), sc_info->dictionary_dir);
button = gtk_button_new();
Modified: spellcheck/src/speller.c 8 files changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -133,7 +133,7 @@ static gint sc_speller_check_word(GeanyDocument *doc, gint line_number, const gc g_return_val_if_fail(word != NULL, 0); g_return_val_if_fail(start_pos >= 0 && end_pos >= 0, 0);
- if (! NZV(word)) + if (EMPTY(word)) return 0;
/* ignore numbers or words starting with digits */ @@ -338,7 +338,7 @@ gchar *sc_speller_get_default_lang(void) const gchar *lang = g_getenv("LANG"); gchar *result = NULL;
- if (NZV(lang)) + if (! EMPTY(lang)) { if (*lang == 'C' || *lang == 'c') lang = "en"; @@ -497,7 +497,7 @@ void sc_speller_reinit_enchant_dict(void)
/* Check if the stored default dictionary is (still) available, fall back to the first * one in the list if not */ - if (! NZV(lang) || ! check_default_lang()) + if (EMPTY(lang) || ! check_default_lang()) { if (sc_info->dicts->len > 0) { @@ -510,7 +510,7 @@ void sc_speller_reinit_enchant_dict(void) }
/* Request new dict object */ - if (NZV(lang)) + if (! EMPTY(lang)) sc_speller_dict = enchant_broker_request_dict(sc_speller_broker, lang); else sc_speller_dict = NULL;
Modified: treebrowser/src/treebrowser.c 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -295,7 +295,7 @@ enum } }
- if (! NZV(gtk_entry_get_text(GTK_ENTRY(filter)))) + if (EMPTY(gtk_entry_get_text(GTK_ENTRY(filter)))) return TRUE;
filters = g_strsplit(gtk_entry_get_text(GTK_ENTRY(filter)), ";", 0); @@ -344,7 +344,7 @@ enum const gchar *base_name = NULL; base_name = g_path_get_basename(filename);
- if (! NZV(base_name)) + if (EMPTY(base_name)) return FALSE;
if (CONFIG_SHOW_HIDDEN_FILES) @@ -389,7 +389,7 @@ enum else dir = geany->prefs->default_open_path;
- if (NZV(dir)) + if (! EMPTY(dir)) return utils_get_locale_from_utf8(dir);
return g_get_current_dir();
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org