~jeremywootten/pantheon-files/fix-hang-on-large-copy

« back to all changes in this revision

Viewing changes to src/gof-window-slot.c

  • Committer: am.monkeyd at gmail
  • Date: 2011-01-07 18:24:29 UTC
  • mto: This revision was merged to the branch mainline in revision 124.
  • Revision ID: am.monkeyd@gmail.com-20110107182429-1b6mq9we02380405
new cached files API
reuse cached dirs/files, never reload dir or files already loaded
monitor signal implemented add/remove ..
unref all references from marlin_view_window_get_active_slot
some clean ups

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
}
99
99
#endif
100
100
 
101
 
#if 0
102
 
void
103
 
gof_window_slot_change_location (GOFWindowSlot *slot, GFile *location)
104
 
{
105
 
    GtkWidget *window = slot->window;
106
 
 
107
 
    //TODO add if not end loaded
108
 
    load_dir_async_cancel(slot->directory);
109
 
    /*g_object_unref(slot->directory);
110
 
      g_object_unref(slot->location);*/
111
 
    //g_object_unref(slot->list_view);
112
 
    //gtk_widget_destroy (slot->view_box);
113
 
 
114
 
    slot = gof_window_slot_new (location, GTK_WIDGET (window));
115
 
    //marlin_window_set_active_slot (MARLIN_WINDOW (window), slot);
116
 
 
117
 
    /*slot->location = location;
118
 
      slot->directory = gof_directory_async_new(location);
119
 
      slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_LIST_VIEW,
120
 
      "window-slot", slot, NULL));*/
121
 
    /*slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_COLUMNS_VIEW,
122
 
      "window-slot", slot, NULL));*/
123
 
    //gtk_container_add( GTK_CONTAINER(slot->window), GTK_WIDGET (slot->view_box));
124
 
    //gtk_widget_show(slot->view_box);
125
 
    //gtk_widget_show_all(slot->view_box);
126
 
    //load_dir_async (slot->directory);
127
 
}
128
 
#endif
129
101
 
130
102
void
131
103
gof_window_column_add (GOFWindowSlot *slot, GtkWidget *column)
181
153
static void
182
154
gof_window_slot_finalize (GObject *object)
183
155
{
184
 
    log_printf (LOG_LEVEL_UNDEFINED, "%s\n", G_STRFUNC);
185
156
    GOFWindowSlot *slot = GOF_WINDOW_SLOT (object);
 
157
    log_printf (LOG_LEVEL_UNDEFINED, "%s %s\n", G_STRFUNC, g_file_get_uri (slot->directory->location));
186
158
 
187
159
    //load_dir_async_cancel(slot->directory);
188
160
    g_object_unref(slot->directory);
189
161
    /*g_object_unref(slot->location);*/
190
162
    G_OBJECT_CLASS (parent_class)->finalize (object);
 
163
    printf ("test %s\n", G_STRFUNC);
 
164
    /* avoid a warning in vala code: slot is freed in ViewContainer */
 
165
    slot = NULL;
191
166
}
192
167
 
193
168
GOFWindowSlot *
194
169
gof_window_slot_new (GFile *location, GObject *ctab)
195
170
{
196
 
    log_printf (LOG_LEVEL_UNDEFINED, "%s\n", G_STRFUNC);
 
171
    log_printf (LOG_LEVEL_UNDEFINED, "%s %s\n", G_STRFUNC, g_file_get_uri (location));
197
172
    GOFWindowSlot *slot;
198
173
    slot = g_object_new (GOF_TYPE_WINDOW_SLOT, NULL);
199
174
    slot->location = location;
200
175
    slot->ctab = ctab;
201
176
 
202
 
    slot->directory = gof_directory_async_new(slot->location);
 
177
    //amtest
 
178
    //slot->directory = gof_directory_async_new(slot->location);
 
179
    slot->directory = gof_directory_get (slot->location);
203
180
    /*slot->view_box = GTK_WIDGET (g_object_new (FM_TYPE_LIST_VIEW,
204
181
                                               "window-slot", slot, NULL));*/
205
182
    //slot->view_box = gtk_label_new ("test");