[geany/geany-plugins] f28010: addons: Drop use of the most obvious deprecated Geany API

Colomban Wendling git-noreply at xxxxx
Sat Feb 20 16:28:52 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 20 Feb 2016 16:28:52 UTC
Commit:      f28010e78d1870c85176e04e10b7ea8d255657bc
             https://github.com/geany/geany-plugins/commit/f28010e78d1870c85176e04e10b7ea8d255657bc

Log Message:
-----------
addons: Drop use of the most obvious deprecated Geany API


Modified Paths:
--------------
    addons/src/addons.c
    addons/src/ao_openuri.c

Modified: addons/src/addons.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -463,17 +463,17 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
 	g_signal_connect(check_doclist, "toggled", G_CALLBACK(ao_configure_doclist_toggled_cb), dialog);
 
 	radio_doclist_name = gtk_radio_button_new_with_mnemonic(NULL, _("Sort documents by _name"));
-	ui_widget_set_tooltip_text(radio_doclist_name,
+	gtk_widget_set_tooltip_text(radio_doclist_name,
 		_("Sort the documents in the list by their filename"));
 
 	radio_doclist_tab_order = gtk_radio_button_new_with_mnemonic_from_widget(
 		GTK_RADIO_BUTTON(radio_doclist_name), _("Sort documents by _occurrence"));
-	ui_widget_set_tooltip_text(radio_doclist_tab_order,
+	gtk_widget_set_tooltip_text(radio_doclist_tab_order,
 		_("Sort the documents in the order of the document tabs"));
 
 	radio_doclist_tab_order_reversed = gtk_radio_button_new_with_mnemonic_from_widget(
 		GTK_RADIO_BUTTON(radio_doclist_name), _("Sort documents by _occurrence (reversed)"));
-	ui_widget_set_tooltip_text(radio_doclist_tab_order_reversed,
+	gtk_widget_set_tooltip_text(radio_doclist_tab_order_reversed,
 		_("Sort the documents in the order of the document tabs (reversed)"));
 
 	switch (ao_info->doclist_sort_mode)
@@ -516,14 +516,14 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
 		_("Show tasks of all documents"));
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_tasks_scan_mode),
 		ao_info->tasks_scan_all_documents);
-	ui_widget_set_tooltip_text(check_tasks_scan_mode,
+	gtk_widget_set_tooltip_text(check_tasks_scan_mode,
 		_("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 (!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,
+	gtk_widget_set_tooltip_text(entry_tasks_tokens,
 		_("Specify a semicolon separated list of search tokens."));
 
 	label_tasks_tokens = gtk_label_new_with_mnemonic(_("Search tokens:"));


Modified: addons/src/ao_openuri.c
6 lines changed, 1 insertions(+), 5 deletions(-)
===================================================================
@@ -244,11 +244,7 @@ void ao_open_uri_update_menu(AoOpenUri *openuri, GeanyDocument *doc, gint pos)
 
 	/* if we have a selection, prefer it over the current word */
 	if (sci_has_selection(doc->editor->sci))
-	{
-		gint len = sci_get_selected_text_length(doc->editor->sci);
-		text = g_malloc0((guint)len + 1);
-		sci_get_selected_text(doc->editor->sci, text);
-	}
+		text = sci_get_selection_contents(doc->editor->sci);
 	else
 		text = editor_get_word_at_pos(doc->editor, pos, GEANY_WORDCHARS"@.://-?&%#=~+,;");
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list