~ubuntu-branches/ubuntu/raring/thunar/raring-proposed

« back to all changes in this revision

Viewing changes to thunar/thunar-location-button.c

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-12-03 13:13:58 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20121203131358-zk6tkel37d732wh6
Tags: 1.6.0-0ubuntu1
* Upload to raring.
* Remaining Ubuntu change:
  - debian/control: recommend udisks2 for mounting devices. lp: #1014632
* Drop obsolete Ubuntu changes:
  - debian/patches/02_guard-for-no-supported-vfs-schemas.patch,
    debian/patches/xubuntu_fix-duplicate-volumes.patch: included upstream.
* Bugs fixed:
  - "Thunar: sendto_printer broken" lp: #1061846
  - "segfault when a specific html file is selected" lp: #751739
  - "can't book mark remote shares" lp: #778268
  - "Thunar crashed with SIGSEGV in thunarx_menu_provider_get_file_actions()
    thinking a directory was a file" lp: #852410
  - "Left or right-clicking on 3MB or bigger svg file is unresponsive"
    lp: #893330
  - "Thunar crashed with SIGSEGV in fast_validate()" lp: #913041
  - "Thunar crashed with SIGSEGV in thunar_file_get_display_name()"
    lp: #931101
  - "Thunar crashed with SIGSEGV in sort_by_mime_type()" lp: #931842
  - "Thunar crashed with SIGSEGV in thunar_util_parse_parent()" lp: #969222
  - "thunar crashed with SIGSEGV in thunar_standard_view_cancel_thumbnailing()"
    lp: #1059397
  - "Does not unmount USB drive when you try first time" lp: #1059997
  - "regression: thunar no longer shows all unmounted, but mountable, volumes
    in sidepane" lp: #1068947
  - "Thunar shows folder sizes wrong" lp: #59235
  - "Right-click "Open With" list not refreshing" lp: #107392
  - "no thunar contextmenu with GTK setting "gtk-menu-popup-delay = 0""
    lp: #127372
  - "rename folder, still active but answers not on 'Enter'" lp: #479975
  - "Thunar hangs on first launch of each session" lp: #775117
  - "emblems disappear on rename" lp: #877755
  - "Remote Deleted file in Thunar remains visible until resfresh" lp: #999824
  - "Incorrect alphabetical sort order in thunar with non-latin (eg. cyrillic)
    file names" lp: #684317
  - "Thunar does not display current folder name" lp: #875193
  - "Thunar crashed with SIGSEGV in g_file_equal()" lp: #900306
  - "Hard to see, if volume is mounted or not" lp: #838917

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
  ThunarFileIconState file_icon_state;
138
138
  
139
139
  /* enter folders using DnD */
140
 
  gint                enter_timeout_id;
 
140
  guint               enter_timeout_id;
141
141
 
142
142
  /* drop support for the button */
143
143
  GList              *drop_file_list;
263
263
 
264
264
  /* create the toggle button */
265
265
  button = gtk_toggle_button_new ();
266
 
  GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS);
 
266
  gtk_widget_set_can_focus (button, FALSE);
267
267
  g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (thunar_location_button_clicked), location_button);
268
268
  exo_mutual_binding_new (G_OBJECT (location_button), "active", G_OBJECT (button), "active");
269
269
  gtk_container_add (GTK_CONTAINER (location_button), button);
424
424
  GtkIconTheme      *icon_theme;
425
425
  GtkSettings       *settings;
426
426
  GdkPixbuf         *icon;
427
 
  gchar             *icon_name;
 
427
  const gchar       *icon_name;
428
428
  gint               height;
429
429
  gint               width;
430
430
  gint               size;
 
431
  const gchar       *custom_icon;
431
432
 
432
433
  _thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTON (location_button));
433
434
  _thunar_return_if_fail (location_button->file == file);
479
480
    }
480
481
 
481
482
  /* setup the DnD icon for the button */
482
 
  icon_name = thunar_file_get_custom_icon (file);
483
 
  if (icon_name == NULL)
484
 
    {
485
 
      icon_name = thunar_file_get_icon_name (file, location_button->file_icon_state, 
486
 
                                             icon_theme);
487
 
    }
488
 
  gtk_drag_source_set_icon_name (GTK_BIN (location_button)->child, icon_name);
489
 
  g_free (icon_name);
 
483
  custom_icon = thunar_file_get_custom_icon (file);
 
484
  if (custom_icon != NULL)
 
485
    {
 
486
      gtk_drag_source_set_icon_name (GTK_BIN (location_button)->child, custom_icon);
 
487
    }
 
488
  else
 
489
    {
 
490
      icon_name = thunar_file_get_icon_name (file, location_button->file_icon_state, icon_theme);
 
491
      gtk_drag_source_set_icon_name (GTK_BIN (location_button)->child, icon_name);
 
492
    }
490
493
}
491
494
 
492
495
 
634
637
                                      guint                 timestamp,
635
638
                                      ThunarLocationButton *location_button)
636
639
{
637
 
  gchar *uri_string;
638
 
  GList  path_list;
 
640
  gchar **uris;
 
641
  GList   path_list;
639
642
 
640
643
  _thunar_return_if_fail (GTK_IS_WIDGET (button));
641
644
  _thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTON (location_button));
644
647
  if (G_LIKELY (location_button->file != NULL))
645
648
    {
646
649
      /* transform the path into an uri list string */
647
 
      path_list.data = thunar_file_get_file (location_button->file); path_list.next = path_list.prev = NULL;
648
 
      uri_string = thunar_g_file_list_to_string (&path_list);
 
650
      path_list.next = path_list.prev = NULL;
 
651
      path_list.data = thunar_file_get_file (location_button->file);
649
652
 
650
653
      /* set the uri list for the drag selection */
651
 
      gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar *) uri_string, strlen (uri_string));
652
 
 
653
 
      /* cleanup */
654
 
      g_free (uri_string);
 
654
      uris = thunar_g_file_list_to_stringv (&path_list);
 
655
      gtk_selection_data_set_uris (selection_data, uris);
 
656
      g_strfreev (uris);
655
657
    }
656
658
}
657
659
 
968
970
      g_signal_connect_swapped (G_OBJECT (file), "destroy", G_CALLBACK (thunar_location_button_file_destroy), location_button);
969
971
 
970
972
      /* update our internal state for the new file (if realized) */
971
 
      if (GTK_WIDGET_REALIZED (location_button))
 
973
      if (gtk_widget_get_realized (GTK_WIDGET (location_button)))
972
974
        thunar_location_button_file_changed (location_button, file);
973
975
    }
974
976