Re: Trash LocationWidgetProvider



Thanks again for the feedback.  I've updated the patch.  I originally
misunderstood what you meant about not using the extensions for core
internals, but I think I get it now.

This new patch has a few improvements:
1) the trash-bar files have been moved into src/ which more closely
mirrors what's currently done for search-bars.
2) the nautilus-trash-directory object no longer implements the
LocationWidgetProvider interface.
3) nautilus_trash_directory_bar_get_button() is removed.
4) the nautilus-window-manage-views.c code has been updated to not
leak the directory.

However, I have a few questions.  Now that the
NautilusLocationWidgetProvider interface is no longer used, I needed
to add the empty-trash callback to the trash-bar.  This is currently
done when I create the bar in nautilus-window-manage-views.c which
feels wrong, but I don't know where else to put it.

Also, it seems that the code that is in nautilus-window-manage-views.c
creates a bar which is never cleaned up anywhere. but this may be
because I'm not familiar with
nautilus_window_add_extra_location_widget () and how it cleans up
after itself.

Lakin


On 2/17/06, Alexander Larsson <alexl redhat com> wrote:
> On Tue, 2006-02-14 at 00:02 -0700, Lakin Wecker wrote:
> > FIrst off, thanks for the positive feedback.  I figured it would be
> > too late coming for the current release cycle, but I'm excited to hear
> > that it might make it in for the next.
> >
> > I've addressed all of the issues which Alex raised in his previous
> > email, and uploaded the new patch to:
> > http://pages.cpsc.ucalgary.ca/~weckerl/nautilus_patch.html
>
> @@ -1224,6 +1226,17 @@
>                 update_extra_location_widgets_visibility (window);
>         }
>
> +       directory = nautilus_directory_get (window->details->location);
> +       if (NAUTILUS_IS_TRASH_DIRECTORY (directory)) {
> +               widget = nautilus_location_widget_provider_get_widget (NAUTILUS_LOCATION_WIDGET_PROVIDER (directory),
> +                                                                     window->details->location,
> +                                                                     GTK_WIDGET (window));
> +               if (widget != NULL) {
> +                       nautilus_window_add_extra_location_widget (window, widget);
> +               }
> +               update_extra_location_widgets_visibility (window);
> +       }
> +
>
> This leaks the directory, and isn't what i meant. Something more like:
> @@ -1217,6 +1217,10 @@ update_for_new_location (NautilusWindow
>                 } else {
>                         nautilus_window_set_search_mode (window, FALSE, NULL);
>                 }
> +               if (NAUTILUS_IS_TRASH_DIRECTORY (directory)) {
> +                       nautilus_window_add_extra_location_widget (window,
> +                                                                  nautilus_trash_directory_bar_new ());
> +               }
>                 nautilus_directory_unref (directory);
>
> Also, nautilus_trash_directory_bar_get_button() isn't needed anymore.
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                            Red Hat, Inc
>                    alexl redhat com    alla lysator liu se
> He's a bookish arachnophobic Green Beret plagued by the memory of his family's
> brutal murder. She's a vivacious Buddhist doctor who inherited a spooky
> stately manor from her late maiden aunt. They fight crime!
>
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]