~ubuntu-branches/ubuntu/quantal/rhythmbox/quantal-proposed

« back to all changes in this revision

Viewing changes to widgets/rb-source-toolbar.c

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Rico Tzschichholz
  • Date: 2011-12-05 19:31:23 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20111205193123-89047p8yplb0w1vx
Tags: 2.90.1~20111126.89c872b0-0ubuntu1
* Upload the new version to Ubuntu, should solve those issues:
  - the lack of rhythmbox-client command (lp: #875064)
  - the music sharing preferences dialog (lp: #894153)
  - several segfaults (lp: #859195, #814614)
* debian/control.in:
  - let the rhythmbox gir depends on gir1.2-peas-1.0 (lp: #874973)

[ Rico Tzschichholz ]
* New upstream git snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
 
3
 *  Copyright (C) 2011 Jonathan Matthew <jonathan@d14n.org>
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  The Rhythmbox authors hereby grant permission for non-GPL compatible
 
11
 *  GStreamer plugins to be used and distributed together with GStreamer
 
12
 *  and Rhythmbox. This permission is above and beyond the permissions granted
 
13
 *  by the GPL license by which Rhythmbox is covered. If you modify this code
 
14
 *  you may extend this exception to your version of the code, but you are not
 
15
 *  obligated to do so. If you do not wish to do so, delete this exception
 
16
 *  statement from your version.
 
17
 *
 
18
 *  This program is distributed in the hope that it will be useful,
 
19
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 *  GNU General Public License for more details.
 
22
 *
 
23
 *  You should have received a copy of the GNU General Public License
 
24
 *  along with this program; if not, write to the Free Software
 
25
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
26
 *
 
27
 */
 
28
 
 
29
#include <config.h>
 
30
 
 
31
#include <widgets/rb-source-toolbar.h>
 
32
#include <lib/rb-util.h>
 
33
 
 
34
static void rb_source_toolbar_class_init (RBSourceToolbarClass *klass);
 
35
static void rb_source_toolbar_init (RBSourceToolbar *toolbar);
 
36
 
 
37
struct _RBSourceToolbarPrivate
 
38
{
 
39
        GtkUIManager *ui_manager;
 
40
        RBSource *source;
 
41
        RBSearchEntry *search_entry;
 
42
        GtkWidget *search_popup;
 
43
        GtkWidget *toolbar;
 
44
        GBinding *browse_binding;
 
45
        char *popup_path;
 
46
 
 
47
        /* search state */
 
48
        int search_value;
 
49
        gulong search_change_cb_id;
 
50
        RBSourceSearch *active_search;
 
51
        char *search_text;
 
52
        GtkRadioAction *search_group;
 
53
};
 
54
 
 
55
G_DEFINE_TYPE (RBSourceToolbar, rb_source_toolbar, GTK_TYPE_GRID)
 
56
 
 
57
/**
 
58
 * SECTION:rb-source-toolbar
 
59
 * @short_description: toolbar+search entry for sources
 
60
 *
 
61
 * This class combines a toolbar for custom source actions with a
 
62
 * search entry.  The toolbar content is specified using a UI path.
 
63
 * The #RBSourceToolbar takes care of preserving search state when
 
64
 * the selected page changes, and performs searches when the user
 
65
 * selects a new search type or changes the search text.
 
66
 */
 
67
 
 
68
enum
 
69
{
 
70
        PROP_0,
 
71
        PROP_SOURCE,
 
72
        PROP_UI_MANAGER,
 
73
};
 
74
 
 
75
static void
 
76
prepare_toolbar (GtkWidget *toolbar)
 
77
{
 
78
        static GtkCssProvider *provider = NULL;
 
79
 
 
80
        if (provider == NULL) {
 
81
                const char *style =
 
82
                        "GtkToolbar {\n"
 
83
                        "       -GtkToolbar-shadow-type: none;\n"
 
84
                        "       border-style: none;\n"
 
85
                        "}";
 
86
 
 
87
                provider = gtk_css_provider_new ();
 
88
                gtk_css_provider_load_from_data (provider, style, -1, NULL);
 
89
        }
 
90
 
 
91
        gtk_style_context_add_provider (gtk_widget_get_style_context (toolbar),
 
92
                                        GTK_STYLE_PROVIDER (provider),
 
93
                                        GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
94
 
 
95
        gtk_widget_set_hexpand (toolbar, TRUE);
 
96
 
 
97
        gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT);
 
98
}
 
99
 
 
100
static void
 
101
search_change_cb (GtkRadioAction *group, GtkRadioAction *current, RBSourceToolbar *toolbar)
 
102
{
 
103
        toolbar->priv->active_search = rb_source_search_get_from_action (G_OBJECT (current));
 
104
 
 
105
        if (toolbar->priv->search_text != NULL) {
 
106
                rb_source_search (toolbar->priv->source, toolbar->priv->active_search, NULL, toolbar->priv->search_text);
 
107
        }
 
108
 
 
109
        rb_search_entry_set_placeholder (toolbar->priv->search_entry, gtk_action_get_label (GTK_ACTION (current)));
 
110
}
 
111
 
 
112
static void
 
113
source_selected_cb (GObject *object, GParamSpec *pspec, RBSourceToolbar *toolbar)
 
114
{
 
115
        gboolean selected;
 
116
 
 
117
        g_object_get (object, "selected", &selected, NULL);
 
118
 
 
119
        if (selected) {
 
120
                char *toolbar_path;
 
121
                char *browse_path;
 
122
 
 
123
                if (toolbar->priv->toolbar != NULL) {
 
124
                        gtk_grid_attach (GTK_GRID (toolbar), toolbar->priv->toolbar, 0, 0, 2, 1);
 
125
                        gtk_widget_show_all (GTK_WIDGET (toolbar->priv->toolbar));
 
126
                }
 
127
 
 
128
                if (toolbar->priv->search_entry != NULL) {
 
129
                        rb_search_entry_set_mnemonic (toolbar->priv->search_entry, TRUE);
 
130
 
 
131
                        gtk_widget_add_accelerator (GTK_WIDGET (toolbar->priv->search_entry),
 
132
                                                    "grab-focus",
 
133
                                                    gtk_ui_manager_get_accel_group (toolbar->priv->ui_manager),
 
134
                                                    gdk_unicode_to_keyval ('f'),
 
135
                                                    GDK_CONTROL_MASK,
 
136
                                                    0);
 
137
                }
 
138
 
 
139
                if (toolbar->priv->search_group != NULL) {
 
140
                        if (toolbar->priv->search_value != -1) {
 
141
                                gtk_radio_action_set_current_value (toolbar->priv->search_group,
 
142
                                                                    toolbar->priv->search_value);
 
143
                        }
 
144
 
 
145
                        toolbar->priv->search_change_cb_id = g_signal_connect (toolbar->priv->search_group,
 
146
                                                                               "changed",
 
147
                                                                               G_CALLBACK (search_change_cb),
 
148
                                                                               toolbar);
 
149
                }
 
150
 
 
151
                g_object_get (toolbar->priv->source, "toolbar-path", &toolbar_path, NULL);
 
152
                if (toolbar_path != NULL) {
 
153
                        GtkAction *browse_action;
 
154
 
 
155
                        browse_path = g_strdup_printf ("%s/Browse", toolbar_path);
 
156
                        browse_action = gtk_ui_manager_get_action (toolbar->priv->ui_manager, browse_path);
 
157
                        g_free (browse_path);
 
158
 
 
159
                        if (browse_action != NULL) {
 
160
                                toolbar->priv->browse_binding =
 
161
                                        g_object_bind_property (toolbar->priv->source, "show-browser",
 
162
                                                                browse_action, "active",
 
163
                                                                G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
 
164
                        }
 
165
                        g_free (toolbar_path);
 
166
                }
 
167
        } else {
 
168
                if (toolbar->priv->toolbar != NULL) {
 
169
                        gtk_container_remove (GTK_CONTAINER (toolbar), toolbar->priv->toolbar);
 
170
                }
 
171
 
 
172
                if (toolbar->priv->search_entry != NULL) {
 
173
                        rb_search_entry_set_mnemonic (toolbar->priv->search_entry, FALSE);
 
174
 
 
175
                        gtk_widget_remove_accelerator (GTK_WIDGET (toolbar->priv->search_entry),
 
176
                                                       gtk_ui_manager_get_accel_group (toolbar->priv->ui_manager),
 
177
                                                       gdk_unicode_to_keyval ('f'),
 
178
                                                       GDK_CONTROL_MASK);
 
179
                }
 
180
 
 
181
                if (toolbar->priv->search_group != NULL) {
 
182
                        if (toolbar->priv->search_change_cb_id != 0) {
 
183
                                g_signal_handler_disconnect (toolbar->priv->search_group,
 
184
                                                             toolbar->priv->search_change_cb_id);
 
185
                        }
 
186
 
 
187
                        toolbar->priv->search_value = gtk_radio_action_get_current_value (toolbar->priv->search_group);
 
188
                }
 
189
 
 
190
                if (toolbar->priv->browse_binding != NULL) {
 
191
                        g_object_unref (toolbar->priv->browse_binding);
 
192
                        toolbar->priv->browse_binding = NULL;
 
193
                }
 
194
        }
 
195
}
 
196
 
 
197
static void
 
198
search_cb (RBSearchEntry *search_entry, const char *text, RBSourceToolbar *toolbar)
 
199
{
 
200
        rb_source_search (toolbar->priv->source, toolbar->priv->active_search, toolbar->priv->search_text, text);
 
201
 
 
202
        g_free (toolbar->priv->search_text);
 
203
        toolbar->priv->search_text = NULL;
 
204
        if (text != NULL) {
 
205
                toolbar->priv->search_text = g_strdup (text);
 
206
        }
 
207
}
 
208
 
 
209
static void
 
210
show_popup_cb (RBSearchEntry *search_entry, RBSourceToolbar *toolbar)
 
211
{
 
212
        gtk_menu_popup (GTK_MENU (toolbar->priv->search_popup),
 
213
                        NULL, NULL, NULL, NULL, 3,
 
214
                        gtk_get_current_event_time ());
 
215
}
 
216
 
 
217
 
 
218
static void
 
219
impl_finalize (GObject *object)
 
220
{
 
221
        RBSourceToolbar *toolbar = RB_SOURCE_TOOLBAR (object);
 
222
 
 
223
        g_free (toolbar->priv->search_text);
 
224
        g_free (toolbar->priv->popup_path);
 
225
 
 
226
        G_OBJECT_CLASS (rb_source_toolbar_parent_class)->finalize (object);
 
227
}
 
228
 
 
229
static void
 
230
impl_dispose (GObject *object)
 
231
{
 
232
        RBSourceToolbar *toolbar = RB_SOURCE_TOOLBAR (object);
 
233
 
 
234
        if (toolbar->priv->ui_manager != NULL) {
 
235
                g_object_unref (toolbar->priv->ui_manager);
 
236
                toolbar->priv->ui_manager = NULL;
 
237
        }
 
238
        if (toolbar->priv->search_popup != NULL) {
 
239
                g_object_unref (toolbar->priv->search_popup);
 
240
                toolbar->priv->search_popup = NULL;
 
241
        }
 
242
        if (toolbar->priv->toolbar != NULL) {
 
243
                g_object_unref (toolbar->priv->toolbar);
 
244
                toolbar->priv->toolbar = NULL;
 
245
        }
 
246
        if (toolbar->priv->browse_binding != NULL) {
 
247
                g_object_unref (toolbar->priv->browse_binding);
 
248
                toolbar->priv->browse_binding = NULL;
 
249
        }
 
250
 
 
251
        G_OBJECT_CLASS (rb_source_toolbar_parent_class)->dispose (object);
 
252
}
 
253
 
 
254
static void
 
255
toolbar_add_widget_cb (GtkUIManager *ui_manager, GtkWidget *widget, RBSourceToolbar *toolbar)
 
256
{
 
257
        char *toolbar_path;
 
258
        gboolean selected;
 
259
 
 
260
        g_object_get (toolbar->priv->source, "toolbar-path", &toolbar_path, "selected", &selected, NULL);
 
261
        toolbar->priv->toolbar = gtk_ui_manager_get_widget (toolbar->priv->ui_manager, toolbar_path);
 
262
        g_free (toolbar_path);
 
263
 
 
264
        if (toolbar->priv->toolbar) {
 
265
                g_object_ref (toolbar->priv->toolbar);
 
266
                g_signal_handlers_disconnect_by_func (ui_manager, G_CALLBACK (toolbar_add_widget_cb), toolbar);
 
267
 
 
268
                prepare_toolbar (toolbar->priv->toolbar);
 
269
 
 
270
                if (selected) {
 
271
                        gtk_grid_attach (GTK_GRID (toolbar), toolbar->priv->toolbar, 0, 0, 2, 1);
 
272
                        gtk_widget_show_all (GTK_WIDGET (toolbar->priv->toolbar));
 
273
                }
 
274
        }
 
275
}
 
276
 
 
277
static void
 
278
impl_constructed (GObject *object)
 
279
{
 
280
        RBSourceToolbar *toolbar;
 
281
        char *toolbar_path;
 
282
        GtkWidget *blank;
 
283
 
 
284
        RB_CHAIN_GOBJECT_METHOD (rb_source_toolbar_parent_class, constructed, object);
 
285
 
 
286
        toolbar = RB_SOURCE_TOOLBAR (object);
 
287
 
 
288
        g_object_get (toolbar->priv->source, "toolbar-path", &toolbar_path, NULL);
 
289
        if (toolbar_path) {
 
290
                toolbar->priv->toolbar = gtk_ui_manager_get_widget (toolbar->priv->ui_manager, toolbar_path);
 
291
                if (toolbar->priv->toolbar == NULL) {
 
292
                        g_signal_connect (toolbar->priv->ui_manager, "add-widget", G_CALLBACK (toolbar_add_widget_cb), toolbar);
 
293
                } else {
 
294
                        g_object_ref (toolbar->priv->toolbar);
 
295
                        prepare_toolbar (toolbar->priv->toolbar);
 
296
                }
 
297
        } else {
 
298
                blank = gtk_toolbar_new ();
 
299
                prepare_toolbar (blank);
 
300
                gtk_grid_attach (GTK_GRID (toolbar), blank, 0, 0, 2 ,1);
 
301
        }
 
302
        g_free (toolbar_path);
 
303
 
 
304
        /* search entry gets created later if required */
 
305
 
 
306
        g_signal_connect (toolbar->priv->source, "notify::selected", G_CALLBACK (source_selected_cb), toolbar);
 
307
}
 
308
 
 
309
static void
 
310
impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
311
{
 
312
        RBSourceToolbar *toolbar = RB_SOURCE_TOOLBAR (object);
 
313
 
 
314
        switch (prop_id) {
 
315
        case PROP_SOURCE:
 
316
                g_value_set_object (value, toolbar->priv->source);
 
317
                break;
 
318
        case PROP_UI_MANAGER:
 
319
                g_value_set_object (value, toolbar->priv->ui_manager);
 
320
                break;
 
321
        default:
 
322
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
323
                break;
 
324
        }
 
325
}
 
326
 
 
327
static void
 
328
impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
329
{
 
330
        RBSourceToolbar *toolbar = RB_SOURCE_TOOLBAR (object);
 
331
 
 
332
        switch (prop_id) {
 
333
        case PROP_SOURCE:
 
334
                toolbar->priv->source = g_value_get_object (value);     /* don't take a ref */
 
335
                break;
 
336
        case PROP_UI_MANAGER:
 
337
                toolbar->priv->ui_manager = g_value_dup_object (value);
 
338
                break;
 
339
        default:
 
340
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 
341
                break;
 
342
        }
 
343
}
 
344
 
 
345
static void
 
346
rb_source_toolbar_init (RBSourceToolbar *toolbar)
 
347
{
 
348
        toolbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (toolbar, RB_TYPE_SOURCE_TOOLBAR, RBSourceToolbarPrivate);
 
349
 
 
350
        toolbar->priv->search_value = -1;
 
351
}
 
352
 
 
353
static void
 
354
rb_source_toolbar_class_init (RBSourceToolbarClass *klass)
 
355
{
 
356
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
357
 
 
358
        object_class->constructed = impl_constructed;
 
359
        object_class->dispose = impl_dispose;
 
360
        object_class->finalize = impl_finalize;
 
361
        object_class->set_property = impl_set_property;
 
362
        object_class->get_property = impl_get_property;
 
363
 
 
364
        /**
 
365
         * RBSourceToolbar:source:
 
366
         *
 
367
         * The #RBSource the toolbar is associated with
 
368
         */
 
369
        g_object_class_install_property (object_class,
 
370
                                         PROP_SOURCE,
 
371
                                         g_param_spec_object ("source",
 
372
                                                              "source",
 
373
                                                              "RBSource instance",
 
374
                                                              RB_TYPE_SOURCE,
 
375
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
376
        /**
 
377
         * RBSourceToolbar:ui-manager:
 
378
         *
 
379
         * The #GtkUIManager instance
 
380
         */
 
381
        g_object_class_install_property (object_class,
 
382
                                         PROP_UI_MANAGER,
 
383
                                         g_param_spec_object ("ui-manager",
 
384
                                                              "ui manager",
 
385
                                                              "GtkUIManager instance",
 
386
                                                              GTK_TYPE_UI_MANAGER,
 
387
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
388
        g_type_class_add_private (klass, sizeof (RBSourceToolbarPrivate));
 
389
}
 
390
 
 
391
/**
 
392
 * rb_source_toolbar_new:
 
393
 * @source: a #RBSource
 
394
 * @ui_manager: the #GtkUIManager
 
395
 *
 
396
 * Creates a new source toolbar for @source.  The toolbar does not
 
397
 * initially include a search entry.  Call #rb_source_toolbar_add_search_entry
 
398
 * to add one.  The toolbar content comes from the @RBSource:toolbar-path property.
 
399
 *
 
400
 * Return value: the #RBSourceToolbar
 
401
 */
 
402
RBSourceToolbar *
 
403
rb_source_toolbar_new (RBSource *source, GtkUIManager *ui_manager)
 
404
{
 
405
        GObject *object;
 
406
        object = g_object_new (RB_TYPE_SOURCE_TOOLBAR,
 
407
                               "source", source,
 
408
                               "ui-manager", ui_manager,
 
409
                               "column-spacing", 6,
 
410
                               "column-homogeneous", TRUE,
 
411
                               "row-spacing", 6,
 
412
                               "row-homogeneous", TRUE,
 
413
                               NULL);
 
414
        return RB_SOURCE_TOOLBAR (object);
 
415
}
 
416
 
 
417
static void
 
418
setup_search_popup (RBSourceToolbar *toolbar, GtkWidget *popup)
 
419
{
 
420
        GList *items;
 
421
        GSList *l;
 
422
        int active_value;
 
423
 
 
424
        toolbar->priv->search_popup = g_object_ref (popup);
 
425
 
 
426
        items = gtk_container_get_children (GTK_CONTAINER (toolbar->priv->search_popup));
 
427
        toolbar->priv->search_group = GTK_RADIO_ACTION (gtk_activatable_get_related_action (GTK_ACTIVATABLE (items->data)));
 
428
        g_list_free (items);
 
429
 
 
430
        active_value = gtk_radio_action_get_current_value (toolbar->priv->search_group);
 
431
        for (l = gtk_radio_action_get_group (toolbar->priv->search_group); l != NULL; l = l->next) {
 
432
                int value;
 
433
                g_object_get (G_OBJECT (l->data), "value", &value, NULL);
 
434
                if (value == active_value) {
 
435
                        rb_search_entry_set_placeholder (toolbar->priv->search_entry,
 
436
                                                         gtk_action_get_label (GTK_ACTION (l->data)));
 
437
                }
 
438
        }
 
439
 
 
440
        g_signal_connect (toolbar->priv->search_entry, "show-popup", G_CALLBACK (show_popup_cb), toolbar);
 
441
}
 
442
 
 
443
static void
 
444
popup_add_widget_cb (GtkUIManager *ui_manager, GtkWidget *widget, RBSourceToolbar *toolbar)
 
445
{
 
446
        GtkWidget *popup;
 
447
        popup = gtk_ui_manager_get_widget (toolbar->priv->ui_manager, toolbar->priv->popup_path);
 
448
 
 
449
        if (popup) {
 
450
                setup_search_popup (toolbar, popup);
 
451
                g_signal_handlers_disconnect_by_func (ui_manager, G_CALLBACK (popup_add_widget_cb), toolbar);
 
452
        }
 
453
}
 
454
 
 
455
 
 
456
/**
 
457
 * rb_source_toolbar_add_search_entry:
 
458
 * @toolbar: a #RBSourceToolbar
 
459
 * @popup_path: the UI path for the search popup (or NULL)
 
460
 * @placeholder: the placeholder text for the search entry (or NULL)
 
461
 *
 
462
 * Adds a search entry to the toolbar.  If a popup path is specified,
 
463
 * clicking on the primary icon will show a menu allowing the user to
 
464
 * select a search type, and the placeholder text for the entry will
 
465
 * be the selected search description.  Otherwise, the specified placeholder
 
466
 * text will be displayed.
 
467
 */
 
468
void
 
469
rb_source_toolbar_add_search_entry (RBSourceToolbar *toolbar, const char *popup_path, const char *placeholder)
 
470
{
 
471
        g_assert (toolbar->priv->search_entry == NULL);
 
472
 
 
473
        toolbar->priv->search_entry = rb_search_entry_new (popup_path != NULL);
 
474
        gtk_widget_set_margin_right (GTK_WIDGET (toolbar->priv->search_entry), 6);
 
475
        gtk_grid_attach (GTK_GRID (toolbar), GTK_WIDGET (toolbar->priv->search_entry), 2, 0, 1, 1);
 
476
 
 
477
        if (placeholder) {
 
478
                rb_search_entry_set_placeholder (toolbar->priv->search_entry, placeholder);
 
479
        }
 
480
 
 
481
        g_signal_connect (toolbar->priv->search_entry, "search", G_CALLBACK (search_cb), toolbar);
 
482
        /* activate? */
 
483
 
 
484
        if (popup_path != NULL) {
 
485
                GtkWidget *popup;
 
486
                toolbar->priv->popup_path = g_strdup (popup_path);
 
487
 
 
488
                popup = gtk_ui_manager_get_widget (toolbar->priv->ui_manager, popup_path);
 
489
                if (popup != NULL) {
 
490
                        setup_search_popup (toolbar, popup);
 
491
                } else {
 
492
                        g_signal_connect (toolbar->priv->ui_manager, "add-widget", G_CALLBACK (popup_add_widget_cb), toolbar);
 
493
                }
 
494
        }
 
495
}
 
496
 
 
497
/**
 
498
 * rb_source_toolbar_clear_search_entry:
 
499
 * @toolbar: a #RBSourceToolbar
 
500
 *
 
501
 * Clears the search entry text.  Call this from RBSource:impl_reset_filters.
 
502
 */
 
503
void
 
504
rb_source_toolbar_clear_search_entry (RBSourceToolbar *toolbar)
 
505
{
 
506
        g_assert (toolbar->priv->search_entry != NULL);
 
507
        rb_search_entry_clear (toolbar->priv->search_entry);
 
508
}