aboutsummaryrefslogtreecommitdiffstats
path: root/databases/jdbc-oracle10g
Commit message (Expand)AuthorAgeFilesLines
* Decommissioning java 1.5 (EOLed since October 2009):bapt2012-12-101-6/+2
* new port: databases/jdbc-oracle10gjgh2012-07-063-0/+55
v>
d127ec478
c2beffd03
c2beffd03
890b0f027
d9ec1f482

890b0f027

68616208e



d9ec1f482
890b0f027
68616208e
daa7ef352
890b0f027

d9ec1f482

68616208e

c2beffd03

68616208e









daa7ef352
d9ec1f482


68616208e
c2beffd03
c2beffd03

c2beffd03


2f4619f7a
c2beffd03
0e53172e6
c2beffd03













d127ec478
c2beffd03


0e53172e6
c2beffd03


c2beffd03
890b0f027


c2beffd03
890b0f027

b40f531de
890b0f027


c2beffd03
890b0f027

c2beffd03

890b0f027




c2beffd03
890b0f027
c2beffd03
890b0f027
d127ec478

c2beffd03
890b0f027




bc08fad23
890b0f027

bc08fad23
890b0f027
bc08fad23
d127ec478
890b0f027
d127ec478
c2beffd03



68616208e













d9ec1f482


68616208e
d9ec1f482

68616208e
d9ec1f482
68616208e
68616208e
d9ec1f482
68616208e



d9ec1f482


daa7ef352
d9ec1f482

daa7ef352

d9ec1f482
cb1f3fcb6
daa7ef352


d9ec1f482


890b0f027
d9ec1f482

















































890b0f027

890b0f027

d9ec1f482
890b0f027

d9ec1f482
890b0f027
5505f084a
890b0f027


d9ec1f482
890b0f027


d9ec1f482

890b0f027
d9ec1f482

890b0f027

890b0f027

d9ec1f482
890b0f027

d9ec1f482
890b0f027




d9ec1f482
890b0f027





d9ec1f482
890b0f027


07f0c900d
c2beffd03
68616208e

d9ec1f482
890b0f027

9f70e82e7
890b0f027






c2beffd03
890b0f027
c621f76b4
68616208e


daa7ef352


d9ec1f482


c2beffd03
d9ec1f482
890b0f027
68616208e



d9ec1f482



68616208e
c2beffd03
d127ec478
c2beffd03


68616208e

d9ec1f482
68616208e


d9ec1f482
bc08fad23

d9ec1f482
68616208e
d9ec1f482





68616208e
68616208e














daa7ef352

daa7ef352
d9ec1f482






68616208e















daa7ef352


d9ec1f482





68616208e



c2beffd03

c2beffd03
68616208e
c2beffd03

68616208e



c2beffd03
b4ccfc8ea
c2beffd03
68616208e
c2beffd03
68616208e






daa7ef352







d9ec1f482















68616208e

c2beffd03

0def81552

































c2beffd03
890b0f027











0def81552
890b0f027

0def81552


890b0f027












































a4e3a5f28
890b0f027





c2beffd03

68616208e


daa7ef352
890b0f027

















d9ec1f482



68616208e





d9ec1f482
68616208e
d9ec1f482



4f85ebbbe

c2beffd03

68616208e

c2beffd03
68616208e
c2beffd03
68616208e

c2beffd03
68616208e








bc08fad23
68616208e

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
  

                                                 













                                                                              

        

   
                   
 


                                 
                               
                                  
                      
                       
 
                         

                         

                                   



                                                                                                                                              
                           
                       
                      
                          

                                 

                                

  

                                                                             









                                                                         
                     


                      
  
 

                                         


                                    
                              
 
                                   













                                                                         
                                                                     


                                                                    
 


                    
           


                                                    
 

                         
 


                                                                       
         

                                      

                          




                                                                                  
                                                    
                                                                      
                                               
 

                                                                  
                             




                                 
                                          

                                                     
                            
 
                                             
                            
         
                                                                      



           













                                                                                     


                                 
 

                                                                    
 
                                                      
 
                                                                                      
                                                                         



                                                                                        


                                  
 

                                                                    

                         
                                                       
                                                                                 


           


                              
 

















































                                                                      

                                       

                 
                                                       

                                                                  
                                                               
         
                                                                   


                                            
                                                                               


           

                                           
 

                                                                    

                                       

                 
                                                       

                                                                  
                                                               




                                        
                                                                   





                                                                                          
                                                                    


           
                                                   
 

                                           
                                                                        

                                           
 






                                                                                   
 
                                                       
 


                                                                              


                                                                               


                                                                           
 
                                                               
                                                           



                                                                                  



                                                                                  
         
 
                                                                       


           

                                                      
                                                                          


                                           
                                                                        

                                 
                                                               
 





                                                                                  
         














                                                                                              

                                                                             
                              






                                                                                        















                                                                                              


                                                                            





                                                                       



           

                                                                
                                                            
                                                                

                                                        



                                                                       
 
                                                                   
                                                    
                                                          
 






                                                                                  







                                                                                   















                                                                                       

                                                                                    

 

































                                                                                  
           











                                                                     
                                                      

                                                     


                                                                                    












































                                                                         
                                            





                                                     

                                                      


                                                                 
                                      

















                                                                                    



                                                                   





                                                                   
                                                       
 



                                     

                                                         

 

                                                             
 
                                                                    
 

                                     
 








                                                             
                                                   

                                                       
/*
 *  Copyright (C) 2003, 2004 Marco Pesenti Gritti
 *  Copyright (C) 2003, 2004 Christian Persch
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  $Id$
 */

#include "config.h"

#include "ephy-location-action.h"
#include "ephy-location-entry.h"
#include "ephy-shell.h"
#include "ephy-favicon-cache.h"
#include "ephy-completion-model.h"
#include "ephy-link.h"
#include "ephy-debug.h"

#include <gtk/gtkentry.h>
#include <gtk/gtkstock.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkentrycompletion.h>

#define EPHY_LOCATION_ACTION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_LOCATION_ACTION, EphyLocationActionPrivate))

struct _EphyLocationActionPrivate
{
    EphyWindow *window;
    GList *actions;
    char *address;
    gboolean editable;
    EphyNode *smart_bmks;
    EphyBookmarks *bookmarks;
    char *icon;
    EphyFaviconCache *cache;
};

static void ephy_location_action_init       (EphyLocationAction *action);
static void ephy_location_action_class_init (EphyLocationActionClass *class);
static void ephy_location_action_finalize   (GObject *object);
static void user_changed_cb         (GtkWidget *proxy,
                         EphyLocationAction *action);
static void sync_address            (GtkAction *action,
                         GParamSpec *pspec,
                         GtkWidget *proxy);

enum
{
    PROP_0,
    PROP_ADDRESS,
    PROP_EDITABLE,
    PROP_ICON,
    PROP_WINDOW
};

static GObjectClass *parent_class = NULL;

GType
ephy_location_action_get_type (void)
{
    static GType type = 0;

    if (G_UNLIKELY (type == 0))
    {
        static const GTypeInfo type_info =
        {
            sizeof (EphyLocationActionClass),
            (GBaseInitFunc) NULL,
            (GBaseFinalizeFunc) NULL,
            (GClassInitFunc) ephy_location_action_class_init,
            (GClassFinalizeFunc) NULL,
            NULL,
            sizeof (EphyLocationAction),
            0, /* n_preallocs */
            (GInstanceInitFunc) ephy_location_action_init,
        };

        type = g_type_register_static (EPHY_TYPE_LINK_ACTION,
                           "EphyLocationAction",
                           &type_info, 0);
    }

    return type;
}

static void
action_activated_cb (GtkEntryCompletion *completion,
                     gint index,
             EphyLocationAction *action)
{
    GtkWidget *entry;
    char *content;

    entry = gtk_entry_completion_get_entry (completion);
    content = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
    if (content)
    {
        EphyNode *node;
        const char *smart_url;
        char *url;

        node = (EphyNode *)g_list_nth_data (action->priv->actions, index);
        smart_url = ephy_node_get_property_string
                    (node, EPHY_NODE_BMK_PROP_LOCATION);
        g_return_if_fail (smart_url != NULL);

        url = ephy_bookmarks_solve_smart_url
            (action->priv->bookmarks, smart_url, content);
        g_return_if_fail (url != NULL);

        ephy_link_open (EPHY_LINK (action), url, NULL, 0);
    
        g_free (url);
        g_free (content);
    }
}

static void
location_url_activate_cb (GtkEntry *entry,
              EphyLocationAction *action)
{
    const char *content;

    content = gtk_entry_get_text (entry);
    if (content != NULL)
    {
        ephy_link_open (EPHY_LINK (action), content, NULL, 0);
    }
}

static void
user_changed_cb (GtkWidget *proxy, EphyLocationAction *action)
{
    const char *address;

    address = ephy_location_entry_get_location (EPHY_LOCATION_ENTRY (proxy));

    LOG ("user_changed_cb, new address %s", address)

    g_signal_handlers_block_by_func (action, G_CALLBACK (sync_address), proxy);
    ephy_location_action_set_address (action, address);
    g_signal_handlers_unblock_by_func (action, G_CALLBACK (sync_address), proxy);
}

static void
sync_address (GtkAction *gaction,
          GParamSpec *pspec,
          GtkWidget *proxy)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
    EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);

    LOG ("sync_address %s", action->priv->address)

    g_signal_handlers_block_by_func (proxy, G_CALLBACK (user_changed_cb), action);
    ephy_location_entry_set_location (lentry, action->priv->address);
    g_signal_handlers_unblock_by_func (proxy, G_CALLBACK (user_changed_cb), action);
}

static void
sync_editable (GtkAction *gaction,
           GParamSpec *pspec,
           GtkWidget *proxy)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
    EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);
    GtkWidget *entry;

    entry = ephy_location_entry_get_entry (lentry);
    gtk_editable_set_editable (GTK_EDITABLE (entry), action->priv->editable);
}

static void
sync_icon (GtkAction *gaction,
       GParamSpec *pspec,
       GtkWidget *proxy)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
    EphyLocationActionPrivate *priv = action->priv;
    EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (proxy);
    GtkWidget *image;
    GdkPixbuf *pixbuf;

    image = ephy_location_entry_get_image (entry);
    pixbuf = ephy_favicon_cache_get (priv->cache, priv->icon);

    if (pixbuf != NULL)
    {
        gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
        g_object_unref (pixbuf);
    }
    else
    {
        gtk_image_set_from_stock (GTK_IMAGE (image),
                      GTK_STOCK_NEW,
                      GTK_ICON_SIZE_MENU);
    }
}

static char *
get_location_cb (EphyLocationEntry *entry,
        EphyLocationAction *action)
{
    EphyEmbed *embed;
    
    embed = ephy_window_get_active_embed (action->priv->window);
    
    return ephy_embed_get_location (embed, TRUE);
}

static char *
get_title_cb (EphyLocationEntry *entry,
          EphyLocationAction *action)
{
    EphyTab *tab;

    tab = ephy_window_get_active_tab (action->priv->window);

    return g_strdup (ephy_tab_get_title (tab));
}

static void
remove_completion_actions (GtkAction *gaction,
               GtkWidget *proxy)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
    EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);
    GtkWidget *entry;
    GtkEntryCompletion *completion;
    GList *l;

    entry = ephy_location_entry_get_entry (lentry);
    completion = gtk_entry_get_completion (GTK_ENTRY (entry));

    for (l = action->priv->actions; l != NULL; l = l->next)
    {
        gtk_entry_completion_delete_action (completion, 0);
    }

    g_signal_handlers_disconnect_by_func
            (completion, G_CALLBACK (action_activated_cb), action);
}

static void
add_completion_actions (GtkAction *gaction,
            GtkWidget *proxy)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (gaction);
    EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);
    GtkWidget *entry;
    GtkEntryCompletion *completion;
    GList *l;

    entry = ephy_location_entry_get_entry (lentry);
    completion = gtk_entry_get_completion (GTK_ENTRY (entry));

    for (l = action->priv->actions; l != NULL; l = l->next)
    {
        EphyNode *bmk = l->data;
        const char *title;
        int index;

        index = g_list_position (action->priv->actions, l);
        title = ephy_node_get_property_string
                    (bmk, EPHY_NODE_BMK_PROP_TITLE);
        gtk_entry_completion_insert_action_text (completion, index, (char*)title);
    }

    g_signal_connect (completion, "action_activated",
              G_CALLBACK (action_activated_cb), action);
}

static void
connect_proxy (GtkAction *action, GtkWidget *proxy)
{
    if (EPHY_IS_LOCATION_ENTRY (proxy))
    {
        EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);
        EphyCompletionModel *model;
        GtkWidget *entry;

        model = ephy_completion_model_new ();
        ephy_location_entry_set_completion (EPHY_LOCATION_ENTRY (proxy),
                            GTK_TREE_MODEL (model),
                            EPHY_COMPLETION_TEXT_COL,
                            EPHY_COMPLETION_ACTION_COL,
                            EPHY_COMPLETION_KEYWORDS_COL,
                            EPHY_COMPLETION_RELEVANCE_COL);

        add_completion_actions (action, proxy);

        sync_address (action, NULL, proxy);
        g_signal_connect_object (action, "notify::address",
                     G_CALLBACK (sync_address), proxy, 0);
        sync_editable (action, NULL, proxy);
        g_signal_connect_object (action, "notify::editable",
                     G_CALLBACK (sync_editable), proxy, 0);
        sync_icon (action, NULL, proxy);
        g_signal_connect_object (action, "notify::icon",
                     G_CALLBACK (sync_icon), proxy, 0);

        entry = ephy_location_entry_get_entry (lentry);
        g_signal_connect_object (entry, "activate",
                     G_CALLBACK (location_url_activate_cb),
                     action, 0);
        g_signal_connect_object (proxy, "user_changed",
                     G_CALLBACK (user_changed_cb), action, 0);
        g_signal_connect_object (proxy, "get-location",
                     G_CALLBACK (get_location_cb), action, 0);
        g_signal_connect_object (proxy, "get-title",
                     G_CALLBACK (get_title_cb), action, 0);
    }

    GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
}

static void
disconnect_proxy (GtkAction *action, GtkWidget *proxy)
{
    GTK_ACTION_CLASS (parent_class)->disconnect_proxy (action, proxy);

    if (EPHY_IS_LOCATION_ENTRY (proxy))
    {
        EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (proxy);
        GtkWidget *entry;

        entry = ephy_location_entry_get_entry (lentry);

        g_signal_handlers_disconnect_matched (action, G_SIGNAL_MATCH_DATA,
                              0, 0, NULL, NULL, proxy);
        g_signal_handlers_disconnect_matched (proxy, G_SIGNAL_MATCH_DATA,
                              0, 0, NULL, NULL, action);
        g_signal_handlers_disconnect_matched (entry, G_SIGNAL_MATCH_DATA,
                              0, 0, NULL, NULL, action);
    }
}

static void
ephy_location_action_set_property (GObject *object,
                   guint prop_id,
                   const GValue *value,
                   GParamSpec *pspec)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (object);

    switch (prop_id)
    {
        case PROP_ADDRESS:
            ephy_location_action_set_address (action, g_value_get_string (value));
            break;
        case PROP_EDITABLE:
            action->priv->editable = g_value_get_boolean (value);
            break;
        case PROP_ICON:
            g_free (action->priv->icon);
            action->priv->icon = g_value_dup_string (value);
            break;
        case PROP_WINDOW:
            action->priv->window = EPHY_WINDOW (g_value_get_object (value));
            break;
    }
}

static void
ephy_location_action_get_property (GObject *object,
                   guint prop_id,
                   GValue *value,
                   GParamSpec *pspec)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (object);

    switch (prop_id)
    {
        case PROP_ADDRESS:
            g_value_set_string (value, ephy_location_action_get_address (action));
            break;
        case PROP_EDITABLE:
            g_value_set_boolean (value, action->priv->editable);
            break;
        case PROP_ICON:
            g_value_set_string (value, action->priv->icon);
            break;
        case PROP_WINDOW:
            /* not readable */
            break;
    }
}

static void
ephy_location_action_class_init (EphyLocationActionClass *class)
{
    GObjectClass *object_class = G_OBJECT_CLASS (class);
    GtkActionClass *action_class = GTK_ACTION_CLASS (class);

    parent_class = g_type_class_peek_parent (class);

    object_class->finalize = ephy_location_action_finalize;
    object_class->get_property = ephy_location_action_get_property;
    object_class->set_property = ephy_location_action_set_property;

    action_class->toolbar_item_type = EPHY_TYPE_LOCATION_ENTRY;
    action_class->connect_proxy = connect_proxy;
    action_class->disconnect_proxy = disconnect_proxy;

    g_object_class_install_property (object_class,
                     PROP_ADDRESS,
                     g_param_spec_string ("address",
                                  "Address",
                                  "The address",
                                  "",
                                  G_PARAM_READWRITE));
    g_object_class_install_property (object_class,
                     PROP_EDITABLE,
                     g_param_spec_boolean ("editable",
                                   "Editable",
                                   "Editable",
                                   TRUE,
                                   G_PARAM_READWRITE));

    g_object_class_install_property (object_class,
                     PROP_ICON,
                     g_param_spec_string  ("icon",
                                   "Icon",
                                   "The icon",
                                   NULL,
                                   G_PARAM_READWRITE));

    g_object_class_install_property (object_class,
                     PROP_WINDOW,
                     g_param_spec_object ("window",
                                  "Window",
                                  "The navigation window",
                                  G_TYPE_OBJECT,
                                  G_PARAM_WRITABLE |
                                  G_PARAM_CONSTRUCT_ONLY));

    g_type_class_add_private (object_class, sizeof (EphyLocationActionPrivate));
}

static int
compare_actions (gconstpointer a,
         gconstpointer b)
{
        EphyNode *node_a = (EphyNode *)a;
        EphyNode *node_b = (EphyNode *)b;
    const char *title1, *title2;
    int retval;

    title1 = ephy_node_get_property_string (node_a, EPHY_NODE_BMK_PROP_TITLE);
    title2 = ephy_node_get_property_string (node_b, EPHY_NODE_BMK_PROP_TITLE);

    if (title1 == NULL)
    {
        retval = -1;
    }
    else if (title2 == NULL)
    {
        retval = 1;
    }
    else
    {
        char *str_a, *str_b;

        str_a = g_utf8_casefold (title1, -1);
        str_b = g_utf8_casefold (title2, -1);
        retval = g_utf8_collate (str_a, str_b);
        g_free (str_a);
        g_free (str_b);
    }

    return retval;
}

static void
init_actions_list (EphyLocationAction *action)
{
    GPtrArray *children;
    int i;

    children = ephy_node_get_children (action->priv->smart_bmks);
    for (i = 0; i < children->len; i++)
    {
        EphyNode *kid;

        kid = g_ptr_array_index (children, i);

        action->priv->actions = g_list_prepend
            (action->priv->actions, kid);
    }

    action->priv->actions =
        g_list_sort (action->priv->actions, (GCompareFunc) compare_actions);
}

static void
update_actions_list (EphyLocationAction *la)
{
    GSList *l;
    GtkAction *action = GTK_ACTION (la);

    l = gtk_action_get_proxies (action);
    for (; l != NULL; l = l->next)
    {
        remove_completion_actions (action, GTK_WIDGET (l->data));
    }

    g_list_free (la->priv->actions);
    la->priv->actions = NULL;
    init_actions_list (la);

    l = gtk_action_get_proxies (action);
    for (; l != NULL; l = l->next)
    {
        add_completion_actions (action, l->data);
    }
}

static void
actions_child_removed_cb (EphyNode *node,
                  EphyNode *child,
                  guint old_index,
                  EphyLocationAction *action)
{
    update_actions_list (action);
}

static void
actions_child_added_cb (EphyNode *node,
                EphyNode *child,
                EphyLocationAction *action)
{
    update_actions_list (action);
}

static void
actions_child_changed_cb (EphyNode *node,
                  EphyNode *child,
              guint property_id,
                  EphyLocationAction *action)
{
    update_actions_list (action);
}

static void
ephy_location_action_init (EphyLocationAction *action)
{
    action->priv = EPHY_LOCATION_ACTION_GET_PRIVATE (action);

    action->priv->address = g_strdup ("");
    action->priv->editable = TRUE;
    action->priv->bookmarks = ephy_shell_get_bookmarks (ephy_shell);
    action->priv->smart_bmks = ephy_bookmarks_get_smart_bookmarks
        (action->priv->bookmarks);

    init_actions_list (action);

    ephy_node_signal_connect_object (action->priv->smart_bmks,
                             EPHY_NODE_CHILD_ADDED,
                             (EphyNodeCallback)actions_child_added_cb,
                             G_OBJECT (action));
    ephy_node_signal_connect_object (action->priv->smart_bmks,
                             EPHY_NODE_CHILD_REMOVED,
                             (EphyNodeCallback)actions_child_removed_cb,
                             G_OBJECT (action));
    ephy_node_signal_connect_object (action->priv->smart_bmks,
                             EPHY_NODE_CHILD_CHANGED,
                             (EphyNodeCallback)actions_child_changed_cb,
                             G_OBJECT (action));

    action->priv->cache = EPHY_FAVICON_CACHE
        (ephy_embed_shell_get_favicon_cache (embed_shell));
    g_object_ref (action->priv->cache);
}

static void
ephy_location_action_finalize (GObject *object)
{
    EphyLocationAction *action = EPHY_LOCATION_ACTION (object);
    EphyLocationActionPrivate *priv = action->priv;

    g_list_free (priv->actions);
    g_free (priv->address);
    g_free (action->priv->icon);
    g_object_unref (priv->cache);

    G_OBJECT_CLASS (parent_class)->finalize (object);
}

const char *
ephy_location_action_get_address (EphyLocationAction *action)
{
    g_return_val_if_fail (EPHY_IS_LOCATION_ACTION (action), "");

    return action->priv->address;
}

void
ephy_location_action_set_address (EphyLocationAction *action,
                  const char *address)
{
    g_return_if_fail (EPHY_IS_LOCATION_ACTION (action));

    LOG ("set_address %s", address)

    g_free (action->priv->address);
    action->priv->address = g_strdup (address);
    g_object_notify (G_OBJECT (action), "address");
}