@@ -57,14 +57,10 @@ typedef struct
5757 gboolean is_visible ;
5858 GtkWidget * vbox ;
5959
60- gboolean history_enabled ;
6160 gboolean focus_frozen ;
6261
6362 gchar * current_uri ;
6463 gchar * base_uri ;
65-
66- gchar * last_set_query_file_pattern ;
67- gchar * last_set_query_content_pattern ;
6864} NemoQueryEditorPrivate ;
6965
7066struct _NemoQueryEditor
@@ -111,8 +107,6 @@ nemo_query_editor_dispose (GObject *object)
111107
112108 g_clear_pointer (& editor -> priv -> base_uri , g_free );
113109 g_clear_pointer (& editor -> priv -> current_uri , g_free );
114- g_clear_pointer (& editor -> priv -> last_set_query_file_pattern , g_free );
115- g_clear_pointer (& editor -> priv -> last_set_query_content_pattern , g_free );
116110
117111 if (editor -> priv -> typing_timeout_id > 0 ) {
118112 g_source_remove (editor -> priv -> typing_timeout_id );
@@ -227,9 +221,6 @@ on_key_press_event (GtkWidget *widget,
227221 NemoQueryEditor * editor = NEMO_QUERY_EDITOR (user_data );
228222
229223 if ((event -> key .state & gtk_accelerator_get_default_mod_mask ()) == 0 ) {
230- // if (event->key.keyval == GDK_KEY_Up) {
231- // popup_favorites (NEMO_QUERY_EDITOR (user_data), event, FALSE);
232- // } else
233224 if (event -> key .keyval == GDK_KEY_Tab ) {
234225 GList * focus_iter = editor -> priv -> focus_chain ;
235226
@@ -271,38 +262,6 @@ search_icon_clicked_cb (GtkWidget *widget,
271262 }
272263}
273264
274- // static void
275- // file_combo_iter_changed (GtkWidget *widget,
276- // GParamSpec *spec,
277- // gpointer data)
278- // {
279- // NemoQueryEditor *editor = NEMO_QUERY_EDITOR (data);
280-
281- // if (editor->priv->focus_frozen) {
282- // return;
283- // }
284-
285- // gtk_widget_grab_focus (editor->priv->file_entry);
286-
287- // editor->priv->last_focus_widget = editor->priv->file_entry;
288- // gtk_editable_set_position (GTK_EDITABLE (editor->priv->file_entry), -1);
289- // }
290-
291- // static void
292- // content_combo_iter_changed (GtkWidget *widget,
293- // GParamSpec *spec,
294- // gpointer data)
295- // {
296- // NemoQueryEditor *editor = NEMO_QUERY_EDITOR (data);
297-
298- // if (editor->priv->focus_frozen) {
299- // return;
300- // }
301-
302- // editor->priv->last_focus_widget = editor->priv->content_entry;
303- // gtk_editable_set_position (GTK_EDITABLE (editor->priv->content_entry), -1);
304- // }
305-
306265static void
307266entry_focus_changed (GtkWidget * widget ,
308267 GParamSpec * spec ,
@@ -315,136 +274,6 @@ entry_focus_changed (GtkWidget *widget,
315274 }
316275}
317276
318- // static void
319- // setup_entry_history (NemoQueryEditor *editor,
320- // GtkComboBoxText *combo,
321- // const gchar *settings_key)
322- // {
323- // gchar **history_entries;
324- // gchar *active_text;
325- // gint i, n_entries;
326-
327- // gtk_combo_box_text_remove_all (combo);
328-
329- // history_entries = g_settings_get_strv (nemo_search_preferences, settings_key);
330- // n_entries = g_strv_length (history_entries);
331-
332- // for (i = 0; i < n_entries; i++) {
333- // const gchar *entry = history_entries[i];
334-
335- // gtk_combo_box_text_prepend_text (combo, entry);
336- // }
337-
338- // g_strfreev (history_entries);
339-
340- // editor->priv->focus_frozen = TRUE;
341-
342- // active_text = gtk_combo_box_text_get_active_text (combo);
343-
344- // if (active_text != NULL && active_text[0] != '\0') {
345- // gtk_combo_box_set_active (GTK_COMBO_BOX (combo), n_entries - 1);
346- // }
347-
348- // g_free (active_text);
349-
350- // editor->priv->focus_frozen = FALSE;
351- // }
352-
353- // static void
354- // update_history_from_entry (NemoQueryEditor *editor,
355- // const gchar *key,
356- // gchar **history,
357- // GtkWidget *widget)
358- // {
359- // GPtrArray *array;
360- // gchar *current_search;
361- // gint i;
362-
363- // current_search = g_strdup (gtk_entry_get_text (GTK_ENTRY (widget)));
364- // g_strstrip (current_search); // sanitize;
365-
366- // if (g_strcmp0 (current_search, "") == 0) {
367- // return;
368- // }
369-
370- // array = g_ptr_array_new_full (0, g_free);
371-
372- // g_ptr_array_add (array, (gpointer) g_strdup (current_search));
373-
374- // if (history != NULL) {
375- // for (i = 0; i < g_strv_length ((gchar **) history); i++) {
376- // if (g_strcmp0 (history[i], current_search) == 0) {
377- // continue;
378- // }
379-
380- // g_ptr_array_add (array, (gpointer) g_strdup (history[i]));
381-
382- // if (array->len == g_settings_get_int (nemo_search_preferences,
383- // NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY_LENGTH)) {
384- // break;
385- // }
386- // }
387- // }
388-
389- // g_ptr_array_add (array, NULL);
390- // g_settings_set_strv (nemo_search_preferences, key, (const gchar * const *) array->pdata);
391- // g_ptr_array_free (array, TRUE);
392- // g_free (current_search);
393- // }
394-
395- // static void
396- // update_histories (NemoQueryEditor *editor)
397- // {
398- // NemoQueryEditorPrivate *priv;
399- // gchar **file_history, **content_history;
400-
401- // priv = editor->priv;
402-
403- // file_history = g_settings_get_strv (nemo_search_preferences, NEMO_PREFERENCES_SEARCH_FILE_HISTORY);
404- // content_history = g_settings_get_strv (nemo_search_preferences, NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY);
405-
406- // update_history_from_entry (editor,
407- // NEMO_PREFERENCES_SEARCH_FILE_HISTORY,
408- // file_history,
409- // editor->priv->file_entry);
410-
411- // update_history_from_entry (editor,
412- // NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY,
413- // content_history,
414- // editor->priv->content_entry);
415-
416- // g_strfreev (file_history);
417- // g_strfreev (content_history);
418-
419- // setup_entry_history (editor,
420- // GTK_COMBO_BOX_TEXT (priv->file_entry_combo),
421- // NEMO_PREFERENCES_SEARCH_FILE_HISTORY);
422-
423- // setup_entry_history (editor,
424- // GTK_COMBO_BOX_TEXT (priv->content_entry_combo),
425- // NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY);
426- // }
427-
428- // static void
429- // apply_privacy_pref (NemoQueryEditor *editor)
430- // {
431- // NemoQueryEditorPrivate *priv = editor->priv;
432-
433- // priv->history_enabled = g_settings_get_boolean (cinnamon_privacy_preferences,
434- // NEMO_PREFERENCES_RECENT_ENABLED);
435-
436- // if (!priv->history_enabled) {
437- // g_settings_reset (nemo_search_preferences, NEMO_PREFERENCES_SEARCH_FILE_HISTORY);
438- // g_settings_reset (nemo_search_preferences, NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY);
439- // }
440-
441- // setup_entry_history (editor,
442- // GTK_COMBO_BOX_TEXT (priv->file_entry_combo),
443- // NEMO_PREFERENCES_SEARCH_FILE_HISTORY);
444- // setup_entry_history (editor,
445- // GTK_COMBO_BOX_TEXT (priv->content_entry_combo),
446- // NEMO_PREFERENCES_SEARCH_CONTENT_HISTORY);
447- // }
448277
449278static void
450279nemo_query_editor_init (NemoQueryEditor * editor )
@@ -474,21 +303,6 @@ nemo_query_editor_init (NemoQueryEditor *editor)
474303
475304 priv -> content_main_box = GTK_WIDGET (gtk_builder_get_object (builder , "content_main_box" ));
476305
477- // TODO: Need to make a custom combo so entries can be deleted using 'Del' key
478- // priv->file_entry_combo = GTK_WIDGET (gtk_builder_get_object (builder, "file_entry_combo"));
479-
480- // g_signal_connect (priv->file_entry_combo,
481- // "notify::active-id",
482- // G_CALLBACK (file_combo_iter_changed),
483- // editor);
484-
485- // priv->content_entry_combo = GTK_WIDGET (gtk_builder_get_object (builder, "content_entry_combo"));
486-
487- // g_signal_connect (priv->content_entry_combo,
488- // "notify::active-id",
489- // G_CALLBACK (content_combo_iter_changed),
490- // editor);
491-
492306 priv -> file_entry = GTK_WIDGET (gtk_builder_get_object (builder , "file_search_entry" ));
493307 g_signal_connect (priv -> file_entry ,
494308 "activate" ,
@@ -570,13 +384,6 @@ nemo_query_editor_init (NemoQueryEditor *editor)
570384 priv -> focus_chain -> prev = g_list_last (priv -> focus_chain );
571385 priv -> focus_chain -> prev -> next = priv -> focus_chain ;
572386
573- // g_signal_connect_swapped (cinnamon_privacy_preferences,
574- // "changed::" NEMO_PREFERENCES_RECENT_ENABLED,
575- // G_CALLBACK (apply_privacy_pref),
576- // editor);
577-
578- // apply_privacy_pref (editor);
579-
580387#ifdef ENABLE_TRACKER // No options currently supported with tracker.
581388 gtk_widget_hide (priv -> content_main_box );
582389 gtk_widget_hide (priv -> file_recurse_toggle );
@@ -599,10 +406,6 @@ nemo_query_editor_changed_force (NemoQueryEditor *editor, gboolean force_reload)
599406 g_signal_emit (editor , signals [CHANGED ], 0 ,
600407 query , force_reload );
601408 g_clear_object (& query );
602-
603- // if (editor->priv->history_enabled) {
604- // update_histories (editor);
605- // }
606409}
607410
608411static void
@@ -704,11 +507,6 @@ nemo_query_editor_set_query (NemoQueryEditor *editor,
704507 editor -> priv -> current_uri = nemo_query_get_location (query );
705508 }
706509
707- g_free (editor -> priv -> last_set_query_file_pattern );
708- g_free (editor -> priv -> last_set_query_content_pattern );
709- editor -> priv -> last_set_query_file_pattern = file_pattern ;
710- editor -> priv -> last_set_query_content_pattern = content_pattern ;
711-
712510 editor -> priv -> change_frozen = FALSE;
713511}
714512
0 commit comments