[nautilus/wip/antoniof/gtk4-preparation-drop-libgd: 7/8] query-editor: Stop using libgd
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/gtk4-preparation-drop-libgd: 7/8] query-editor: Stop using libgd
- Date: Tue, 2 Nov 2021 23:54:44 +0000 (UTC)
commit 905b220fa8599a18511c944c342fa8d082257ee6
Author: António Fernandes <antoniof gnome org>
Date: Tue Nov 2 23:38:40 2021 +0000
query-editor: Stop using libgd
This introduces a temporary regression: missing search entry tags.
This regression is easy to fix after the switch to GTK4, using GtkText
to reimplement an API identical to that of GdTaggedEntry. For this
reason, code is disabled rather than removed.
src/nautilus-query-editor.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index 1eb074927..11f5c1e1a 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -26,7 +26,6 @@
#include <gio/gio.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <libgd/gd.h>
#include <string.h>
#include "nautilus-file.h"
@@ -45,8 +44,10 @@ struct _NautilusQueryEditor
GtkWidget *popover;
GtkWidget *dropdown_button;
+#if 0
GdTaggedEntryTag *mime_types_tag;
GdTaggedEntryTag *date_range_tag;
+#endif
gboolean change_frozen;
@@ -224,12 +225,14 @@ nautilus_query_editor_set_property (GObject *object,
static void
nautilus_query_editor_finalize (GObject *object)
{
+#if 0
NautilusQueryEditor *editor;
editor = NAUTILUS_QUERY_EDITOR (object);
g_clear_object (&editor->date_range_tag);
g_clear_object (&editor->mime_types_tag);
+#endif
G_OBJECT_CLASS (nautilus_query_editor_parent_class)->finalize (object);
}
@@ -424,6 +427,7 @@ search_popover_date_range_changed_cb (NautilusSearchPopover *popover,
create_query (editor);
}
+#if 0
gd_tagged_entry_remove_tag (GD_TAGGED_ENTRY (editor->entry),
editor->date_range_tag);
if (date_range)
@@ -436,6 +440,7 @@ search_popover_date_range_changed_cb (NautilusSearchPopover *popover,
gd_tagged_entry_add_tag (GD_TAGGED_ENTRY (editor->entry),
GD_TAGGED_ENTRY_TAG (editor->date_range_tag));
}
+#endif
nautilus_query_set_date_range (editor->query, date_range);
@@ -458,8 +463,10 @@ search_popover_mime_type_changed_cb (NautilusSearchPopover *popover,
create_query (editor);
}
+#if 0
gd_tagged_entry_remove_tag (GD_TAGGED_ENTRY (editor->entry),
editor->mime_types_tag);
+#endif
/* group 0 is anything */
if (mimetype_group == 0)
{
@@ -468,21 +475,27 @@ search_popover_mime_type_changed_cb (NautilusSearchPopover *popover,
else if (mimetype_group > 0)
{
mimetypes = nautilus_mime_types_group_get_mimetypes (mimetype_group);
+#if 0
gd_tagged_entry_tag_set_label (editor->mime_types_tag,
nautilus_mime_types_group_get_name (mimetype_group));
gd_tagged_entry_add_tag (GD_TAGGED_ENTRY (editor->entry),
GD_TAGGED_ENTRY_TAG (editor->mime_types_tag));
+#endif
}
else
{
+#if 0
g_autofree gchar *display_name = NULL;
+#endif
mimetypes = g_ptr_array_new_full (1, g_free);
g_ptr_array_add (mimetypes, g_strdup (mimetype));
+#if 0
display_name = g_content_type_get_description (mimetype);
gd_tagged_entry_tag_set_label (editor->mime_types_tag, display_name);
gd_tagged_entry_add_tag (GD_TAGGED_ENTRY (editor->entry),
GD_TAGGED_ENTRY_TAG (editor->mime_types_tag));
+#endif
}
nautilus_query_set_mime_types (editor->query, mimetypes);
@@ -528,6 +541,7 @@ search_popover_fts_changed_cb (GObject *popover,
nautilus_query_editor_changed (editor);
}
+#if 0
static void
entry_tag_clicked (NautilusQueryEditor *editor)
{
@@ -548,6 +562,7 @@ entry_tag_close_button_clicked (NautilusQueryEditor *editor,
nautilus_search_popover_reset_date_range (NAUTILUS_SEARCH_POPOVER (editor->popover));
}
}
+#endif
static void
setup_widgets (NautilusQueryEditor *editor)
@@ -565,11 +580,16 @@ setup_widgets (NautilusQueryEditor *editor)
gtk_container_add (GTK_CONTAINER (vbox), hbox);
/* create the search entry */
+#if 0
editor->entry = GTK_WIDGET (gd_tagged_entry_new ());
+#else
+ editor->entry = gtk_search_entry_new ();
+#endif
gtk_widget_set_hexpand (editor->entry, TRUE);
gtk_container_add (GTK_CONTAINER (hbox), editor->entry);
+#if 0
editor->mime_types_tag = gd_tagged_entry_tag_new (NULL);
editor->date_range_tag = gd_tagged_entry_tag_new (NULL);
@@ -581,6 +601,7 @@ setup_widgets (NautilusQueryEditor *editor)
"tag-button-clicked",
G_CALLBACK (entry_tag_close_button_clicked),
editor);
+#endif
/* setup the search popover */
editor->popover = nautilus_search_popover_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]