[Xfce4-commits] [xfce/xfdesktop] 01/02: Remove trailing whitespace
noreply at xfce.org
noreply at xfce.org
Sat Dec 22 02:43:25 CET 2018
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfdesktop.
commit 870a7cb3bcce3a83427b6ab609424f332afe2f6f
Author: Andre Miranda <andreldm at xfce.org>
Date: Fri Dec 21 22:32:48 2018 -0300
Remove trailing whitespace
---
backgrounds/Makefile.am | 2 +-
common/xfdesktop-thumbnailer.c | 6 +-
settings/xfce-backdrop-settings.desktop.in | 2 +-
settings/xfce-backdrop-settings.desktop.in.in | 2 +-
src/menu.c | 2 +-
src/windowlist.c | 40 +--
src/xfce-backdrop.c | 54 ++--
src/xfce-backdrop.h | 4 +-
src/xfdesktop-clipboard-manager.c | 6 +-
src/xfdesktop-file-icon-manager.c | 404 ++++++++++++-------------
src/xfdesktop-file-icon-manager.h | 2 +-
src/xfdesktop-file-icon.c | 44 +--
src/xfdesktop-file-icon.h | 4 +-
src/xfdesktop-file-utils.h | 4 +-
src/xfdesktop-icon-view-manager.c | 36 +--
src/xfdesktop-icon-view-manager.h | 4 +-
src/xfdesktop-icon-view.c | 420 +++++++++++++-------------
src/xfdesktop-icon-view.h | 4 +-
src/xfdesktop-icon.c | 64 ++--
src/xfdesktop-icon.h | 16 +-
src/xfdesktop-notify.c | 20 +-
src/xfdesktop-notify.h | 6 +-
src/xfdesktop-regular-file-icon.c | 66 ++--
src/xfdesktop-regular-file-icon.h | 2 +-
src/xfdesktop-special-file-icon.c | 76 ++---
src/xfdesktop-special-file-icon.h | 2 +-
src/xfdesktop-volume-icon.c | 120 ++++----
src/xfdesktop-volume-icon.h | 2 +-
src/xfdesktop-window-icon-manager.c | 140 ++++-----
src/xfdesktop-window-icon-manager.h | 2 +-
src/xfdesktop-window-icon.c | 34 +--
src/xfdesktop-window-icon.h | 2 +-
32 files changed, 796 insertions(+), 796 deletions(-)
diff --git a/backgrounds/Makefile.am b/backgrounds/Makefile.am
index 901aa1c..f1efb74 100644
--- a/backgrounds/Makefile.am
+++ b/backgrounds/Makefile.am
@@ -6,6 +6,6 @@ backgroundsdir = $(datadir)/backgrounds/xfce
backgrounds_DATA = \
xfce-blue.jpg \
xfce-teal.jpg
-
+
EXTRA_DIST = $(backgrounds_DATA)
diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c
index 9367350..cc0bcdf 100644
--- a/common/xfdesktop-thumbnailer.c
+++ b/common/xfdesktop-thumbnailer.c
@@ -352,7 +352,7 @@ xfdesktop_thumbnailer_dequeue_foreach(gpointer data, gpointer user_data)
/**
* xfdesktop_thumbnailer_dequeue_thumbnail:
- *
+ *
* Removes a file from the list of pending thumbnail creations.
* This is not guaranteed to always remove the file, if processing
* of that thumbnail has started it won't stop.
@@ -573,7 +573,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(TumblerThumbnailer1 *proxy,
} else {
iter = g_slist_next(iter);
}
-
+
g_object_unref(file);
g_free(f_uri);
}
@@ -581,7 +581,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(TumblerThumbnailer1 *proxy,
/**
* xfdesktop_thumbnailer_delete_thumbnail:
- *
+ *
* Tells the thumbnail service the src_file will be deleted.
* This function should be called when the file is deleted or moved so
* the thumbnail file doesn't take up space on the user's drive.
diff --git a/settings/xfce-backdrop-settings.desktop.in b/settings/xfce-backdrop-settings.desktop.in
index b735f50..33e5566 100644
--- a/settings/xfce-backdrop-settings.desktop.in
+++ b/settings/xfce-backdrop-settings.desktop.in
@@ -1,6 +1,6 @@
[Desktop Entry]
Version=1.0
-_Name=Desktop
+_Name=Desktop
_Comment=Set desktop background and menu and icon behavior
Exec=xfdesktop-settings
Icon=preferences-desktop-wallpaper
diff --git a/settings/xfce-backdrop-settings.desktop.in.in b/settings/xfce-backdrop-settings.desktop.in.in
index 99a5cf2..e0898d6 100644
--- a/settings/xfce-backdrop-settings.desktop.in.in
+++ b/settings/xfce-backdrop-settings.desktop.in.in
@@ -1,6 +1,6 @@
[Desktop Entry]
Version=1.0
-_Name=Desktop
+_Name=Desktop
_Comment=Set desktop background and menu and icon behavior
Exec=xfdesktop-settings
Icon=preferences-desktop-wallpaper
diff --git a/src/menu.c b/src/menu.c
index df864e5..c6784a2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -124,7 +124,7 @@ menu_settings_changed(XfconfChannel *channel,
void
menu_init(XfconfChannel *channel)
-{
+{
#ifdef USE_DESKTOP_MENU
if(!channel || xfconf_channel_get_bool(channel, "/desktop-menu/show", TRUE))
{
diff --git a/src/windowlist.c b/src/windowlist.c
index 328573b..d119e99 100644
--- a/src/windowlist.c
+++ b/src/windowlist.c
@@ -104,7 +104,7 @@ static void
activate_window(GtkWidget *w, gpointer user_data)
{
WnckWindow *wnck_window = user_data;
-
+
if(!wnck_window_is_sticky(wnck_window)) {
wnck_workspace_activate(wnck_window_get_workspace(wnck_window),
gtk_get_current_event_time());
@@ -117,7 +117,7 @@ window_destroyed_cb(gpointer data, GObject *where_the_object_was)
{
GtkWidget *mi = data;
GtkWidget *menu = gtk_widget_get_parent(mi);
-
+
if(mi && menu)
gtk_container_remove(GTK_CONTAINER(menu), mi);
}
@@ -206,7 +206,7 @@ menu_item_from_wnck_window(WnckWindow *wnck_window, gint icon_width,
gtk_container_forall(GTK_CONTAINER(mi), menulist_set_label_flags,
&truncated);
-
+
return mi;
}
@@ -248,15 +248,15 @@ windowlist_populate(XfceDesktop *desktop,
GList *windows, *l;
WnckWindow *wnck_window;
gint w, h;
-
+
if(!show_windowlist)
return;
-
+
if(gtk_widget_has_screen(GTK_WIDGET(menu)))
gscreen = gtk_widget_get_screen(GTK_WIDGET(menu));
else
gscreen = gdk_display_get_default_screen(gdk_display_get_default());
-
+
/* check to see if the menu is empty. if not, add the windowlist to a
* submenu */
menu_children = gtk_container_get_children(GTK_CONTAINER(menu));
@@ -268,27 +268,27 @@ windowlist_populate(XfceDesktop *desktop,
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
mi = gtk_menu_item_new_with_label(_("Window List"));
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), tmpmenu);
menu = (GtkMenuShell *)tmpmenu;
g_list_free(menu_children);
}
-
+
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &w, &h);
wnck_screen = wnck_screen_get(XScreenNumberOfScreen(gdk_x11_screen_get_xscreen(gtk_widget_get_screen(GTK_WIDGET(menu)))));
wnck_screen_force_update (wnck_screen);
nworkspaces = wnck_screen_get_workspace_count(wnck_screen);
active_workspace = wnck_screen_get_active_workspace(wnck_screen);
-
+
for(i = 0; i < nworkspaces; i++) {
wnck_workspace = wnck_screen_get_workspace(wnck_screen, i);
submenu = (GtkWidget *)menu;
-
+
if(wl_show_ws_names || wl_submenus) {
ws_name = wnck_workspace_get_name(wnck_workspace);
@@ -300,7 +300,7 @@ windowlist_populate(XfceDesktop *desktop,
ws_label = g_strdup_printf("<b>%s</b>", ws_name_esc);
g_free(ws_name_esc);
}
-
+
mi = gtk_menu_item_new_with_label(ws_label);
g_free(ws_label);
label = gtk_bin_get_child(GTK_BIN(mi));
@@ -318,19 +318,19 @@ windowlist_populate(XfceDesktop *desktop,
G_CALLBACK(wnck_workspace_activate),
wnck_workspace);
}
-
+
if(wl_submenus) {
submenu = gtk_menu_new();
gtk_menu_set_reserve_toggle_size (GTK_MENU (submenu), FALSE);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), submenu);
}
}
-
+
windows = wnck_screen_get_windows_stacked(wnck_screen);
for(l = windows; l; l = l->next) {
wnck_window = l->data;
-
+
if((wnck_window_get_workspace(wnck_window) != wnck_workspace
&& (!wnck_window_is_sticky(wnck_window)
|| (wl_sticky_once && wnck_workspace != active_workspace)))
@@ -345,7 +345,7 @@ windowlist_populate(XfceDesktop *desktop,
*/
continue;
}
-
+
mi = menu_item_from_wnck_window(wnck_window, w, h);
if(!mi)
continue;
@@ -378,7 +378,7 @@ windowlist_populate(XfceDesktop *desktop,
g_signal_connect(G_OBJECT(mi), "destroy",
G_CALLBACK(mi_destroyed_cb), wnck_window);
}
-
+
if(!wl_submenus && (i < nworkspaces-1 || wl_add_remove_options)) {
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
@@ -397,7 +397,7 @@ windowlist_populate(XfceDesktop *desktop,
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(set_num_workspaces), GINT_TO_POINTER(nworkspaces+1));
-
+
/* 'remove workspace' item */
if(!ws_name || atoi(ws_name) == nworkspaces)
rm_label = g_strdup_printf(_("_Remove Workspace %d"), nworkspaces);
@@ -449,7 +449,7 @@ windowlist_init(XfconfChannel *channel)
show_windowlist = xfconf_channel_get_bool(channel,
"/windowlist-menu/show",
TRUE);
-
+
wl_show_icons = xfconf_channel_get_bool(channel,
"/windowlist-menu/show-icons",
TRUE);
@@ -457,7 +457,7 @@ windowlist_init(XfconfChannel *channel)
wl_show_ws_names = xfconf_channel_get_bool(channel,
"/windowlist-menu/show-workspace-names",
TRUE);
-
+
wl_submenus = xfconf_channel_get_bool(channel,
"/windowlist-menu/show-submenus",
FALSE);
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 6e230b7..f8bdc2b 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -187,7 +187,7 @@ create_solid(GdkRGBA *color,
cairo_destroy(cr);
cairo_surface_destroy(surface);
-
+
return pix;
}
@@ -657,13 +657,13 @@ static void
xfce_backdrop_class_init(XfceBackdropClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfceBackdropPriv));
-
+
gobject_class->finalize = xfce_backdrop_finalize;
gobject_class->set_property = xfce_backdrop_set_property;
gobject_class->get_property = xfce_backdrop_get_property;
-
+
backdrop_signals[BACKDROP_CHANGED] = g_signal_new("changed",
G_OBJECT_CLASS_TYPE(gobject_class), G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET(XfceBackdropClass, changed), NULL, NULL,
@@ -780,9 +780,9 @@ static void
xfce_backdrop_finalize(GObject *object)
{
XfceBackdrop *backdrop = XFCE_BACKDROP(object);
-
+
g_return_if_fail(backdrop != NULL);
-
+
if(backdrop->priv->image_path)
g_free(backdrop->priv->image_path);
@@ -930,12 +930,12 @@ XfceBackdrop *
xfce_backdrop_new(GdkVisual *visual)
{
XfceBackdrop *backdrop;
-
+
g_return_val_if_fail(GDK_IS_VISUAL(visual), NULL);
-
+
backdrop = g_object_new(XFCE_TYPE_BACKDROP, NULL);
backdrop->priv->bpp = gdk_visual_get_depth(visual);
-
+
return backdrop;
}
@@ -954,11 +954,11 @@ xfce_backdrop_new_with_size(GdkVisual *visual,
gint height)
{
XfceBackdrop *backdrop;
-
+
g_return_val_if_fail(GDK_IS_VISUAL(visual), NULL);
-
+
backdrop = g_object_new(XFCE_TYPE_BACKDROP, NULL);
-
+
backdrop->priv->bpp = gdk_visual_get_depth(visual);
backdrop->priv->width = width;
backdrop->priv->height = height;
@@ -1036,7 +1036,7 @@ xfce_backdrop_set_first_color(XfceBackdrop *backdrop,
const GdkRGBA *color)
{
g_return_if_fail(XFCE_IS_BACKDROP(backdrop) && color != NULL);
-
+
if(color->red != backdrop->priv->color1.red
|| color->green != backdrop->priv->color1.green
|| color->blue != backdrop->priv->color1.blue
@@ -1057,7 +1057,7 @@ xfce_backdrop_get_first_color(XfceBackdrop *backdrop,
GdkRGBA *color)
{
g_return_if_fail(XFCE_IS_BACKDROP(backdrop) && color);
-
+
memcpy(color, &backdrop->priv->color1, sizeof(GdkRGBA));
}
@@ -1076,7 +1076,7 @@ xfce_backdrop_set_second_color(XfceBackdrop *backdrop,
const GdkRGBA *color)
{
g_return_if_fail(XFCE_IS_BACKDROP(backdrop) && color != NULL);
-
+
if(color->red != backdrop->priv->color2.red
|| color->green != backdrop->priv->color2.green
|| color->blue != backdrop->priv->color2.blue
@@ -1098,7 +1098,7 @@ xfce_backdrop_get_second_color(XfceBackdrop *backdrop,
GdkRGBA *color)
{
g_return_if_fail(XFCE_IS_BACKDROP(backdrop) && color);
-
+
memcpy(color, &backdrop->priv->color2, sizeof(GdkRGBA));
}
@@ -1182,7 +1182,7 @@ xfce_backdrop_set_image_filename(XfceBackdrop *backdrop, const gchar *filename)
/* Now we can free the old path and setup the new one */
g_free(backdrop->priv->image_path);
-
+
if(filename)
backdrop->priv->image_path = g_strdup(filename);
else
@@ -1812,14 +1812,14 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
w = backdrop->priv->width;
h = backdrop->priv->height;
}
-
+
istyle = backdrop->priv->image_style;
-
+
/* if the image is the same as the screen size, there's no reason to do
* any scaling at all */
if(w == iw && h == ih)
istyle = XFCE_BACKDROP_IMAGE_CENTERED;
-
+
/* if we don't need to do any scaling, don't do any interpolation. this
* fixes a problem where hyper/bilinear filtering causes blurriness in
* some images. http://bugzilla.xfce.org/show_bug.cgi?id=2939 */
@@ -1867,7 +1867,7 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
MIN(w, iw), MIN(h, ih), xo, yo, 1.0, 1.0,
interp, 255);
break;
-
+
case XFCE_BACKDROP_IMAGE_TILED:
tmp = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
/* Now that the image has been loaded, recalculate the image
@@ -1880,7 +1880,7 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
for(j = 0; (j * ih) < h; j++) {
gint newx = iw * i, newy = ih * j;
gint neww = iw, newh = ih;
-
+
if((newx + neww) > w)
neww = w - newx;
if((newy + newh) > h)
@@ -1890,17 +1890,17 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
neww, newh, tmp, newx, newy);
}
}
-
+
gdk_pixbuf_composite(tmp, final_image, 0, 0, w, h,
0, 0, 1.0, 1.0, interp, 255);
g_object_unref(G_OBJECT(tmp));
break;
-
+
case XFCE_BACKDROP_IMAGE_STRETCHED:
gdk_pixbuf_composite(image, final_image, 0, 0, w, h,
0, 0, 1, 1, interp, 255);
break;
-
+
case XFCE_BACKDROP_IMAGE_SCALED:
xscale = (gdouble)w / iw;
yscale = (gdouble)h / ih;
@@ -1920,7 +1920,7 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
iw * xscale, ih * yscale, xo, yo, 1, 1,
interp, 255);
break;
-
+
case XFCE_BACKDROP_IMAGE_ZOOMED:
case XFCE_BACKDROP_IMAGE_SPANNING_SCREENS:
xscale = (gdouble)w / iw;
@@ -1938,7 +1938,7 @@ xfce_backdrop_loader_closed_cb(GdkPixbufLoader *loader,
gdk_pixbuf_composite(image, final_image, 0, 0,
w, h, xo, yo, 1, 1, interp, 255);
break;
-
+
default:
g_critical("Invalid image style: %d\n", (gint)istyle);
}
diff --git a/src/xfce-backdrop.h b/src/xfce-backdrop.h
index a927bf1..aa28c68 100644
--- a/src/xfce-backdrop.h
+++ b/src/xfce-backdrop.h
@@ -74,7 +74,7 @@ typedef enum
struct _XfceBackdrop
{
GObject gobject;
-
+
/*< private >*/
XfceBackdropPriv *priv;
};
@@ -82,7 +82,7 @@ struct _XfceBackdrop
struct _XfceBackdropClass
{
GObjectClass parent_class;
-
+
/*< signals >*/
void (*changed)(XfceBackdrop *backdrop);
void (*cycle)(XfceBackdrop *backdrop);
diff --git a/src/xfdesktop-clipboard-manager.c b/src/xfdesktop-clipboard-manager.c
index a02dacc..1970f70 100644
--- a/src/xfdesktop-clipboard-manager.c
+++ b/src/xfdesktop-clipboard-manager.c
@@ -422,7 +422,7 @@ xfdesktop_clipboard_manager_targets_received (GtkClipboard *clipboard,
GdkAtom *targets;
gint n_targets;
gint n;
-
+
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (XFDESKTOP_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (manager->clipboard == clipboard);
@@ -442,7 +442,7 @@ xfdesktop_clipboard_manager_targets_received (GtkClipboard *clipboard,
g_free (targets);
}
-
+
/* notify listeners that we have a new clipboard state */
g_signal_emit (G_OBJECT (manager), manager_signals[CHANGED], 0);
g_object_notify (G_OBJECT (manager), "can-paste");
@@ -555,7 +555,7 @@ xfdesktop_clipboard_manager_transfer_files (XfdesktopClipboardManager *manager,
{
file = g_object_ref (G_OBJECT (lp->data));
manager->files = g_list_prepend (manager->files, file);
- g_object_weak_ref(G_OBJECT(file),
+ g_object_weak_ref(G_OBJECT(file),
(GWeakNotify)xfdesktop_clipboard_manager_file_destroyed,
manager);
}
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index c0081aa..7a73dba 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -105,12 +105,12 @@ struct _XfdesktopFileIconManagerPrivate
gboolean inited;
XfconfChannel *channel;
-
+
GtkWidget *desktop;
XfdesktopIconView *icon_view;
-
+
GdkScreen *gscreen;
-
+
GFile *folder;
XfdesktopFileIcon *desktop_icon;
GFileMonitor *monitor;
@@ -124,7 +124,7 @@ struct _XfdesktopFileIconManagerPrivate
GHashTable *icons;
GHashTable *removable_icons;
GHashTable *special_icons;
-
+
gboolean show_removable_media;
gboolean show_network_volumes;
gboolean show_device_volumes;
@@ -132,15 +132,15 @@ struct _XfdesktopFileIconManagerPrivate
gboolean show_special[XFDESKTOP_SPECIAL_FILE_ICON_TRASH+1];
gboolean show_thumbnails;
gboolean show_hidden_files;
-
+
guint save_icons_id;
-
+
GQueue *pending_icons;
guint pending_icons_id;
-
+
GtkTargetList *drag_targets;
GtkTargetList *drop_targets;
-
+
#ifdef HAVE_THUNARX
GList *thunarx_menu_providers;
GList *thunarx_properties_providers;
@@ -262,9 +262,9 @@ static void
xfdesktop_file_icon_manager_class_init(XfdesktopFileIconManagerClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfdesktopFileIconManagerPrivate));
-
+
gobject_class->set_property = xfdesktop_file_icon_manager_set_property;
gobject_class->get_property = xfdesktop_file_icon_manager_get_property;
gobject_class->finalize = xfdesktop_file_icon_manager_finalize;
@@ -364,7 +364,7 @@ xfdesktop_file_icon_manager_init(XfdesktopFileIconManager *fmanager)
fmanager->priv = G_TYPE_INSTANCE_GET_PRIVATE(fmanager,
XFDESKTOP_TYPE_FILE_ICON_MANAGER,
XfdesktopFileIconManagerPrivate);
-
+
/* be safe */
fmanager->priv->gscreen = gdk_screen_get_default();
fmanager->priv->drag_targets = gtk_target_list_new(drag_targets,
@@ -384,7 +384,7 @@ xfdesktop_file_icon_manager_set_property(GObject *object,
GParamSpec *pspec)
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(object);
-
+
switch(property_id) {
case PROP_FOLDER:
fmanager->priv->folder = g_value_dup_object(value);
@@ -445,7 +445,7 @@ xfdesktop_file_icon_manager_get_property(GObject *object,
GParamSpec *pspec)
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(object);
-
+
switch(property_id) {
case PROP_FOLDER:
g_value_set_object(value, fmanager->priv->folder);
@@ -503,15 +503,15 @@ static void
xfdesktop_file_icon_manager_finalize(GObject *obj)
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(obj);
-
+
if(fmanager->priv->inited)
xfdesktop_file_icon_manager_fini(XFDESKTOP_ICON_VIEW_MANAGER(fmanager));
-
+
g_object_unref(G_OBJECT(fmanager->priv->channel));
gtk_target_list_unref(fmanager->priv->drag_targets);
gtk_target_list_unref(fmanager->priv->drop_targets);
-
+
g_object_unref(fmanager->priv->folder);
g_object_unref(fmanager->priv->thumbnailer);
@@ -539,7 +539,7 @@ xfdesktop_file_icon_manager_check_create_desktop_folder(GFile *folder)
GError *error = NULL;
gboolean result = TRUE;
gchar *primary;
-
+
g_return_val_if_fail(G_IS_FILE(folder), FALSE);
info = g_file_query_info(folder, XFDESKTOP_FILE_INFO_NAMESPACE,
@@ -599,12 +599,12 @@ xfdesktop_file_icon_menu_executed(GtkWidget *widget,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
XfdesktopIcon *icon;
GList *selected;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(g_list_length(selected) == 1);
icon = XFDESKTOP_ICON(selected->data);
g_list_free(selected);
-
+
xfdesktop_icon_activated(icon);
}
@@ -614,10 +614,10 @@ xfdesktop_file_icon_menu_open_all(GtkWidget *widget,
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GList *selected;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(selected);
-
+
g_list_foreach(selected, (GFunc)xfdesktop_icon_activated, NULL);
g_list_free(selected);
}
@@ -630,7 +630,7 @@ xfdesktop_file_icon_menu_rename(GtkWidget *widget,
XfdesktopFileIcon *icon;
GList *selected, *iter, *files = NULL;
GtkWidget *toplevel;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
for(iter = selected; iter != NULL; iter = iter->next) {
@@ -642,7 +642,7 @@ xfdesktop_file_icon_menu_rename(GtkWidget *widget,
}
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
+
if(g_list_length(files) == 1) {
/* rename dialog for a single icon */
xfdesktop_file_utils_rename_file(g_list_first(files)->data,
@@ -686,7 +686,7 @@ xfdesktop_file_icon_manager_delete_files(XfdesktopFileIconManager *fmanager,
for(lp = g_list_last(files); lp != NULL; lp = lp->prev)
gfiles = g_list_prepend(gfiles, xfdesktop_file_icon_peek_file(lp->data));
- xfdesktop_file_utils_unlink_files(gfiles, fmanager->priv->gscreen,
+ xfdesktop_file_utils_unlink_files(gfiles, fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
g_list_free(gfiles);
@@ -714,44 +714,44 @@ xfdesktop_file_icon_manager_delete_selected(XfdesktopFileIconManager *fmanager,
gboolean force_delete)
{
GList *selected, *l;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
if(!selected)
return;
-
+
/* remove anybody that's not deletable */
for(l = selected; l; ) {
if(!xfdesktop_file_icon_can_delete_file(XFDESKTOP_FILE_ICON(l->data))) {
GList *next = l->next;
-
+
if(l->prev)
l->prev->next = l->next;
else /* this is the first item; reset |selected| */
selected = l->next;
-
+
if(l->next)
l->next->prev = l->prev;
-
+
l->next = l->prev = NULL;
g_list_free_1(l);
-
+
l = next;
} else
l = l->next;
}
-
+
if(G_UNLIKELY(!selected))
return;
-
+
/* make sure the icons don't get destroyed while we're working */
g_list_foreach(selected, (GFunc)g_object_ref, NULL);
-
+
if (!force_delete) {
xfdesktop_file_icon_manager_trash_files(fmanager, selected);
} else {
xfdesktop_file_icon_manager_delete_files(fmanager, selected);
}
-
+
g_list_foreach(selected, (GFunc)g_object_unref, NULL);
g_list_free(selected);
}
@@ -768,12 +768,12 @@ xfdesktop_file_icon_menu_app_info_executed(GtkWidget *widget,
GList files, *selected;
GtkWidget *toplevel;
GError *error = NULL;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(g_list_length(selected) == 1);
icon = XFDESKTOP_FILE_ICON(selected->data);
g_list_free(selected);
-
+
/* get the app info related to this menu item */
app_info = g_object_get_qdata(G_OBJECT(widget), xfdesktop_app_info_quark);
if(!app_info)
@@ -788,7 +788,7 @@ xfdesktop_file_icon_menu_app_info_executed(GtkWidget *widget,
context = gdk_display_get_app_launch_context(gtk_widget_get_display(GTK_WIDGET(fmanager->priv->icon_view)));
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
gdk_app_launch_context_set_screen(context, gtk_widget_get_screen(toplevel));
-
+
/* try to launch the application */
if(!xfdesktop_file_utils_app_info_launch(app_info, fmanager->priv->folder, &files,
G_APP_LAUNCH_CONTEXT(context), &error))
@@ -813,16 +813,16 @@ xfdesktop_file_icon_menu_open_folder(GtkWidget *widget,
GList *selected;
GFile *file;
GtkWidget *toplevel;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(g_list_length(selected) == 1);
icon = XFDESKTOP_FILE_ICON(selected->data);
g_list_free(selected);
-
+
file = xfdesktop_file_icon_peek_file(icon);
-
+
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
+
xfdesktop_file_utils_open_folder(file, fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
}
@@ -835,13 +835,13 @@ xfdesktop_file_icon_menu_open_desktop(GtkWidget *widget,
XfdesktopFileIcon *icon = fmanager->priv->desktop_icon;
GFile *file;
GtkWidget *toplevel;
-
+
file = xfdesktop_file_icon_peek_file(icon);
if(!file)
return;
-
+
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
+
xfdesktop_file_utils_open_folder(file, fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
}
@@ -855,18 +855,18 @@ xfdesktop_file_icon_menu_other_app(GtkWidget *widget,
GtkWidget *toplevel;
GList *selected;
GFile *file;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(g_list_length(selected) == 1);
icon = XFDESKTOP_FILE_ICON(selected->data);
g_list_free(selected);
-
+
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
file = xfdesktop_file_icon_peek_file(icon);
- xfdesktop_file_utils_display_chooser_dialog(file, TRUE,
- fmanager->priv->gscreen,
+ xfdesktop_file_utils_display_chooser_dialog(file, TRUE,
+ fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
}
@@ -876,13 +876,13 @@ xfdesktop_file_icon_menu_cut(GtkWidget *widget,
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GList *files;
-
+
files = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
if(!files)
return;
-
+
xfdesktop_clipboard_manager_cut_files(clipboard_manager, files);
-
+
g_list_free(files);
}
@@ -892,13 +892,13 @@ xfdesktop_file_icon_menu_copy(GtkWidget *widget,
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GList *files;
-
+
files = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
if(!files)
return;
-
+
xfdesktop_clipboard_manager_copy_files(clipboard_manager, files);
-
+
g_list_free(files);
}
@@ -975,16 +975,16 @@ xfdesktop_file_icon_menu_properties(GtkWidget *widget,
XfdesktopFileIcon *icon;
GtkWidget *toplevel;
GFile *file;
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
g_return_if_fail(g_list_length(selected) == 1);
icon = XFDESKTOP_FILE_ICON(selected->data);
g_list_free(selected);
-
+
file = xfdesktop_file_icon_peek_file(icon);
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
- xfdesktop_file_utils_show_properties_dialog(file, fmanager->priv->gscreen,
+
+ xfdesktop_file_utils_show_properties_dialog(file, fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
}
@@ -995,7 +995,7 @@ xfdesktop_file_icon_manager_desktop_properties(GtkWidget *widget,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GtkWidget *parent = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
GFile *file = xfdesktop_file_icon_peek_file (fmanager->priv->desktop_icon);
-
+
xfdesktop_file_utils_show_properties_dialog(file, fmanager->priv->gscreen,
GTK_WINDOW(parent));
}
@@ -1030,16 +1030,16 @@ xfdesktop_menu_item_from_app_info(XfdesktopFileIconManager *fmanager,
else
mi = xfdesktop_menu_create_menu_item_with_markup(title, img);
g_free(title);
-
+
g_object_set_qdata_full(G_OBJECT(mi), xfdesktop_app_info_quark,
g_object_ref(app_info), g_object_unref);
gtk_widget_show(mi);
-
+
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_file_icon_menu_app_info_executed),
fmanager);
-
+
return mi;
}
@@ -1047,10 +1047,10 @@ static gboolean
xfdesktop_file_icon_menu_free_icon_list_idled(gpointer user_data)
{
GList *icon_list = user_data;
-
+
g_list_foreach(icon_list, (GFunc)g_object_unref, NULL);
g_list_free(icon_list);
-
+
return FALSE;
}
@@ -1069,9 +1069,9 @@ xfdesktop_file_icon_menu_create_launcher(GtkWidget *widget,
GFile *file;
gchar *cmd = NULL, *uri = NULL, *display_name;
GError *error = NULL;
-
+
display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (fmanager->priv->gscreen)));
-
+
file = g_object_get_data(G_OBJECT(widget), "file");
if(file) {
@@ -1086,17 +1086,17 @@ xfdesktop_file_icon_menu_create_launcher(GtkWidget *widget,
cmd = g_strdup_printf("exo-desktop-item-edit \"--display=%s\" --create-new --type %s \"%s\"",
display_name, type, uri);
}
-
+
if(!xfce_spawn_command_line_on_screen(NULL, cmd, FALSE, FALSE, &error)) {
GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
xfce_message_dialog(GTK_WINDOW(toplevel), _("Launch Error"),
- "dialog-error",
+ "dialog-error",
_("Unable to launch \"exo-desktop-item-edit\", which is required to create and edit launchers and links on the desktop."),
error->message,
XFCE_BUTTON_TYPE_MIXED, "window-close", _("_Close"), GTK_RESPONSE_ACCEPT,
NULL);
}
-
+
g_free(display_name);
g_free(uri);
g_free(cmd);
@@ -1110,9 +1110,9 @@ xfdesktop_file_icon_menu_create_folder(GtkWidget *widget,
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GtkWidget *toplevel;
-
+
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
+
xfdesktop_file_utils_create_file(fmanager->priv->folder, "inode/directory",
fmanager->priv->gscreen,
GTK_WINDOW(toplevel));
@@ -1125,9 +1125,9 @@ xfdesktop_file_icon_template_item_activated(GtkWidget *mi,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GtkWidget *toplevel;
GFile *file = g_object_get_data(G_OBJECT(mi), "file");
-
+
toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-
+
if(file) {
xfdesktop_file_utils_create_file_from_template(fmanager->priv->folder, file,
fmanager->priv->gscreen,
@@ -1334,11 +1334,11 @@ xfdesktop_settings_launch(GtkWidget *w,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
gchar *cmd;
GError *error = NULL;
-
+
cmd = g_find_program_in_path("xfdesktop-settings");
if(!cmd)
cmd = g_strdup(BINDIR "/xfdesktop-settings");
-
+
if(!xfce_spawn_command_line_on_screen(fmanager->priv->gscreen, cmd, FALSE, TRUE, &error)) {
GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
/* printf is to be translator-friendly */
@@ -1370,9 +1370,9 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
#ifdef HAVE_THUNARX
GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
#endif
-
+
TRACE("ENTERING");
-
+
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
if(selected)
file_icon = selected->data;
@@ -1382,9 +1382,9 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
file_icon = fmanager->priv->desktop_icon;
}
info = xfdesktop_file_icon_peek_file_info(file_icon);
-
+
multi_sel = (g_list_length(selected) > 1);
-
+
if(multi_sel) {
/* check if special icons are selected */
for(l = selected; l != NULL; l = l->next) {
@@ -1401,7 +1401,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
got_custom_menu = xfdesktop_icon_populate_context_menu(XFDESKTOP_ICON(selected->data),
GTK_WIDGET(menu));
}
-
+
/* make sure icons don't get destroyed while menu is open */
g_list_foreach(selected, (GFunc)g_object_ref, NULL);
g_object_set_data(G_OBJECT(menu), "--xfdesktop-icon-list", selected);
@@ -1440,7 +1440,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
if(file_icon == fmanager->priv->desktop_icon) {
GIcon *icon;
@@ -1470,7 +1470,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_file_icon_menu_create_launcher),
fmanager);
-
+
/* create folder item */
@@ -1551,11 +1551,11 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_file_icon_menu_executed),
fmanager);
-
+
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
if(g_content_type_equals(g_file_info_get_content_type(info),
"application/x-desktop"))
{
@@ -1563,7 +1563,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
img = gtk_image_new_from_icon_name("gtk-edit", GTK_ICON_SIZE_MENU);
mi = xfdesktop_menu_create_menu_item_with_mnemonic(_("_Edit Launcher"), img);
- g_object_set_data_full(G_OBJECT(mi), "file",
+ g_object_set_data_full(G_OBJECT(mi), "file",
g_object_ref(file), g_object_unref);
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
@@ -1605,7 +1605,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
mi = xfdesktop_menu_item_from_app_info(fmanager, file_icon,
app_info, TRUE, TRUE);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
g_object_unref(app_info);
if(app_infos->next) {
@@ -1624,7 +1624,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
mi = xfdesktop_menu_create_menu_item_with_mnemonic(_("Open With"), img);
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
app_infos_menu = gtk_menu_new();
gtk_menu_set_reserve_toggle_size(GTK_MENU(app_infos_menu), FALSE);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), app_infos_menu);
@@ -1657,7 +1657,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_file_icon_menu_other_app),
fmanager);
-
+
/* free the app info list */
g_list_free(app_infos);
} else {
@@ -1758,7 +1758,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
if(multi_sel || xfdesktop_file_icon_can_delete_file(file_icon)) {
g_signal_connect(G_OBJECT(mi), "activate",
- G_CALLBACK(xfdesktop_file_icon_menu_delete),
+ G_CALLBACK(xfdesktop_file_icon_menu_delete),
fmanager);
} else
gtk_widget_set_sensitive(mi, FALSE);
@@ -1832,7 +1832,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
}
}
#endif
-
+
if(file_icon == fmanager->priv->desktop_icon) {
/* Menu on the root desktop window */
/* show arrange desktop icons option */
@@ -1868,7 +1868,7 @@ xfdesktop_file_icon_manager_populate_context_menu(XfceDesktop *desktop,
fmanager);
}
}
-
+
/* don't free |selected|. the menu deactivated handler does that */
}
@@ -1907,7 +1907,7 @@ xfdesktop_file_icon_manager_save_icons(gpointer user_data)
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle rectangle;
-
+
fmanager->priv->save_icons_id = 0;
screen = gtk_widget_get_screen (GTK_WIDGET (fmanager->priv->icon_view));
@@ -1927,7 +1927,7 @@ xfdesktop_file_icon_manager_save_icons(gpointer user_data)
XF_DEBUG("saving to: %s", path);
tmppath = g_strconcat(path, ".new", NULL);
-
+
rcfile = xfce_rc_simple_open(tmppath, FALSE);
if(!rcfile) {
g_warning("Unable to determine location of icon position cache file. " \
@@ -1948,7 +1948,7 @@ xfdesktop_file_icon_manager_save_icons(gpointer user_data)
}
g_hash_table_foreach(fmanager->priv->special_icons,
file_icon_hash_write_icons, rcfile);
-
+
xfce_rc_flush(rcfile);
xfce_rc_close(rcfile);
@@ -1961,10 +1961,10 @@ xfdesktop_file_icon_manager_save_icons(gpointer user_data)
} else {
XF_DEBUG("didn't write anything in the RC file, desktop is probably empty");
}
-
+
g_free(path);
g_free(tmppath);
-
+
return FALSE;
}
@@ -1973,10 +1973,10 @@ xfdesktop_file_icon_position_changed(XfdesktopFileIcon *icon,
gpointer user_data)
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
-
+
if(fmanager->priv->save_icons_id)
g_source_remove(fmanager->priv->save_icons_id);
-
+
fmanager->priv->save_icons_id = g_timeout_add(SAVE_DELAY,
xfdesktop_file_icon_manager_save_icons,
fmanager);
@@ -2016,7 +2016,7 @@ xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *f
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_parent_window(GTK_WIDGET(fmanager->priv->icon_view)));
gdk_monitor_get_workarea (monitor, &rectangle);
-
+
g_snprintf(relpath, PATH_MAX, "xfce4/desktop/icons.screen%d-%dx%d.rc",
0,
rectangle.width,
@@ -2052,7 +2052,7 @@ xfdesktop_file_icon_manager_get_cached_icon_position(XfdesktopFileIconManager *f
xfce_rc_close(rcfile);
g_free(filename);
}
-
+
return ret;
}
@@ -2066,7 +2066,7 @@ _icon_notify_destroy(gpointer data,
{
g_assert(g_list_find(_alive_icon_list, obj));
_alive_icon_list = g_list_remove(_alive_icon_list, obj);
-
+
XF_DEBUG("icon finalized: '%s'", xfdesktop_icon_peek_label(XFDESKTOP_ICON(obj)));
}
#endif
@@ -2300,11 +2300,11 @@ xfdesktop_file_icon_manager_add_regular_icon(XfdesktopFileIconManager *fmanager,
{
XfdesktopRegularFileIcon *icon = NULL;
gboolean is_desktop_file = FALSE;
-
+
g_return_val_if_fail(fmanager && G_IS_FILE(file) && G_IS_FILE_INFO(info), NULL);
- if(g_content_type_equals(g_file_info_get_content_type(info),
- "application/x-desktop"))
+ if(g_content_type_equals(g_file_info_get_content_type(info),
+ "application/x-desktop"))
{
is_desktop_file = TRUE;
}
@@ -2363,7 +2363,7 @@ xfdesktop_file_icon_manager_add_regular_icon(XfdesktopFileIconManager *fmanager,
/* should never return NULL */
icon = xfdesktop_regular_file_icon_new(file, info, fmanager->priv->gscreen, fmanager);
-
+
xfdesktop_file_icon_manager_add_icon(fmanager,
XFDESKTOP_FILE_ICON(icon),
row, col);
@@ -2378,7 +2378,7 @@ xfdesktop_file_icon_manager_add_volume_icon(XfdesktopFileIconManager *fmanager,
{
XfdesktopVolumeIcon *icon;
gchar *volume_type;
-
+
g_return_val_if_fail(fmanager && G_IS_VOLUME(volume), NULL);
/* If we aren't showing any media exit now */
@@ -2421,12 +2421,12 @@ xfdesktop_file_icon_manager_add_special_file_icon(XfdesktopFileIconManager *fman
XfdesktopSpecialFileIconType type)
{
XfdesktopSpecialFileIcon *icon;
-
+
/* can return NULL if it's the trash icon and dbus isn't around */
icon = xfdesktop_special_file_icon_new(type, fmanager->priv->gscreen);
if(!icon)
return NULL;
-
+
xfdesktop_file_icon_manager_add_icon(fmanager,
XFDESKTOP_FILE_ICON(icon),
-1, -1);
@@ -2462,18 +2462,18 @@ static void
xfdesktop_file_icon_manager_refresh_icons(XfdesktopFileIconManager *fmanager)
{
gint i;
-
+
/* if a save is pending, flush icon positions */
if(fmanager->priv->save_icons_id) {
g_source_remove(fmanager->priv->save_icons_id);
fmanager->priv->save_icons_id = 0;
xfdesktop_file_icon_manager_save_icons(fmanager);
}
-
+
/* ditch removable media */
if(fmanager->priv->show_removable_media)
xfdesktop_file_icon_manager_remove_removable_media(fmanager);
-
+
/* ditch special icons */
for(i = 0; i <= XFDESKTOP_SPECIAL_FILE_ICON_TRASH; ++i) {
XfdesktopIcon *icon = g_hash_table_lookup(fmanager->priv->special_icons,
@@ -2491,21 +2491,21 @@ xfdesktop_file_icon_manager_refresh_icons(XfdesktopFileIconManager *fmanager)
(GHRFunc)xfdesktop_remove_icons_ht,
fmanager);
}
-
+
#if defined(DEBUG) && DEBUG > 0
g_assert(_xfdesktop_icon_view_n_items(fmanager->priv->icon_view) == 0);
g_assert(g_list_length(_alive_icon_list) == 0);
#endif
-
+
/* clear out anything left in the icon view */
xfdesktop_icon_view_remove_all(fmanager->priv->icon_view);
-
+
/* add back the special icons */
for(i = 0; i <= XFDESKTOP_SPECIAL_FILE_ICON_TRASH; ++i) {
if(fmanager->priv->show_special[i])
xfdesktop_file_icon_manager_add_special_file_icon(fmanager, i);
}
-
+
/* add back removable media */
if(fmanager->priv->show_removable_media)
xfdesktop_file_icon_manager_load_removable_media(fmanager);
@@ -2522,7 +2522,7 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
GList *selected;
gboolean force_delete = FALSE;
-
+
switch(evt->keyval) {
case GDK_KEY_Delete:
case GDK_KEY_KP_Delete:
@@ -2530,7 +2530,7 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
force_delete = TRUE;
xfdesktop_file_icon_manager_delete_selected(fmanager, force_delete);
break;
-
+
case GDK_KEY_c:
case GDK_KEY_C:
if(!(evt->state & GDK_CONTROL_MASK)
@@ -2545,7 +2545,7 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
g_list_free(selected);
}
break;
-
+
case GDK_KEY_x:
case GDK_KEY_X:
if(!(evt->state & GDK_CONTROL_MASK)
@@ -2560,7 +2560,7 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
g_list_free(selected);
}
return TRUE;
-
+
case GDK_KEY_v:
case GDK_KEY_V:
if(!(evt->state & GDK_CONTROL_MASK)
@@ -2584,7 +2584,7 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
case GDK_KEY_F5:
xfdesktop_file_icon_manager_refresh_icons(fmanager);
return TRUE;
-
+
case GDK_KEY_F2:
selected = xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
if(g_list_length(selected) == 1) {
@@ -2596,9 +2596,9 @@ xfdesktop_file_icon_manager_key_press(GtkWidget *widget,
}
if(selected)
g_list_free(selected);
- break;
+ break;
}
-
+
return FALSE;
}
@@ -2708,7 +2708,7 @@ xfdesktop_file_icon_manager_file_changed(GFileMonitor *monitor,
/* Remove the old icon */
xfdesktop_file_icon_manager_remove_icon(fmanager, icon);
}
-
+
file_info = g_file_query_info(file, XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
if(file_info) {
@@ -2869,7 +2869,7 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator,
xfce_message_dialog(gtk_widget_is_toplevel(toplevel) ? GTK_WINDOW(toplevel) : NULL,
_("Load Error"),
- "dialog-warning",
+ "dialog-warning",
_("Failed to load the desktop folder"), error->message,
XFCE_BUTTON_TYPE_MIXED, "window-close", _("_Close"), GTK_RESPONSE_ACCEPT,
NULL);
@@ -2938,7 +2938,7 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator,
static void
xfdesktop_file_icon_manager_load_desktop_folder(XfdesktopFileIconManager *fmanager)
{
-
+
if(fmanager->priv->enumerator) {
g_object_unref(fmanager->priv->enumerator);
fmanager->priv->enumerator = NULL;
@@ -2965,7 +2965,7 @@ xfdesktop_file_icon_manager_check_icons_opacity(gpointer key,
{
XfdesktopRegularFileIcon *icon = XFDESKTOP_REGULAR_FILE_ICON(value);
XfdesktopClipboardManager *cmanager = XFDESKTOP_CLIPBOARD_MANAGER(data);
-
+
if(G_UNLIKELY(xfdesktop_clipboard_manager_has_cutted_file(cmanager, XFDESKTOP_FILE_ICON(icon))))
xfdesktop_regular_file_icon_set_pixbuf_opacity(icon, 50);
else
@@ -2977,9 +2977,9 @@ xfdesktop_file_icon_manager_clipboard_changed(XfdesktopClipboardManager *cmanage
gpointer user_data)
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
-
+
TRACE("entering");
-
+
/* slooow? */
g_hash_table_foreach(fmanager->priv->icons,
xfdesktop_file_icon_manager_check_icons_opacity,
@@ -3010,7 +3010,7 @@ xfdesktop_file_icon_manager_volume_removed(GVolumeMonitor *monitor,
{
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
XfdesktopIcon *icon;
-
+
icon = g_hash_table_lookup(fmanager->priv->removable_icons, volume);
if(icon) {
xfdesktop_icon_view_remove_item(fmanager->priv->icon_view, icon);
@@ -3029,19 +3029,19 @@ xfdesktop_file_icon_manager_load_removable_media(XfdesktopFileIconManager *fmana
if(!fmanager->priv->volume_monitor)
fmanager->priv->volume_monitor = g_volume_monitor_get();
-
+
fmanager->priv->removable_icons = g_hash_table_new_full(g_direct_hash,
g_direct_equal,
(GDestroyNotify)g_object_unref,
(GDestroyNotify)g_object_unref);
-
+
volumes = g_volume_monitor_get_volumes(fmanager->priv->volume_monitor);
for(l = volumes; l; l = l->next) {
xfdesktop_file_icon_manager_add_removable_volume(fmanager, l->data);
g_object_unref(l->data);
}
g_list_free(volumes);
-
+
g_signal_connect(G_OBJECT(fmanager->priv->volume_monitor), "volume-added",
G_CALLBACK(xfdesktop_file_icon_manager_volume_added),
fmanager);
@@ -3057,7 +3057,7 @@ xfdesktop_file_icon_manager_ht_remove_removable_media(gpointer key,
{
XfdesktopIcon *icon = XFDESKTOP_ICON(value);
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(user_data);
-
+
xfdesktop_icon_view_remove_item(fmanager->priv->icon_view, icon);
}
@@ -3071,7 +3071,7 @@ xfdesktop_file_icon_manager_remove_removable_media(XfdesktopFileIconManager *fma
g_hash_table_destroy(fmanager->priv->removable_icons);
fmanager->priv->removable_icons = NULL;
}
-
+
if(fmanager->priv->volume_monitor) {
g_signal_handlers_disconnect_by_func(G_OBJECT(fmanager->priv->volume_monitor),
G_CALLBACK(xfdesktop_file_icon_manager_volume_added),
@@ -3079,7 +3079,7 @@ xfdesktop_file_icon_manager_remove_removable_media(XfdesktopFileIconManager *fma
g_signal_handlers_disconnect_by_func(G_OBJECT(fmanager->priv->volume_monitor),
G_CALLBACK(xfdesktop_file_icon_manager_volume_removed),
fmanager);
-
+
g_object_unref(fmanager->priv->volume_monitor);
fmanager->priv->volume_monitor = NULL;
}
@@ -3114,9 +3114,9 @@ xfdesktop_file_icon_manager_real_init(XfdesktopIconViewManager *manager,
g_signal_connect(G_OBJECT(fmanager->priv->desktop), "populate-root-menu",
G_CALLBACK(xfdesktop_file_icon_manager_populate_context_menu),
fmanager);
-
+
fmanager->priv->gscreen = gtk_widget_get_screen(GTK_WIDGET(icon_view));
-
+
if(!clipboard_manager) {
GdkDisplay *gdpy = gdk_screen_get_display(fmanager->priv->gscreen);
clipboard_manager = xfdesktop_clipboard_manager_get_for_display(gdpy);
@@ -3124,11 +3124,11 @@ xfdesktop_file_icon_manager_real_init(XfdesktopIconViewManager *manager,
(gpointer)&clipboard_manager);
} else
g_object_ref(G_OBJECT(clipboard_manager));
-
+
g_signal_connect(G_OBJECT(clipboard_manager), "changed",
G_CALLBACK(xfdesktop_file_icon_manager_clipboard_changed),
fmanager);
-
+
xfdesktop_icon_view_set_selection_mode(icon_view, GTK_SELECTION_MULTIPLE);
xfdesktop_icon_view_enable_drag_source(icon_view,
GDK_SHIFT_MASK | GDK_CONTROL_MASK
@@ -3139,25 +3139,25 @@ xfdesktop_file_icon_manager_real_init(XfdesktopIconViewManager *manager,
xfdesktop_icon_view_enable_drag_dest(icon_view, drop_targets,
n_drop_targets, GDK_ACTION_LINK
| GDK_ACTION_COPY | GDK_ACTION_MOVE);
-
+
g_signal_connect(G_OBJECT(xfdesktop_icon_view_get_window_widget(icon_view)),
"key-press-event",
G_CALLBACK(xfdesktop_file_icon_manager_key_press),
fmanager);
-
+
fmanager->priv->icons = g_hash_table_new_full((GHashFunc)g_file_hash,
(GEqualFunc)g_file_equal,
(GDestroyNotify)g_object_unref,
(GDestroyNotify)g_object_unref);
-
+
fmanager->priv->special_icons = g_hash_table_new_full(g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify)g_object_unref);
-
+
if(!xfdesktop_file_utils_dbus_init())
g_warning("Unable to initialise D-Bus. Some xfdesktop features may be unavailable.");
-
+
/* do this in the reverse order stuff should be displayed */
xfdesktop_file_icon_manager_load_desktop_folder(fmanager);
if(fmanager->priv->show_removable_media)
@@ -3166,20 +3166,20 @@ xfdesktop_file_icon_manager_real_init(XfdesktopIconViewManager *manager,
if(fmanager->priv->show_special[i])
xfdesktop_file_icon_manager_add_special_file_icon(fmanager, i);
}
-
+
#ifdef HAVE_THUNARX
thunarx_pfac = thunarx_provider_factory_get_default();
-
+
fmanager->priv->thunarx_menu_providers =
thunarx_provider_factory_list_providers(thunarx_pfac,
THUNARX_TYPE_MENU_PROVIDER);
fmanager->priv->thunarx_properties_providers =
thunarx_provider_factory_list_providers(thunarx_pfac,
THUNARX_TYPE_PROPERTY_PAGE_PROVIDER);
-
- g_object_unref(G_OBJECT(thunarx_pfac));
+
+ g_object_unref(G_OBJECT(thunarx_pfac));
#endif
-
+
desktop_info = g_file_query_info(fmanager->priv->folder,
XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE,
@@ -3189,11 +3189,11 @@ xfdesktop_file_icon_manager_real_init(XfdesktopIconViewManager *manager,
desktop_info,
fmanager->priv->gscreen,
fmanager));
-
+
g_object_unref(desktop_info);
fmanager->priv->inited = TRUE;
-
+
return TRUE;
}
@@ -3209,7 +3209,7 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
}
fmanager->priv->inited = FALSE;
-
+
if(fmanager->priv->enumerator) {
g_object_unref(fmanager->priv->enumerator);
fmanager->priv->enumerator = NULL;
@@ -3222,22 +3222,22 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
g_signal_handlers_disconnect_by_func(G_OBJECT(fmanager->priv->desktop),
G_CALLBACK(xfdesktop_file_icon_manager_populate_context_menu),
fmanager);
-
+
if(fmanager->priv->save_icons_id) {
g_source_remove(fmanager->priv->save_icons_id);
fmanager->priv->save_icons_id = 0;
xfdesktop_file_icon_manager_save_icons(fmanager);
}
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(clipboard_manager),
G_CALLBACK(xfdesktop_file_icon_manager_clipboard_changed),
fmanager);
-
+
g_object_unref(G_OBJECT(clipboard_manager));
-
+
if(fmanager->priv->show_removable_media)
xfdesktop_file_icon_manager_remove_removable_media(fmanager);
-
+
for(i = 0; i <= XFDESKTOP_SPECIAL_FILE_ICON_TRASH; ++i) {
XfdesktopIcon *icon = g_hash_table_lookup(fmanager->priv->special_icons,
GINT_TO_POINTER(i));
@@ -3266,7 +3266,7 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
g_queue_free(fmanager->priv->pending_icons);
fmanager->priv->pending_icons = NULL;
}
-
+
/* disconnect from the file monitor and release it */
if(fmanager->priv->monitor) {
g_signal_handlers_disconnect_by_func(fmanager->priv->monitor,
@@ -3293,29 +3293,29 @@ xfdesktop_file_icon_manager_fini(XfdesktopIconViewManager *manager)
g_object_unref(G_OBJECT(fmanager->priv->desktop_icon));
fmanager->priv->desktop_icon = NULL;
-
+
#ifdef HAVE_THUNARX
g_list_foreach(fmanager->priv->thunarx_menu_providers,
(GFunc)g_object_unref, NULL);
g_list_free(fmanager->priv->thunarx_menu_providers);
-
+
g_list_foreach(fmanager->priv->thunarx_properties_providers,
(GFunc)g_object_unref, NULL);
g_list_free(fmanager->priv->thunarx_properties_providers);
#endif
-
+
g_hash_table_destroy(fmanager->priv->special_icons);
fmanager->priv->special_icons = NULL;
-
+
g_hash_table_destroy(fmanager->priv->icons);
fmanager->priv->icons = NULL;
-
+
xfdesktop_file_utils_dbus_cleanup();
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(xfdesktop_icon_view_get_window_widget(fmanager->priv->icon_view)),
G_CALLBACK(xfdesktop_file_icon_manager_key_press),
fmanager);
-
+
xfdesktop_icon_view_unset_drag_source(fmanager->priv->icon_view);
xfdesktop_icon_view_unset_drag_dest(fmanager->priv->icon_view);
}
@@ -3331,9 +3331,9 @@ xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager,
XfdesktopFileIconManager *fmanager = XFDESKTOP_FILE_ICON_MANAGER(manager);
GtkWidget *widget = GTK_WIDGET(fmanager->priv->icon_view);
GdkAtom target;
-
+
TRACE("entering");
-
+
target = gtk_drag_dest_find_target(widget, context,
fmanager->priv->drop_targets);
if(target == GDK_NONE)
@@ -3345,20 +3345,20 @@ xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager,
guchar *prop_text = NULL;
GFile *source_file, *file;
gchar *uri = NULL;
-
+
if(drop_icon) {
GFileInfo *info = xfdesktop_file_icon_peek_file_info(XFDESKTOP_FILE_ICON(drop_icon));
if(!info)
return FALSE;
-
+
if(g_file_info_get_file_type(info) != G_FILE_TYPE_DIRECTORY)
return FALSE;
-
+
source_file = xfdesktop_file_icon_peek_file(XFDESKTOP_FILE_ICON(drop_icon));
-
+
} else
source_file = fmanager->priv->folder;
-
+
if(gdk_property_get(gdk_drag_context_get_source_window(context),
gdk_atom_intern("XdndDirectSave0", FALSE),
gdk_atom_intern("text/plain", FALSE),
@@ -3371,17 +3371,17 @@ xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager,
file = g_file_resolve_relative_path(source_file, (const gchar *)prop_text);
uri = g_file_get_uri(file);
g_object_unref(file);
-
+
gdk_property_change(gdk_drag_context_get_source_window(context),
gdk_atom_intern("XdndDirectSave0", FALSE),
gdk_atom_intern("text/plain", FALSE), 8,
GDK_PROP_MODE_REPLACE, (const guchar *)uri,
strlen(uri));
-
+
g_free(prop_text);
g_free(uri);
}
-
+
if(!uri)
return FALSE;
} else if(target == gdk_atom_intern("_NETSCAPE_URL", FALSE)) {
@@ -3393,11 +3393,11 @@ xfdesktop_file_icon_manager_drag_drop(XfdesktopIconViewManager *manager,
return FALSE;
}
}
-
+
TRACE("target good");
-
+
gtk_drag_get_data(widget, context, target, time_);
-
+
return TRUE;
}
@@ -3536,7 +3536,7 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
gdk_atom_intern("text/plain", FALSE), 8,
GDK_PROP_MODE_REPLACE, (const guchar *)"", 0);
}
-
+
drop_ok = TRUE;
} else if(info == TARGET_NETSCAPE_URL) {
/* data is "URL\nTITLE" */
@@ -3549,15 +3549,15 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
source_file = xfdesktop_file_icon_peek_file(XFDESKTOP_FILE_ICON(drop_icon));
} else
source_file = fmanager->priv->folder;
-
+
if(source_file && exo_desktop_item_edit) {
gchar **parts = g_strsplit((const gchar *)gtk_selection_data_get_data(data), "\n", -1);
-
+
if(2 == g_strv_length(parts)) {
gchar *cwd = g_file_get_uri(source_file);
gchar *myargv[16];
gint i = 0;
-
+
/* use the argv form so we don't have to worry about quoting
* the link title */
myargv[i++] = exo_desktop_item_edit;
@@ -3569,7 +3569,7 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
myargv[i++] = "--create-new";
myargv[i++] = cwd;
myargv[i++] = NULL;
-
+
if(xfce_spawn_on_screen(fmanager->priv->gscreen, NULL, myargv,
NULL, G_SPAWN_SEARCH_PATH, TRUE,
gtk_get_current_event_time(),
@@ -3577,13 +3577,13 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
{
drop_ok = TRUE;
}
-
+
g_free(cwd);
}
-
+
g_strfreev(parts);
}
-
+
g_free(exo_desktop_item_edit);
} else if(info == TARGET_TEXT_URI_LIST) {
if(drop_icon) {
@@ -3591,14 +3591,14 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
tfile = xfdesktop_file_icon_peek_file(file_icon);
tinfo = xfdesktop_file_icon_peek_file_info(file_icon);
}
-
+
copy_only = (action == GDK_ACTION_COPY);
-
+
if(tfile && g_file_has_uri_scheme(tfile, "trash") && copy_only) {
gtk_drag_finish(context, FALSE, FALSE, time_);
return;
}
-
+
file_list = xfdesktop_file_utils_file_list_from_string((const gchar *)gtk_selection_data_get_data(data));
if(file_list) {
GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
@@ -3618,7 +3618,7 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
GList *l, *dest_file_list = NULL;
gboolean dest_is_volume = (drop_icon
&& XFDESKTOP_IS_VOLUME_ICON(drop_icon));
-
+
/* if it's a volume, but we don't have |tinfo|, this just isn't
* going to work */
if(!tinfo && dest_is_volume) {
@@ -3657,7 +3657,7 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
dest_file_list = g_list_reverse(dest_file_list);
drop_ok = xfdesktop_file_utils_transfer_files(action,
- file_list,
+ file_list,
dest_file_list,
fmanager->priv->gscreen);
}
@@ -3670,10 +3670,10 @@ xfdesktop_file_icon_manager_drag_data_received(XfdesktopIconViewManager *manager
}
}
}
-
+
XF_DEBUG("finishing drop on desktop from external source: drop_ok=%s, copy_only=%s",
drop_ok?"TRUE":"FALSE", copy_only?"TRUE":"FALSE");
-
+
gtk_drag_finish(context, drop_ok, !copy_only, time_);
}
@@ -3687,16 +3687,16 @@ xfdesktop_file_icon_manager_drag_data_get(XfdesktopIconViewManager *manager,
{
GList *file_list;
gchar *str;
-
+
TRACE("entering");
-
+
g_return_if_fail(drag_icons);
-
+
file_list = xfdesktop_file_utils_file_icon_list_to_file_list(drag_icons);
str = xfdesktop_file_utils_file_list_to_string(file_list);
gtk_selection_data_set(data, gtk_selection_data_get_target(data), 8, (guchar *)str, strlen(str));
-
+
g_free(str);
xfdesktop_file_utils_file_list_free(file_list);
}
@@ -3820,7 +3820,7 @@ xfdesktop_file_icon_manager_new(GFile *folder,
XfconfChannel *channel)
{
XfdesktopFileIconManager *fmanager;
-
+
g_return_val_if_fail(folder && channel, NULL);
fmanager = g_object_new(XFDESKTOP_TYPE_FILE_ICON_MANAGER,
@@ -3989,15 +3989,15 @@ xfdesktop_file_icon_manager_set_show_special_file(XfdesktopFileIconManager *mana
{
g_return_if_fail(XFDESKTOP_IS_FILE_ICON_MANAGER(manager));
g_return_if_fail((int)type >= 0 && type <= XFDESKTOP_SPECIAL_FILE_ICON_TRASH);
-
+
if(manager->priv->show_special[type] == show_special_file)
return;
-
+
manager->priv->show_special[type] = show_special_file;
-
+
if(!manager->priv->inited)
return;
-
+
if(show_special_file) {
g_return_if_fail(!g_hash_table_lookup(manager->priv->special_icons,
GINT_TO_POINTER(type)));
diff --git a/src/xfdesktop-file-icon-manager.h b/src/xfdesktop-file-icon-manager.h
index 7dce281..026ce43 100644
--- a/src/xfdesktop-file-icon-manager.h
+++ b/src/xfdesktop-file-icon-manager.h
@@ -40,7 +40,7 @@ typedef struct _XfdesktopFileIconManagerPrivate XfdesktopFileIconManagerPrivate
struct _XfdesktopFileIconManager
{
GObject parent;
-
+
/*< private >*/
XfdesktopFileIconManagerPrivate *priv;
};
diff --git a/src/xfdesktop-file-icon.c b/src/xfdesktop-file-icon.c
index 2f975cb..b47384c 100644
--- a/src/xfdesktop-file-icon.c
+++ b/src/xfdesktop-file-icon.c
@@ -68,7 +68,7 @@ xfdesktop_file_icon_class_init(XfdesktopFileIconClass *klass)
gobject_class->finalize = xfdesktop_file_icon_finalize;
gobject_class->set_property = xfdesktop_file_icon_set_property;
gobject_class->get_property = xfdesktop_file_icon_get_property;
-
+
icon_class->activated = xfdesktop_file_icon_activated;
g_object_class_install_property(gobject_class,
@@ -144,12 +144,12 @@ xfdesktop_file_icon_activated(XfdesktopIcon *icon)
GFile *file = xfdesktop_file_icon_peek_file(file_icon);
GtkWidget *icon_view, *toplevel;
GdkScreen *gscreen;
-
+
TRACE("entering");
if(!info)
return FALSE;
-
+
icon_view = xfdesktop_icon_peek_icon_view(icon);
toplevel = gtk_widget_get_toplevel(icon_view);
gscreen = gtk_widget_get_screen(icon_view);
@@ -160,7 +160,7 @@ xfdesktop_file_icon_activated(XfdesktopIcon *icon)
xfdesktop_file_utils_execute(NULL, file, NULL, gscreen, GTK_WINDOW(toplevel));
else
xfdesktop_file_utils_launch(file, gscreen, GTK_WINDOW(toplevel));
-
+
return TRUE;
}
@@ -169,11 +169,11 @@ GFileInfo *
xfdesktop_file_icon_peek_file_info(XfdesktopFileIcon *icon)
{
XfdesktopFileIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), NULL);
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->peek_file_info)
return klass->peek_file_info(icon);
else
@@ -184,11 +184,11 @@ GFileInfo *
xfdesktop_file_icon_peek_filesystem_info(XfdesktopFileIcon *icon)
{
XfdesktopFileIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), NULL);
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->peek_filesystem_info)
return klass->peek_filesystem_info(icon);
else
@@ -199,11 +199,11 @@ GFile *
xfdesktop_file_icon_peek_file(XfdesktopFileIcon *icon)
{
XfdesktopFileIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), NULL);
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->peek_file)
return klass->peek_file(icon);
else
@@ -215,11 +215,11 @@ xfdesktop_file_icon_update_file_info(XfdesktopFileIcon *icon,
GFileInfo *info)
{
XfdesktopFileIconClass *klass;
-
+
g_return_if_fail(XFDESKTOP_IS_FILE_ICON(icon));
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->update_file_info)
klass->update_file_info(icon, info);
}
@@ -228,11 +228,11 @@ gboolean
xfdesktop_file_icon_can_rename_file(XfdesktopFileIcon *icon)
{
XfdesktopFileIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), FALSE);
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->can_rename_file)
return klass->can_rename_file(icon);
else
@@ -243,11 +243,11 @@ gboolean
xfdesktop_file_icon_can_delete_file(XfdesktopFileIcon *icon)
{
XfdesktopFileIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), FALSE);
-
+
klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-
+
if(klass->can_delete_file)
return klass->can_delete_file(icon);
else
diff --git a/src/xfdesktop-file-icon.h b/src/xfdesktop-file-icon.h
index 69b2a26..7d9a512 100644
--- a/src/xfdesktop-file-icon.h
+++ b/src/xfdesktop-file-icon.h
@@ -49,13 +49,13 @@ struct _XfdesktopFileIcon
struct _XfdesktopFileIconClass
{
XfdesktopIconClass parent;
-
+
/*< virtual functions >*/
GFileInfo *(*peek_file_info)(XfdesktopFileIcon *icon);
GFileInfo *(*peek_filesystem_info)(XfdesktopFileIcon *icon);
GFile *(*peek_file)(XfdesktopFileIcon *icon);
void (*update_file_info)(XfdesktopFileIcon *icon, GFileInfo *info);
-
+
gboolean (*can_rename_file)(XfdesktopFileIcon *icon);
gboolean (*can_delete_file)(XfdesktopFileIcon *icon);
};
diff --git a/src/xfdesktop-file-utils.h b/src/xfdesktop-file-utils.h
index 20566d9..1fb2591 100644
--- a/src/xfdesktop-file-utils.h
+++ b/src/xfdesktop-file-utils.h
@@ -33,8 +33,8 @@
gboolean xfdesktop_file_utils_is_desktop_file(GFileInfo *info);
gboolean xfdesktop_file_utils_file_is_executable(GFileInfo *info);
gchar *xfdesktop_file_utils_format_time_for_display(guint64 file_time);
-GKeyFile *xfdesktop_file_utils_query_key_file(GFile *file,
- GCancellable *cancellable,
+GKeyFile *xfdesktop_file_utils_query_key_file(GFile *file,
+ GCancellable *cancellable,
GError **error);
gchar *xfdesktop_file_utils_get_display_name(GFile *file,
GFileInfo *info);
diff --git a/src/xfdesktop-icon-view-manager.c b/src/xfdesktop-icon-view-manager.c
index d93349c..5b76e43 100644
--- a/src/xfdesktop-icon-view-manager.c
+++ b/src/xfdesktop-icon-view-manager.c
@@ -31,7 +31,7 @@ GType
xfdesktop_icon_view_manager_get_type(void)
{
static GType manager_type = 0;
-
+
if(!manager_type) {
static const GTypeInfo manager_info = {
sizeof(XfdesktopIconViewManagerIface),
@@ -44,13 +44,13 @@ xfdesktop_icon_view_manager_get_type(void)
0,
NULL,
};
-
+
manager_type = g_type_register_static(G_TYPE_INTERFACE,
"XfdesktopIconViewManager",
&manager_info, 0);
g_type_interface_add_prerequisite(manager_type, G_TYPE_OBJECT);
}
-
+
return manager_type;
}
@@ -59,13 +59,13 @@ xfdesktop_icon_view_manager_init(XfdesktopIconViewManager *manager,
XfdesktopIconView *icon_view)
{
XfdesktopIconViewManagerIface *iface;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager)
&& XFDESKTOP_IS_ICON_VIEW(icon_view), FALSE);
-
+
iface = XFDESKTOP_ICON_VIEW_MANAGER_GET_IFACE(manager);
g_return_val_if_fail(iface->manager_init, FALSE);
-
+
return iface->manager_init(manager, icon_view);
}
@@ -73,12 +73,12 @@ void
xfdesktop_icon_view_manager_fini(XfdesktopIconViewManager *manager)
{
XfdesktopIconViewManagerIface *iface;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager));
-
+
iface = XFDESKTOP_ICON_VIEW_MANAGER_GET_IFACE(manager);
g_return_if_fail(iface->manager_fini);
-
+
iface->manager_fini(manager);
}
@@ -91,12 +91,12 @@ xfdesktop_icon_view_manager_drag_drop(XfdesktopIconViewManager *manager,
guint time_)
{
XfdesktopIconViewManagerIface *iface;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager), FALSE);
-
+
iface = XFDESKTOP_ICON_VIEW_MANAGER_GET_IFACE(manager);
g_return_val_if_fail(iface->drag_drop, FALSE);
-
+
return iface->drag_drop(manager, drop_icon, context, row, col, time_);
}
@@ -111,12 +111,12 @@ xfdesktop_icon_view_manager_drag_data_received(XfdesktopIconViewManager *manager
guint time_)
{
XfdesktopIconViewManagerIface *iface;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager));
-
+
iface = XFDESKTOP_ICON_VIEW_MANAGER_GET_IFACE(manager);
g_return_if_fail(iface->drag_data_received);
-
+
iface->drag_data_received(manager, drop_icon, context, row, col, data, info,
time_);
}
@@ -130,12 +130,12 @@ xfdesktop_icon_view_manager_drag_data_get(XfdesktopIconViewManager *manager,
guint time_)
{
XfdesktopIconViewManagerIface *iface;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager));
-
+
iface = XFDESKTOP_ICON_VIEW_MANAGER_GET_IFACE(manager);
g_return_if_fail(iface->drag_data_get);
-
+
iface->drag_data_get(manager, drag_icons, context, data, info, time_);
}
diff --git a/src/xfdesktop-icon-view-manager.h b/src/xfdesktop-icon-view-manager.h
index da75898..49529d6 100644
--- a/src/xfdesktop-icon-view-manager.h
+++ b/src/xfdesktop-icon-view-manager.h
@@ -42,12 +42,12 @@ struct _XfdesktopIconView;
struct _XfdesktopIconViewManagerIface
{
GTypeInterface g_iface;
-
+
/*< virtual functions >*/
gboolean (*manager_init)(XfdesktopIconViewManager *manager,
struct _XfdesktopIconView *icon_view);
void (*manager_fini)(XfdesktopIconViewManager *manager);
-
+
gboolean (*drag_drop)(XfdesktopIconViewManager *manager,
XfdesktopIcon *drop_icon,
GdkDragContext *context,
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 6ef6053..0900f0e 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -138,13 +138,13 @@ struct _XfdesktopIconViewPrivate
gint ymargin;
gint xspacing;
gint yspacing;
-
+
gint16 nrows;
gint16 ncols;
XfdesktopIcon **grid_layout;
-
+
guint grid_resize_timeout;
-
+
GtkSelectionMode sel_mode;
guint maybe_begin_drag:1,
definitely_dragging:1,
@@ -157,19 +157,19 @@ struct _XfdesktopIconViewPrivate
GdkRectangle band_rect;
XfconfChannel *channel;
-
+
XfdesktopIcon *cursor;
XfdesktopIcon *first_clicked_item;
XfdesktopIcon *item_under_pointer;
-
+
GtkTargetList *native_targets;
GtkTargetList *source_targets;
GtkTargetList *dest_targets;
-
+
gboolean drag_source_set;
GdkDragAction foreign_source_actions;
GdkModifierType foreign_source_mask;
-
+
gboolean drag_dest_set;
GdkDragAction foreign_dest_actions;
@@ -255,7 +255,7 @@ static void xfdesktop_icon_view_drag_data_received(GtkWidget *widget,
GtkSelectionData *data,
guint info,
guint time_);
-
+
static void xfdesktop_icon_view_finalize(GObject *obj);
static void xfdesktop_icon_view_add_move_binding(GtkBindingSet *binding_set,
@@ -286,7 +286,7 @@ static void xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
static void xfdesktop_icon_view_repaint_icons(XfdesktopIconView *icon_view,
GdkRectangle *area,
cairo_t *cr);
-
+
static void xfdesktop_setup_grids(XfdesktopIconView *icon_view);
static gboolean xfdesktop_grid_get_next_free_position(XfdesktopIconView *icon_view,
gint16 *row,
@@ -403,13 +403,13 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass)
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class(klass);
-
+
g_type_class_add_private(klass, sizeof(XfdesktopIconViewPrivate));
-
+
gobject_class->finalize = xfdesktop_icon_view_finalize;
gobject_class->set_property = xfce_icon_view_set_property;
gobject_class->get_property = xfce_icon_view_get_property;
-
+
widget_class->style_updated = xfdesktop_icon_view_style_updated;
widget_class->realize = xfdesktop_icon_view_realize;
widget_class->unrealize = xfdesktop_icon_view_unrealize;
@@ -419,12 +419,12 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass)
widget_class->drag_drop = xfdesktop_icon_view_drag_drop;
widget_class->drag_data_get = xfdesktop_icon_view_drag_data_get;
widget_class->drag_data_received = xfdesktop_icon_view_drag_data_received;
-
+
klass->select_all = xfdesktop_icon_view_real_select_all;
klass->unselect_all = xfdesktop_icon_view_real_unselect_all;
klass->select_cursor_item = xfdesktop_icon_view_real_select_cursor_item;
klass->toggle_cursor_item = xfdesktop_icon_view_real_toggle_cursor_item;
- klass->activate_cursor_item = xfdesktop_icon_view_real_activate_cursor_item;
+ klass->activate_cursor_item = xfdesktop_icon_view_real_activate_cursor_item;
klass->move_cursor = xfdesktop_icon_view_real_move_cursor;
__signals[SIG_ICON_SELECTION_CHANGED] = g_signal_new("icon-selection-changed",
@@ -435,7 +435,7 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
+
__signals[SIG_ICON_ACTIVATED] = g_signal_new("icon-activated",
XFDESKTOP_TYPE_ICON_VIEW,
G_SIGNAL_RUN_LAST,
@@ -489,7 +489,7 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass)
NULL, NULL,
xfdesktop_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN, 0);
-
+
__signals[SIG_MOVE_CURSOR] = g_signal_new(I_("move-cursor"),
XFDESKTOP_TYPE_ICON_VIEW,
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -517,14 +517,14 @@ xfdesktop_icon_view_class_init(XfdesktopIconViewClass *klass)
"Spacing between desktop icon cells",
0, 255, 2,
G_PARAM_READABLE));
-
+
gtk_widget_class_install_style_property(widget_class,
g_param_spec_int("cell-padding",
"Cell padding",
"Padding in desktop icon cell",
0, 255, 6,
G_PARAM_READABLE));
-
+
gtk_widget_class_install_style_property(widget_class,
g_param_spec_double("cell-text-width-proportion",
"Cell text width proportion",
@@ -659,27 +659,27 @@ xfdesktop_icon_view_init(XfdesktopIconView *icon_view)
icon_view->priv = G_TYPE_INSTANCE_GET_PRIVATE(icon_view,
XFDESKTOP_TYPE_ICON_VIEW,
XfdesktopIconViewPrivate);
-
+
icon_view->priv->icon_size = DEFAULT_ICON_SIZE;
icon_view->priv->font_size = DEFAULT_FONT_SIZE;
icon_view->priv->allow_rubber_banding = TRUE;
-
+
icon_view->priv->native_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
-
+
icon_view->priv->source_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
gtk_drag_source_set(GTK_WIDGET(icon_view), 0, NULL, 0, GDK_ACTION_MOVE);
-
+
icon_view->priv->dest_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
gtk_drag_dest_set(GTK_WIDGET(icon_view), 0, NULL, 0, GDK_ACTION_MOVE);
-
+
g_object_set(G_OBJECT(icon_view), "has-tooltip", TRUE, NULL);
g_signal_connect(G_OBJECT(icon_view), "query-tooltip",
G_CALLBACK(xfdesktop_icon_view_show_tooltip), NULL);
-
+
gtk_widget_set_has_window(GTK_WIDGET(icon_view), FALSE);
gtk_widget_set_can_focus(GTK_WIDGET(icon_view), FALSE);
@@ -691,16 +691,16 @@ static void
xfdesktop_icon_view_finalize(GObject *obj)
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(obj);
-
+
if(icon_view->priv->manager) {
xfdesktop_icon_view_manager_fini(icon_view->priv->manager);
g_object_unref(G_OBJECT(icon_view->priv->manager));
}
-
+
gtk_target_list_unref(icon_view->priv->native_targets);
gtk_target_list_unref(icon_view->priv->source_targets);
gtk_target_list_unref(icon_view->priv->dest_targets);
-
+
g_list_foreach(icon_view->priv->pending_icons, (GFunc)g_object_unref, NULL);
g_list_free(icon_view->priv->pending_icons);
/* icon_view->priv->icons should be cleared in _unrealize() */
@@ -844,7 +844,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
if(icon_l && (icon = icon_l->data)) {
if(xfdesktop_icon_view_is_icon_selected(icon_view, icon)) {
/* clicked an already-selected icon */
-
+
if(evt->state & GDK_CONTROL_MASK)
icon_view->priv->control_click = TRUE;
@@ -858,16 +858,16 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
* down the ctrl key. we'll handle shift in the next block,
* but for shift we do need to unselect everything */
xfdesktop_icon_view_unselect_all(icon_view);
-
+
if(!(evt->state & GDK_SHIFT_MASK))
icon_view->priv->first_clicked_item = NULL;
}
-
+
icon_view->priv->cursor = icon;
-
+
if(!icon_view->priv->first_clicked_item)
icon_view->priv->first_clicked_item = icon;
-
+
if(icon_view->priv->sel_mode == GTK_SELECTION_MULTIPLE
&& evt->state & GDK_SHIFT_MASK
&& icon_view->priv->first_clicked_item
@@ -879,7 +879,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
} else
xfdesktop_icon_view_select_item(icon_view, icon);
}
-
+
if(evt->button == 1 || evt->button == 3) {
/* we might be the start of a drag */
DBG("setting stuff");
@@ -889,7 +889,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
icon_view->priv->press_start_x = evt->x;
icon_view->priv->press_start_y = evt->y;
}
-
+
return TRUE;
} else {
/* Button press wasn't over any icons */
@@ -899,7 +899,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
{
xfdesktop_icon_view_unselect_all(icon_view);
}
-
+
icon_view->priv->cursor = NULL;
icon_view->priv->first_clicked_item = NULL;
@@ -932,7 +932,7 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
icon_view->priv->maybe_begin_drag = FALSE;
icon_view->priv->definitely_dragging = FALSE;
icon_view->priv->definitely_rubber_banding = FALSE;
-
+
if(evt->button == 1) {
GList *icon_l = g_list_find_custom(icon_view->priv->icons, evt,
(GCompareFunc)xfdesktop_check_icon_clicked);
@@ -945,10 +945,10 @@ xfdesktop_icon_view_button_press(GtkWidget *widget,
xfdesktop_icon_view_unselect_all(icon_view);
}
}
-
+
return TRUE;
}
-
+
return FALSE;
}
@@ -1092,14 +1092,14 @@ xfdesktop_icon_view_focus_in(GtkWidget *widget,
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(user_data);
GList *l;
-
+
gtk_widget_grab_focus(GTK_WIDGET(icon_view));
DBG("GOT FOCUS");
-
+
for(l = icon_view->priv->selected_icons; l; l = l->next) {
xfdesktop_icon_view_invalidate_icon(icon_view, l->data, FALSE);
}
-
+
return FALSE;
}
@@ -1110,7 +1110,7 @@ xfdesktop_icon_view_focus_out(GtkWidget *widget,
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(user_data);
GList *l;
-
+
DBG("LOST FOCUS");
for(l = icon_view->priv->selected_icons; l; l = l->next) {
@@ -1131,10 +1131,10 @@ xfdesktop_icon_view_maybe_begin_drag(XfdesktopIconView *icon_view,
GdkEventMotion *evt)
{
GdkDragAction actions;
-
+
/* sanity check */
g_return_val_if_fail(icon_view->priv->cursor, FALSE);
-
+
if(!gtk_drag_check_threshold(GTK_WIDGET(icon_view),
icon_view->priv->press_start_x,
icon_view->priv->press_start_y,
@@ -1142,10 +1142,10 @@ xfdesktop_icon_view_maybe_begin_drag(XfdesktopIconView *icon_view,
{
return FALSE;
}
-
+
actions = GDK_ACTION_MOVE | (icon_view->priv->drag_source_set ?
icon_view->priv->foreign_source_actions : 0);
-
+
if(!(evt->state & GDK_BUTTON3_MASK)) {
gtk_drag_begin_with_coordinates(GTK_WIDGET(icon_view),
icon_view->priv->source_targets,
@@ -1163,9 +1163,9 @@ xfdesktop_icon_view_maybe_begin_drag(XfdesktopIconView *icon_view,
-1,
-1);
}
-
+
DBG("DRAG BEGIN!");
-
+
return TRUE;
}
@@ -1181,7 +1181,7 @@ xfdesktop_icon_view_show_tooltip(GtkWidget *widget,
const gchar *tip_text;
gchar *padded_tip_text = NULL;
gint tooltip_size;
-
+
if(!icon_view->priv->item_under_pointer
|| icon_view->priv->definitely_dragging)
{
@@ -1221,7 +1221,7 @@ xfdesktop_icon_view_motion_notify(GtkWidget *widget,
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(user_data);
gboolean ret = FALSE;
-
+
if(icon_view->priv->maybe_begin_drag
&& icon_view->priv->item_under_pointer
&& !icon_view->priv->definitely_dragging)
@@ -1332,7 +1332,7 @@ xfdesktop_icon_view_motion_notify(GtkWidget *widget,
GdkRectangle extents;
/* normal movement; highlight icons as they go under the pointer */
-
+
if(icon_view->priv->item_under_pointer) {
if(G_UNLIKELY(icon_view->priv->single_click)) {
GdkCursor *cursor = gdk_cursor_new_for_display(gtk_widget_get_display(widget), GDK_HAND2);
@@ -1364,7 +1364,7 @@ xfdesktop_icon_view_motion_notify(GtkWidget *widget,
}
}
}
-
+
gdk_event_request_motions(evt);
return ret;
@@ -1376,7 +1376,7 @@ xfdesktop_icon_view_leave_notify(GtkWidget *widget,
gpointer user_data)
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(user_data);
-
+
if(icon_view->priv->item_under_pointer) {
XfdesktopIcon *icon = icon_view->priv->item_under_pointer;
icon_view->priv->item_under_pointer = NULL;
@@ -1389,7 +1389,7 @@ xfdesktop_icon_view_leave_notify(GtkWidget *widget,
gdk_window_set_cursor(gtk_widget_get_window(widget), NULL);
}
}
-
+
return FALSE;
}
@@ -1400,13 +1400,13 @@ xfdesktop_icon_view_drag_begin(GtkWidget *widget,
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
XfdesktopIcon *icon;
GdkRectangle extents;
-
+
icon = icon_view->priv->cursor;
g_return_if_fail(icon);
-
+
if(xfdesktop_icon_get_extents(icon, NULL, NULL, &extents)) {
GdkPixbuf *pix;
-
+
pix = xfdesktop_icon_peek_pixbuf(icon, ICON_WIDTH, ICON_SIZE);
if(pix)
gtk_drag_set_icon_pixbuf(context, pix, 0, 0);
@@ -1421,7 +1421,7 @@ xfdesktop_xy_to_rowcol(XfdesktopIconView *icon_view,
gint16 *col)
{
g_return_if_fail(row && col);
-
+
*row = (y - icon_view->priv->yorigin - icon_view->priv->ymargin) / (CELL_SIZE + icon_view->priv->yspacing);
*col = (x - icon_view->priv->xorigin - icon_view->priv->xmargin) / (CELL_SIZE + icon_view->priv->xspacing);
}
@@ -1439,8 +1439,8 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
XfdesktopIcon *icon_on_dest = NULL;
GdkDragAction our_action = 0;
gboolean is_local_drag;
-
- target = gtk_drag_dest_find_target(widget, context,
+
+ target = gtk_drag_dest_find_target(widget, context,
icon_view->priv->native_targets);
if(target == GDK_NONE) {
target = gtk_drag_dest_find_target(widget, context,
@@ -1448,7 +1448,7 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
if(target == GDK_NONE)
return FALSE;
}
-
+
/* can we drop here? */
xfdesktop_xy_to_rowcol(icon_view, x, y, &hover_row, &hover_col);
if(hover_row >= icon_view->priv->nrows || hover_col >= icon_view->priv->ncols)
@@ -1460,16 +1460,16 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
return FALSE;
} else if(!xfdesktop_grid_is_free_position(icon_view, hover_row, hover_col))
return FALSE;
-
+
is_local_drag = (target == gdk_atom_intern("XFDESKTOP_ICON", FALSE));
-
+
/* at this point there are four cases to account for:
* 1. local drag, empty space -> MOVE
* 2. local drag, icon is there -> depends on icon_on_dest
* 3. foreign drag, empty space -> depends on the source
* 4. foreign drag, icon is there -> depends on source and icon_on_dest
*/
-
+
if(!icon_on_dest) {
if(is_local_drag) /* # 1 */
our_action = GDK_ACTION_MOVE;
@@ -1483,7 +1483,7 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
GList *l;
gint16 sel_row, sel_col;
gboolean action_ask = FALSE;
-
+
/* check to make sure we aren't just hovering over ourself */
for(l = icon_view->priv->selected_icons; l; l = l->next) {
XfdesktopIcon *sel_icon = l->data;
@@ -1493,7 +1493,7 @@ xfdesktop_icon_view_drag_motion(GtkWidget *widget,
return FALSE;
}
}
-
+
if(allowed_actions & GDK_ACTION_ASK)
action_ask = TRUE;
@@ -1597,7 +1597,7 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
gint16 old_row, old_col, row, col, offset_col, offset_row;
GList *l;
XfdesktopIcon *icon_on_dest = NULL;
-
+
DBG("entering: (%d,%d)", x, y);
DBG("unsetting stuff");
@@ -1606,8 +1606,8 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
icon_view->priv->maybe_begin_drag = FALSE;
icon_view->priv->definitely_dragging = FALSE;
icon_view->priv->dropped = TRUE;
-
- target = gtk_drag_dest_find_target(widget, context,
+
+ target = gtk_drag_dest_find_target(widget, context,
icon_view->priv->native_targets);
if(target == GDK_NONE) {
target = gtk_drag_dest_find_target(widget, context,
@@ -1616,15 +1616,15 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
return FALSE;
}
XF_DEBUG("target=%ld (%s)", (glong)target, gdk_atom_name(target));
-
+
xfdesktop_xy_to_rowcol(icon_view, x, y, &row, &col);
icon_on_dest = xfdesktop_icon_view_icon_in_cell(icon_view, row, col);
-
+
if(target == gdk_atom_intern("XFDESKTOP_ICON", FALSE)) {
if(icon_on_dest) {
GdkDragAction action;
gboolean ret = FALSE;
-
+
action = gdk_drag_context_get_selected_action(context);
#ifdef ENABLE_FILE_ICONS
@@ -1647,15 +1647,15 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
ret = TRUE;
}
}
-
+
gtk_drag_finish(context, ret, FALSE, time_);
-
+
return ret;
}
-
+
icon = icon_view->priv->cursor;
g_return_val_if_fail(icon, FALSE);
-
+
/* 1: Get amount of offset between the old slot and new slot
* of the icon that's being dragged.
* 2: Remove all the icons that are going to be moved from
@@ -1701,9 +1701,9 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
/* clear out old extents, if any */
xfdesktop_icon_view_invalidate_icon(icon_view, l->data, TRUE);
}
-
+
XF_DEBUG("drag succeeded");
-
+
gtk_drag_finish(context, TRUE, FALSE, time_);
} else {
g_object_set_data(G_OBJECT(context), "--xfdesktop-icon-view-drop-icon",
@@ -1713,7 +1713,7 @@ xfdesktop_icon_view_drag_drop(GtkWidget *widget,
context,
row, col, time_);
}
-
+
return TRUE;
}
@@ -1725,7 +1725,7 @@ xfdesktop_icon_view_drag_data_get(GtkWidget *widget,
guint time_)
{
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
-
+
DBG("entering");
if(XFDESKTOP_IS_WINDOW_ICON_MANAGER(icon_view->priv->manager))
@@ -1735,7 +1735,7 @@ xfdesktop_icon_view_drag_data_get(GtkWidget *widget,
* but works when the file(s) are dropped */
if(icon_view->priv->selected_icons == NULL)
return;
-
+
xfdesktop_icon_view_manager_drag_data_get(icon_view->priv->manager,
icon_view->priv->selected_icons,
context, data, info, time_);
@@ -1755,12 +1755,12 @@ xfdesktop_icon_view_drag_data_received(GtkWidget *widget,
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
gint16 row, col;
XfdesktopIcon *icon_on_dest;
-
+
DBG("entering");
-
+
icon_on_dest = g_object_get_data(G_OBJECT(context),
"--xfdesktop-icon-view-drop-icon");
-
+
if(icon_view->priv->dropped) {
xfdesktop_xy_to_rowcol(icon_view, x, y, &row, &col);
if(row >= icon_view->priv->nrows || col >= icon_view->priv->ncols)
@@ -1902,7 +1902,7 @@ xfdesktop_icon_view_icon_theme_changed(GtkIconTheme *icon_theme,
gpointer user_data)
{
gtk_widget_queue_draw(GTK_WIDGET(user_data));
-}
+}
static void
xfdesktop_icon_view_style_updated(GtkWidget *widget)
@@ -1951,14 +1951,14 @@ xfdesktop_icon_view_realize(GtkWidget *widget)
* but we do NOT shut it down if we unrealize, since there may not be
* a reason to do so. shutdown occurs in finalize. */
xfdesktop_icon_view_manager_init(icon_view->priv->manager, icon_view);
-
+
gtk_widget_set_realized(widget, TRUE);
-
+
gtk_window_set_accept_focus(GTK_WINDOW(icon_view->priv->parent_window),
TRUE);
gtk_window_set_focus_on_map(GTK_WINDOW(icon_view->priv->parent_window),
FALSE);
-
+
pctx = gtk_widget_get_pango_context(GTK_WIDGET(icon_view));
icon_view->priv->playout = pango_layout_new(pctx);
@@ -1966,9 +1966,9 @@ xfdesktop_icon_view_realize(GtkWidget *widget)
xfdesktop_icon_view_modify_font_size(icon_view,
icon_view->priv->font_size);
}
-
+
xfdesktop_setup_grids(icon_view);
-
+
/* unfortunately GTK_NO_WINDOW widgets don't receive events, with the
* exception of draw events. */
gtk_widget_add_events(icon_view->priv->parent_window,
@@ -2024,17 +2024,17 @@ xfdesktop_icon_view_unrealize(GtkWidget *widget)
XfdesktopIconView *icon_view = XFDESKTOP_ICON_VIEW(widget);
GdkScreen *gscreen;
GdkWindow *groot;
-
+
gtk_window_set_accept_focus(GTK_WINDOW(icon_view->priv->parent_window), FALSE);
-
+
gscreen = gtk_widget_get_screen(widget);
groot = gdk_screen_get_root_window(gscreen);
gdk_window_remove_filter(groot, xfdesktop_rootwin_watch_workarea, icon_view);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(gtk_icon_theme_get_for_screen(gscreen)),
G_CALLBACK(xfdesktop_icon_view_icon_theme_changed),
icon_view);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(icon_view->priv->parent_window),
G_CALLBACK(xfdesktop_icon_view_motion_notify), icon_view);
g_signal_handlers_disconnect_by_func(G_OBJECT(icon_view->priv->parent_window),
@@ -2049,16 +2049,16 @@ xfdesktop_icon_view_unrealize(GtkWidget *widget)
G_CALLBACK(xfdesktop_icon_view_focus_in), icon_view);
g_signal_handlers_disconnect_by_func(G_OBJECT(icon_view->priv->parent_window),
G_CALLBACK(xfdesktop_icon_view_focus_out), icon_view);
-
+
if(icon_view->priv->grid_resize_timeout) {
g_source_remove(icon_view->priv->grid_resize_timeout);
icon_view->priv->grid_resize_timeout = 0;
}
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(gscreen),
G_CALLBACK(xfdesktop_screen_size_changed_cb),
icon_view);
-
+
/* FIXME: really clear these? */
g_list_free(icon_view->priv->selected_icons);
icon_view->priv->selected_icons = NULL;
@@ -2067,10 +2067,10 @@ xfdesktop_icon_view_unrealize(GtkWidget *widget)
g_free(icon_view->priv->grid_layout);
icon_view->priv->grid_layout = NULL;
-
+
g_object_unref(G_OBJECT(icon_view->priv->playout));
icon_view->priv->playout = NULL;
-
+
gtk_widget_set_window(widget, NULL);
gtk_widget_set_realized(widget, FALSE);
}
@@ -2087,7 +2087,7 @@ xfdesktop_icon_view_draw(GtkWidget *widget,
gint i;
/*DBG("entering");*/
-
+
rects = cairo_copy_clip_rectangle_list(cr);
if(rects->status != CAIRO_STATUS_SUCCESS) {
@@ -2335,7 +2335,7 @@ xfdesktop_icon_view_move_cursor_left_right(XfdesktopIconView *icon_view,
icon = xfdesktop_icon_view_find_first_icon(icon_view);
else
icon = xfdesktop_icon_view_find_last_icon(icon_view);
-
+
if(icon) {
xfdesktop_icon_view_select_item(icon_view, icon);
icon_view->priv->cursor = icon;
@@ -2398,7 +2398,7 @@ xfdesktop_icon_view_move_cursor_up_down(XfdesktopIconView *icon_view,
icon = xfdesktop_icon_view_find_first_icon(icon_view);
else
icon = xfdesktop_icon_view_find_last_icon(icon_view);
-
+
if(icon) {
xfdesktop_icon_view_select_item(icon_view, icon);
icon_view->priv->cursor = icon;
@@ -2502,7 +2502,7 @@ xfdesktop_screen_size_changed_cb(GdkScreen *gscreen,
g_source_remove(icon_view->priv->grid_resize_timeout);
icon_view->priv->grid_resize_timeout = g_timeout_add(7000,
xfdesktop_grid_resize_timeout,
- icon_view);
+ icon_view);
}
static void
@@ -2513,7 +2513,7 @@ xfdesktop_icon_view_repaint_icons(XfdesktopIconView *icon_view,
GdkRectangle extents, dummy;
GList *l;
XfdesktopIcon *icon;
-
+
/* fist paint non-selected items, then paint selected items */
for(l = icon_view->priv->icons; l; l = l->next) {
icon = (XfdesktopIcon *)l->data;
@@ -2526,7 +2526,7 @@ xfdesktop_icon_view_repaint_icons(XfdesktopIconView *icon_view,
xfdesktop_icon_view_paint_icon(icon_view, icon, area, cr);
}
}
-
+
for(l = icon_view->priv->icons; l; l = l->next) {
icon = (XfdesktopIcon *)l->data;
if (!xfdesktop_icon_view_is_icon_selected(icon_view, icon))
@@ -2552,12 +2552,12 @@ xfdesktop_rectangle_is_bounded_by(GdkRectangle *rect,
GdkRectangle *bounds)
{
GdkRectangle intersection;
-
+
if(gdk_rectangle_intersect(rect, bounds, &intersection)) {
if(xfdesktop_rectangle_equal(rect, &intersection))
return TRUE;
}
-
+
return FALSE;
}
@@ -2572,7 +2572,7 @@ xfdesktop_icon_view_setup_grids_xinerama(XfdesktopIconView *icon_view)
#endif
GdkRectangle *monitor_geoms, cell_rect;
gint nmonitors, i, row, col;
-
+
DBG("entering");
#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
@@ -2584,7 +2584,7 @@ xfdesktop_icon_view_setup_grids_xinerama(XfdesktopIconView *icon_view)
#endif
if(nmonitors == 1) /* optimisation */
return;
-
+
monitor_geoms = g_new0(GdkRectangle, nmonitors);
#if 0 /* GTK_CHECK_VERSION (3, 22, 0) */
@@ -2651,7 +2651,7 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view)
monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_parent_window(GTK_WIDGET(icon_view)));
}
gdk_monitor_get_workarea (monitor, &rectangle);
-
+
icon_view->priv->xorigin = rectangle.x;
icon_view->priv->yorigin = rectangle.y;
icon_view->priv->width = rectangle.width;
@@ -2693,17 +2693,17 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view)
if(icon_view->priv->grid_layout) {
icon_view->priv->grid_layout = g_realloc(icon_view->priv->grid_layout,
new_size);
-
+
if(new_size > old_size) {
memset(((guint8 *)icon_view->priv->grid_layout) + old_size, 0,
new_size - old_size);
}
} else
icon_view->priv->grid_layout = g_malloc0(new_size);
-
+
XF_DEBUG("created grid_layout with %lu positions", (gulong)(new_size/sizeof(gpointer)));
DUMP_GRID_LAYOUT(icon_view);
-
+
xfdesktop_icon_view_setup_grids_xinerama(icon_view);
}
@@ -2714,7 +2714,7 @@ xfdesktop_rootwin_watch_workarea(GdkXEvent *gxevent,
{
XfdesktopIconView *icon_view = user_data;
XPropertyEvent *xevt = (XPropertyEvent *)gxevent;
-
+
if(xevt->type == PropertyNotify
&& XInternAtom(xevt->display, "_NET_WORKAREA", False) == xevt->atom)
{
@@ -2725,7 +2725,7 @@ xfdesktop_rootwin_watch_workarea(GdkXEvent *gxevent,
}
xfdesktop_grid_do_resize(icon_view);
}
-
+
return GDK_FILTER_CONTINUE;
}
@@ -2736,9 +2736,9 @@ xfdesktop_icon_view_invalidate_icon(XfdesktopIconView *icon_view,
{
GdkRectangle extents, box_extents;
gboolean invalidated_something = FALSE;
-
+
g_return_if_fail(icon);
-
+
/*DBG("entering (recalc=%s)", recalc_extents?"true":"false");*/
/* we always have to invalidate the old extents */
@@ -2751,7 +2751,7 @@ xfdesktop_icon_view_invalidate_icon(XfdesktopIconView *icon_view,
invalidated_something = TRUE;
} else
recalc_extents = TRUE;
-
+
if(recalc_extents) {
GdkRectangle pixbuf_extents, text_extents, total_extents;
@@ -2781,20 +2781,20 @@ xfdesktop_icon_view_invalidate_icon_pixbuf(XfdesktopIconView *icon_view,
XfdesktopIcon *icon)
{
GdkPixbuf *pix;
-
+
pix = xfdesktop_icon_peek_pixbuf(icon, ICON_WIDTH, ICON_SIZE);
if(pix) {
GdkRectangle rect = { 0, };
-
+
rect.width = gdk_pixbuf_get_width(pix);
rect.height = gdk_pixbuf_get_height(pix);
if(!xfdesktop_icon_view_shift_area_to_cell(icon_view, icon, &rect))
return;
-
+
rect.x += CELL_PADDING + ((CELL_SIZE - 2 * CELL_PADDING) - rect.width) / 2;
rect.y += CELL_PADDING + (ICON_SIZE - rect.height) / 2;;
-
+
if(gtk_widget_get_realized(GTK_WIDGET(icon_view))) {
gtk_widget_queue_draw_area(GTK_WIDGET(icon_view), rect.x, rect.y,
rect.width, rect.height);
@@ -3008,7 +3008,7 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
playout = icon_view->priv->playout;
cr = cairo_reference(cr);
-
+
if(!xfdesktop_icon_get_extents(icon, &pixbuf_extents,
&text_extents, &total_extents))
{
@@ -3032,7 +3032,7 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
state = GTK_STATE_FLAG_ACTIVE;
} else
state = GTK_STATE_FLAG_NORMAL;
-
+
if(gdk_rectangle_intersect(area, &pixbuf_extents, &intersection)) {
GdkPixbuf *pix = xfdesktop_icon_peek_pixbuf(icon, ICON_WIDTH, ICON_SIZE);
GdkPixbuf *pix_free = NULL;
@@ -3074,7 +3074,7 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
#endif
xfdesktop_icon_view_draw_image(cr, pix, &pixbuf_extents);
-
+
if(pix_free)
g_object_unref(G_OBJECT(pix_free));
}
@@ -3142,7 +3142,7 @@ static void
xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view)
{
GList *l = NULL;
-
+
/* move all icons into the pending_icons list and remove from the desktop */
for(l = icon_view->priv->icons; l; l = l->next) {
gint16 old_row, old_col;
@@ -3161,7 +3161,7 @@ xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view)
memset(icon_view->priv->grid_layout, 0,
(guint)icon_view->priv->nrows * icon_view->priv->ncols
* sizeof(XfdesktopIcon *));
-
+
xfdesktop_setup_grids(icon_view);
}
@@ -3349,9 +3349,9 @@ static gboolean
xfdesktop_grid_resize_timeout(gpointer user_data)
{
XfdesktopIconView *icon_view = user_data;
-
+
xfdesktop_grid_do_resize(icon_view);
-
+
icon_view->priv->grid_resize_timeout = 0;
return FALSE;
}
@@ -3370,7 +3370,7 @@ xfdesktop_grid_is_free_position(XfdesktopIconView *icon_view,
{
return FALSE;
}
-
+
return !icon_view->priv->grid_layout[col * icon_view->priv->nrows + row];
}
@@ -3434,7 +3434,7 @@ xfdesktop_grid_set_position_free(XfdesktopIconView *icon_view,
g_return_if_fail(row < icon_view->priv->nrows
&& col < icon_view->priv->ncols
&& row >= 0 && col >= 0);
-
+
#if 0 /*def DEBUG*/
DUMP_GRID_LAYOUT(icon_view);
#endif
@@ -3453,11 +3453,11 @@ xfdesktop_grid_unset_position_free_raw(XfdesktopIconView *icon_view,
gpointer data)
{
gint idx;
-
+
g_return_val_if_fail(row < icon_view->priv->nrows
&& col < icon_view->priv->ncols
&& row >= 0 && col >= 0, FALSE);
-
+
idx = col * icon_view->priv->nrows + row;
if(icon_view->priv->grid_layout[idx])
return FALSE;
@@ -3480,12 +3480,12 @@ xfdesktop_grid_unset_position_free(XfdesktopIconView *icon_view,
XfdesktopIcon *icon)
{
gint16 row, col;
-
+
if(!xfdesktop_icon_get_position(icon, &row, &col)) {
g_warning("Trying to set free position of an icon with no position");
return FALSE;
}
-
+
return xfdesktop_grid_unset_position_free_raw(icon_view, row, col, icon);
}
@@ -3494,10 +3494,10 @@ xfdesktop_icon_view_icon_in_cell_raw(XfdesktopIconView *icon_view,
gint idx)
{
XfdesktopIcon *icon = icon_view->priv->grid_layout[idx];
-
+
if((gpointer)0xdeadbeef == icon)
return NULL;
-
+
return icon;
}
@@ -3507,10 +3507,10 @@ xfdesktop_icon_view_icon_in_cell(XfdesktopIconView *icon_view,
gint16 col)
{
gint idx;
-
+
g_return_val_if_fail(row < icon_view->priv->nrows
&& col < icon_view->priv->ncols, NULL);
-
+
idx = col * icon_view->priv->nrows + row;
return xfdesktop_icon_view_icon_in_cell_raw(icon_view, idx);
}
@@ -3525,7 +3525,7 @@ xfdesktop_rectangle_contains_point(GdkRectangle *rect, gint x, gint y)
{
return FALSE;
}
-
+
return TRUE;
}
@@ -3536,7 +3536,7 @@ xfdesktop_check_icon_clicked(gconstpointer data,
XfdesktopIcon *icon = XFDESKTOP_ICON(data);
GdkEventButton *evt = (GdkEventButton *)user_data;
GdkRectangle extents;
-
+
if(xfdesktop_icon_get_extents(icon, NULL, NULL, &extents)
&& xfdesktop_rectangle_contains_point(&extents, evt->x, evt->y))
{
@@ -3560,17 +3560,17 @@ xfdesktop_icon_view_modify_font_size(XfdesktopIconView *icon_view,
{
const PangoFontDescription *pfd;
PangoFontDescription *pfd_new;
-
+
pfd = pango_layout_get_font_description(icon_view->priv->playout);
if(pfd)
pfd_new = pango_font_description_copy(pfd);
else
pfd_new = pango_font_description_new();
-
+
pango_font_description_set_size(pfd_new, (gint)(size * PANGO_SCALE));
-
+
pango_layout_set_font_description(icon_view->priv->playout, pfd_new);
-
+
pango_font_description_free(pfd_new);
}
@@ -3598,9 +3598,9 @@ GtkWidget *
xfdesktop_icon_view_new(XfdesktopIconViewManager *manager)
{
XfdesktopIconView *icon_view;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW_MANAGER(manager), NULL);
-
+
icon_view = g_object_new(XFDESKTOP_TYPE_ICON_VIEW, NULL);
icon_view->priv->manager = manager;
@@ -3629,7 +3629,7 @@ xfdesktop_icon_view_new(XfdesktopIconViewManager *manager)
G_TYPE_DOUBLE,
G_OBJECT(icon_view),
"tooltip_size");
-
+
return GTK_WIDGET(icon_view);
}
@@ -3645,17 +3645,17 @@ xfdesktop_icon_view_add_item_internal(XfdesktopIconView *icon_view,
cairo_region_t *region;
cairo_t *cr;
GdkWindow *gdkwindow;
-
+
/* sanity check: at this point this should be taken care of */
if(!xfdesktop_icon_get_position(icon, &row, &col)) {
g_warning("Attempting to add item without a position");
return;
}
-
+
xfdesktop_grid_unset_position_free(icon_view, icon);
-
+
icon_view->priv->icons = g_list_prepend(icon_view->priv->icons, icon);
-
+
g_signal_connect(G_OBJECT(icon), "pixbuf-changed",
G_CALLBACK(xfdesktop_icon_view_icon_changed),
icon_view);
@@ -3698,7 +3698,7 @@ xfdesktop_icon_view_icon_find_position(XfdesktopIconView *icon_view,
XfdesktopIcon *icon)
{
gint16 row, col;
-
+
if (!xfdesktop_icon_get_position(icon, &row, &col)
|| !xfdesktop_grid_is_free_position(icon_view, row, col)
|| (((icon_view->priv->gravity & GRAVITY_BOTTOM) ||
@@ -3713,7 +3713,7 @@ xfdesktop_icon_view_icon_find_position(XfdesktopIconView *icon_view,
return FALSE;
}
}
-
+
return TRUE;
}
@@ -3722,17 +3722,17 @@ xfdesktop_icon_view_add_item(XfdesktopIconView *icon_view,
XfdesktopIcon *icon)
{
gint16 row, col;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view)
&& XFDESKTOP_IS_ICON(icon));
-
+
/* ensure the icon isn't already in an icon view */
g_return_if_fail(!g_object_get_data(G_OBJECT(icon),
"--xfdesktop-icon-view"));
-
+
g_object_set_data(G_OBJECT(icon), "--xfdesktop-icon-view", icon_view);
g_object_ref(G_OBJECT(icon));
-
+
if(!gtk_widget_get_realized(GTK_WIDGET(icon_view))) {
/* if we aren't realized, we don't know what our grid looks like, so
* just hang onto the icon for later */
@@ -3759,16 +3759,16 @@ xfdesktop_icon_view_remove_item(XfdesktopIconView *icon_view,
{
gint16 row, col;
GList *l;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view)
&& XFDESKTOP_IS_ICON(icon));
-
+
l = g_list_find(icon_view->priv->icons, icon);
if(l) {
g_signal_handlers_disconnect_by_func(G_OBJECT(icon),
G_CALLBACK(xfdesktop_icon_view_icon_changed),
icon_view);
-
+
if(xfdesktop_icon_get_position(icon, &row, &col)) {
xfdesktop_icon_view_invalidate_icon(icon_view, icon, FALSE);
xfdesktop_grid_set_position_free(icon_view, row, col);
@@ -3793,7 +3793,7 @@ xfdesktop_icon_view_remove_item(XfdesktopIconView *icon_view,
icon, icon_view);
return;
}
-
+
g_object_set_data(G_OBJECT(icon), "--xfdesktop-icon-view", NULL);
g_object_unref(G_OBJECT(icon));
@@ -3808,40 +3808,40 @@ xfdesktop_icon_view_remove_all(XfdesktopIconView *icon_view)
{
GList *l;
gint16 row, col;
-
+
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(icon_view->priv->pending_icons) {
g_list_foreach(icon_view->priv->pending_icons, (GFunc)g_object_unref,
NULL);
g_list_free(icon_view->priv->pending_icons);
icon_view->priv->pending_icons = NULL;
}
-
+
for(l = icon_view->priv->icons; l; l = l->next) {
XfdesktopIcon *icon = XFDESKTOP_ICON(l->data);
if(xfdesktop_icon_get_position(icon, &row, &col)) {
xfdesktop_icon_view_invalidate_icon(icon_view, icon, FALSE);
xfdesktop_grid_set_position_free(icon_view, row, col);
}
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(l->data),
G_CALLBACK(xfdesktop_icon_view_icon_changed),
icon_view);
g_object_set_data(G_OBJECT(l->data), "--xfdesktop-icon-view", NULL);
g_object_unref(G_OBJECT(l->data));
}
-
+
if(G_LIKELY(icon_view->priv->icons)) {
g_list_free(icon_view->priv->icons);
icon_view->priv->icons = NULL;
}
-
+
if(icon_view->priv->selected_icons) {
g_list_free(icon_view->priv->selected_icons);
icon_view->priv->selected_icons = NULL;
}
-
+
icon_view->priv->item_under_pointer = NULL;
icon_view->priv->cursor = NULL;
icon_view->priv->first_clicked_item = NULL;
@@ -3853,12 +3853,12 @@ xfdesktop_icon_view_set_selection_mode(XfdesktopIconView *icon_view,
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
g_return_if_fail(mode <= GTK_SELECTION_MULTIPLE);
-
+
if(mode == icon_view->priv->sel_mode)
return;
-
+
icon_view->priv->sel_mode = mode;
-
+
switch(mode) {
case GTK_SELECTION_NONE:
g_warning("GTK_SELECTION_NONE is not implemented for " \
@@ -3879,7 +3879,7 @@ xfdesktop_icon_view_set_selection_mode(XfdesktopIconView *icon_view,
}
icon_view->priv->allow_rubber_banding = FALSE;
break;
-
+
case GTK_SELECTION_BROWSE:
g_warning("GTK_SELECTION_BROWSE is not implemented for " \
"XfdesktopIconView. Falling back to " \
@@ -3897,7 +3897,7 @@ xfdesktop_icon_view_get_selection_mode(XfdesktopIconView *icon_view)
{
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view),
GTK_SELECTION_NONE);
-
+
return icon_view->priv->sel_mode;
}
@@ -3909,24 +3909,24 @@ xfdesktop_icon_view_enable_drag_source(XfdesktopIconView *icon_view,
GdkDragAction actions)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(icon_view->priv->drag_source_set) {
gtk_target_list_unref(icon_view->priv->source_targets);
icon_view->priv->source_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
}
-
+
icon_view->priv->foreign_source_actions = actions;
icon_view->priv->foreign_source_mask = start_button_mask;
-
+
gtk_target_list_add_table(icon_view->priv->source_targets, targets,
n_targets);
-
+
gtk_drag_source_set(GTK_WIDGET(icon_view), start_button_mask, NULL, 0,
GDK_ACTION_MOVE | actions);
gtk_drag_source_set_target_list(GTK_WIDGET(icon_view),
icon_view->priv->source_targets);
-
+
icon_view->priv->drag_source_set = TRUE;
}
@@ -3937,23 +3937,23 @@ xfdesktop_icon_view_enable_drag_dest(XfdesktopIconView *icon_view,
GdkDragAction actions)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(icon_view->priv->drag_dest_set) {
gtk_target_list_unref(icon_view->priv->dest_targets);
icon_view->priv->dest_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
}
-
+
icon_view->priv->foreign_dest_actions = actions;
-
+
gtk_target_list_add_table(icon_view->priv->dest_targets, targets,
n_targets);
-
+
gtk_drag_dest_set(GTK_WIDGET(icon_view), 0, NULL, 0,
GDK_ACTION_MOVE | actions);
gtk_drag_dest_set_target_list(GTK_WIDGET(icon_view),
icon_view->priv->dest_targets);
-
+
icon_view->priv->drag_dest_set = TRUE;
}
@@ -3961,20 +3961,20 @@ void
xfdesktop_icon_view_unset_drag_source(XfdesktopIconView *icon_view)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(!icon_view->priv->drag_source_set)
return;
-
+
if(icon_view->priv->source_targets)
gtk_target_list_unref(icon_view->priv->source_targets);
-
+
icon_view->priv->source_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
-
+
gtk_drag_source_set(GTK_WIDGET(icon_view), 0, NULL, 0, GDK_ACTION_MOVE);
gtk_drag_source_set_target_list(GTK_WIDGET(icon_view),
icon_view->priv->source_targets);
-
+
icon_view->priv->drag_source_set = FALSE;
}
@@ -3982,20 +3982,20 @@ void
xfdesktop_icon_view_unset_drag_dest(XfdesktopIconView *icon_view)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(!icon_view->priv->drag_dest_set)
return;
-
+
if(icon_view->priv->dest_targets)
gtk_target_list_unref(icon_view->priv->dest_targets);
-
+
icon_view->priv->dest_targets = gtk_target_list_new(icon_view_targets,
icon_view_n_targets);
-
+
gtk_drag_dest_set(GTK_WIDGET(icon_view), 0, NULL, 0, GDK_ACTION_MOVE);
gtk_drag_dest_set_target_list(GTK_WIDGET(icon_view),
icon_view->priv->dest_targets);
-
+
icon_view->priv->drag_dest_set = FALSE;
}
@@ -4005,13 +4005,13 @@ xfdesktop_icon_view_widget_coords_to_item(XfdesktopIconView *icon_view,
gint wy)
{
gint16 row, col;
-
+
xfdesktop_xy_to_rowcol(icon_view, wx, wy, &row, &col);
if(row >= icon_view->priv->nrows || col >= icon_view->priv->ncols || row < 0 || col < 0)
{
return NULL;
}
-
+
return xfdesktop_icon_view_icon_in_cell(icon_view, row, col);
}
@@ -4019,7 +4019,7 @@ GList *
xfdesktop_icon_view_get_selected_items(XfdesktopIconView *icon_view)
{
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view), NULL);
-
+
return g_list_copy(icon_view->priv->selected_icons);
}
@@ -4028,17 +4028,17 @@ xfdesktop_icon_view_select_item(XfdesktopIconView *icon_view,
XfdesktopIcon *icon)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(xfdesktop_icon_view_is_icon_selected(icon_view, icon))
return;
-
+
if(icon_view->priv->sel_mode == GTK_SELECTION_SINGLE)
xfdesktop_icon_view_unselect_all(icon_view);
-
+
icon_view->priv->selected_icons = g_list_prepend(icon_view->priv->selected_icons,
icon);
xfdesktop_icon_view_invalidate_icon(icon_view, icon, TRUE);
-
+
g_signal_emit(G_OBJECT(icon_view),
__signals[SIG_ICON_SELECTION_CHANGED],
0, NULL);
@@ -4087,7 +4087,7 @@ xfdesktop_icon_view_unselect_item(XfdesktopIconView *icon_view,
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view)
&& XFDESKTOP_IS_ICON(icon));
-
+
l = g_list_find(icon_view->priv->selected_icons, icon);
if(l) {
icon_view->priv->selected_icons = g_list_delete_link(icon_view->priv->selected_icons,
@@ -4103,7 +4103,7 @@ void
xfdesktop_icon_view_unselect_all(XfdesktopIconView *icon_view)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(icon_view->priv->selected_icons) {
GList *repaint_icons = icon_view->priv->selected_icons;
icon_view->priv->selected_icons = NULL;
@@ -4121,12 +4121,12 @@ xfdesktop_icon_view_set_icon_size(XfdesktopIconView *icon_view,
guint icon_size)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if(icon_size == icon_view->priv->icon_size)
return;
-
+
icon_view->priv->icon_size = icon_size;
-
+
if(gtk_widget_get_realized(GTK_WIDGET(icon_view))) {
xfdesktop_grid_do_resize(icon_view);
gtk_widget_queue_draw(GTK_WIDGET(icon_view));
@@ -4186,12 +4186,12 @@ xfdesktop_icon_view_set_center_text (XfdesktopIconView *icon_view,
gboolean center_text)
{
g_return_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view));
-
+
if (center_text == icon_view->priv->center_text)
return;
-
+
icon_view->priv->center_text = center_text;
-
+
if(gtk_widget_get_realized(GTK_WIDGET(icon_view))) {
gtk_widget_queue_draw(GTK_WIDGET(icon_view));
}
@@ -4201,7 +4201,7 @@ GtkWidget *
xfdesktop_icon_view_get_window_widget(XfdesktopIconView *icon_view)
{
g_return_val_if_fail(XFDESKTOP_IS_ICON_VIEW(icon_view), NULL);
-
+
return icon_view->priv->parent_window;
}
diff --git a/src/xfdesktop-icon-view.h b/src/xfdesktop-icon-view.h
index 8f25cb0..3e7d17e 100644
--- a/src/xfdesktop-icon-view.h
+++ b/src/xfdesktop-icon-view.h
@@ -42,7 +42,7 @@ typedef void (*XfdesktopIconViewIconFiniFunc)(XfdesktopIconView *icon_view);
struct _XfdesktopIconView
{
GtkWidget parent;
-
+
/*< private >*/
XfdesktopIconViewPrivate *priv;
};
@@ -50,7 +50,7 @@ struct _XfdesktopIconView
struct _XfdesktopIconViewClass
{
GtkWidgetClass parent;
-
+
/*< signals >*/
void (*icon_selection_changed)(XfdesktopIconView *icon_view);
void (*icon_activated)(XfdesktopIconView *icon_view);
diff --git a/src/xfdesktop-icon.c b/src/xfdesktop-icon.c
index 2f30c90..3a41df1 100644
--- a/src/xfdesktop-icon.c
+++ b/src/xfdesktop-icon.c
@@ -80,7 +80,7 @@ xfdesktop_icon_class_init(XfdesktopIconClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
+
__signals[SIG_LABEL_CHANGED] = g_signal_new("label-changed",
XFDESKTOP_TYPE_ICON,
G_SIGNAL_RUN_LAST,
@@ -89,7 +89,7 @@ xfdesktop_icon_class_init(XfdesktopIconClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
+
__signals[SIG_POS_CHANGED] = g_signal_new("position-changed",
XFDESKTOP_TYPE_ICON,
G_SIGNAL_RUN_LAST,
@@ -98,7 +98,7 @@ xfdesktop_icon_class_init(XfdesktopIconClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
+
__signals[SIG_SELECTED] = g_signal_new("selected",
XFDESKTOP_TYPE_ICON,
G_SIGNAL_RUN_LAST,
@@ -107,7 +107,7 @@ xfdesktop_icon_class_init(XfdesktopIconClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
+
__signals[SIG_ACTIVATED] = g_signal_new("activated",
XFDESKTOP_TYPE_ICON,
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -140,10 +140,10 @@ xfdesktop_icon_set_position(XfdesktopIcon *icon,
gint16 col)
{
g_return_if_fail(XFDESKTOP_IS_ICON(icon));
-
+
icon->priv->row = row;
icon->priv->col = col;
-
+
g_signal_emit(G_OBJECT(icon), __signals[SIG_POS_CHANGED], 0, NULL);
}
@@ -153,10 +153,10 @@ xfdesktop_icon_get_position(XfdesktopIcon *icon,
gint16 *col)
{
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon) && row && col, FALSE);
-
+
*row = icon->priv->row;
*col = icon->priv->col;
-
+
return TRUE;
}
@@ -198,7 +198,7 @@ xfdesktop_icon_peek_pixbuf(XfdesktopIcon *icon,
gint width, gint height)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), NULL);
klass = XFDESKTOP_ICON_GET_CLASS(icon);
g_return_val_if_fail(klass->peek_pixbuf, NULL);
@@ -222,11 +222,11 @@ const gchar *
xfdesktop_icon_peek_label(XfdesktopIcon *icon)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), NULL);
klass = XFDESKTOP_ICON_GET_CLASS(icon);
g_return_val_if_fail(klass->peek_label, NULL);
-
+
return klass->peek_label(icon);
}
@@ -251,14 +251,14 @@ GdkDragAction
xfdesktop_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), FALSE);
-
+
klass = XFDESKTOP_ICON_GET_CLASS(icon);
-
+
if(!klass->get_allowed_drag_actions)
return 0;
-
+
return klass->get_allowed_drag_actions(icon);
}
@@ -268,11 +268,11 @@ xfdesktop_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
GdkDragAction *suggested_action)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), FALSE);
-
+
klass = XFDESKTOP_ICON_GET_CLASS(icon);
-
+
if(!klass->get_allowed_drop_actions) {
if(suggested_action)
*suggested_action = 0;
@@ -289,11 +289,11 @@ xfdesktop_icon_do_drop_dest(XfdesktopIcon *icon,
GdkDragAction action)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), FALSE);
- klass = XFDESKTOP_ICON_GET_CLASS(icon);
+ klass = XFDESKTOP_ICON_GET_CLASS(icon);
g_return_val_if_fail(klass->do_drop_dest, FALSE);
-
+
return klass->do_drop_dest(icon, src_icon, action);
}
@@ -327,14 +327,14 @@ const gchar *
xfdesktop_icon_peek_tooltip(XfdesktopIcon *icon)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), NULL);
-
+
klass = XFDESKTOP_ICON_GET_CLASS(icon);
-
+
if(!klass->peek_tooltip)
return NULL;
-
+
return klass->peek_tooltip(icon);
}
@@ -376,14 +376,14 @@ xfdesktop_icon_populate_context_menu(XfdesktopIcon *icon,
GtkWidget *menu)
{
XfdesktopIconClass *klass;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), FALSE);
-
+
klass = XFDESKTOP_ICON_GET_CLASS(icon);
-
+
if(!klass->populate_context_menu)
return FALSE;
-
+
return klass->populate_context_menu(icon, menu);
}
@@ -454,10 +454,10 @@ gboolean
xfdesktop_icon_activated(XfdesktopIcon *icon)
{
gboolean ret = FALSE;
-
+
g_return_val_if_fail(XFDESKTOP_IS_ICON(icon), FALSE);
-
+
g_signal_emit(G_OBJECT(icon), __signals[SIG_ACTIVATED], 0, &ret);
-
+
return ret;
}
diff --git a/src/xfdesktop-icon.h b/src/xfdesktop-icon.h
index 55c03e2..37731ba 100644
--- a/src/xfdesktop-icon.h
+++ b/src/xfdesktop-icon.h
@@ -38,7 +38,7 @@ typedef struct _XfdesktopIconPrivate XfdesktopIconPrivate;
struct _XfdesktopIcon
{
GObject parent;
-
+
/*< private >*/
XfdesktopIconPrivate *priv;
};
@@ -46,13 +46,13 @@ struct _XfdesktopIcon
struct _XfdesktopIconClass
{
GObjectClass parent;
-
+
/*< signals >*/
void (*pixbuf_changed)(XfdesktopIcon *icon);
void (*label_changed)(XfdesktopIcon *icon);
-
+
void (*position_changed)(XfdesktopIcon *icon);
-
+
void (*selected)(XfdesktopIcon *icon);
/* XfdektopIcon::activated has weird semantics: you should NEVER connect to
* this signal normally: always use g_signal_connect_after(), as the default
@@ -61,13 +61,13 @@ struct _XfdesktopIconClass
* with return values are (for some unknown reason) not allowed to be
* G_SIGNAL_RUN_FIRST. go figure. */
gboolean (*activated)(XfdesktopIcon *icon);
-
+
/*< virtual functions >*/
GdkPixbuf *(*peek_pixbuf)(XfdesktopIcon *icon, gint width, gint height);
const gchar *(*peek_label)(XfdesktopIcon *icon);
-
+
GdkDragAction (*get_allowed_drag_actions)(XfdesktopIcon *icon);
-
+
GdkDragAction (*get_allowed_drop_actions)(XfdesktopIcon *icon, GdkDragAction *suggested_action);
gboolean (*do_drop_dest)(XfdesktopIcon *icon, XfdesktopIcon *src_icon, GdkDragAction action);
@@ -75,7 +75,7 @@ struct _XfdesktopIconClass
const gchar *(*peek_tooltip)(XfdesktopIcon *icon);
gchar *(*get_identifier)(XfdesktopIcon *icon);
-
+
void (*set_thumbnail_file)(XfdesktopIcon *icon, GFile *file);
void (*delete_thumbnail_file)(XfdesktopIcon *icon);
diff --git a/src/xfdesktop-notify.c b/src/xfdesktop-notify.c
index 5c14292..9917855 100644
--- a/src/xfdesktop-notify.c
+++ b/src/xfdesktop-notify.c
@@ -2,14 +2,14 @@
/*-
* Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
*
- * This program is free software; you can redistribute it and/or
+ * 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 of
+ * published by the Free Software Foundation; either version 2 of
* the License, 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
+ * 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
@@ -84,13 +84,13 @@ xfdesktop_notify_unmount (GMount *mount)
return;
mount_point = g_mount_get_root (mount);
-
- info = g_file_query_info (mount_point, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+
+ info = g_file_query_info (mount_point, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (info != NULL)
{
- read_only = !g_file_info_get_attribute_boolean (info,
+ read_only = !g_file_info_get_attribute_boolean (info,
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
g_object_unref (info);
@@ -156,7 +156,7 @@ xfdesktop_notify_unmount (GMount *mount)
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_show (notification, NULL);
- g_object_set_data_full (G_OBJECT (mount), "xfdesktop-notification", notification,
+ g_object_set_data_full (G_OBJECT (mount), "xfdesktop-notification", notification,
g_object_unref);
g_free (message);
@@ -269,8 +269,8 @@ xfdesktop_notify_eject (GVolume *volume)
if (mount != NULL)
{
mount_point = g_mount_get_root (mount);
-
- info = g_file_query_info (mount_point, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+
+ info = g_file_query_info (mount_point, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (info != NULL)
@@ -341,7 +341,7 @@ xfdesktop_notify_eject (GVolume *volume)
notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER);
notify_notification_show (notification, NULL);
- g_object_set_data_full (G_OBJECT (volume), "xfdesktop-notification", notification,
+ g_object_set_data_full (G_OBJECT (volume), "xfdesktop-notification", notification,
g_object_unref);
g_free (message);
diff --git a/src/xfdesktop-notify.h b/src/xfdesktop-notify.h
index 4b384dd..d5679a7 100644
--- a/src/xfdesktop-notify.h
+++ b/src/xfdesktop-notify.h
@@ -2,14 +2,14 @@
/*-
* Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
*
- * This program is free software; you can redistribute it and/or
+ * 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 of
+ * published by the Free Software Foundation; either version 2 of
* the License, 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
+ * 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
diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c
index 42e15c9..0898ea8 100644
--- a/src/xfdesktop-regular-file-icon.c
+++ b/src/xfdesktop-regular-file-icon.c
@@ -120,11 +120,11 @@ xfdesktop_regular_file_icon_class_init(XfdesktopRegularFileIconClass *klass)
GObjectClass *gobject_class = (GObjectClass *)klass;
XfdesktopIconClass *icon_class = (XfdesktopIconClass *)klass;
XfdesktopFileIconClass *file_icon_class = (XfdesktopFileIconClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfdesktopRegularFileIconPrivate));
-
+
gobject_class->finalize = xfdesktop_regular_file_icon_finalize;
-
+
icon_class->peek_pixbuf = xfdesktop_regular_file_icon_peek_pixbuf;
icon_class->peek_label = xfdesktop_regular_file_icon_peek_label;
icon_class->get_identifier = xfdesktop_regular_file_icon_get_identifier;
@@ -135,7 +135,7 @@ xfdesktop_regular_file_icon_class_init(XfdesktopRegularFileIconClass *klass)
icon_class->do_drop_dest = xfdesktop_regular_file_icon_do_drop_dest;
icon_class->set_thumbnail_file = xfdesktop_regular_file_icon_set_thumbnail_file;
icon_class->delete_thumbnail_file = xfdesktop_regular_file_icon_delete_thumbnail_file;
-
+
file_icon_class->peek_file_info = xfdesktop_regular_file_icon_peek_file_info;
file_icon_class->peek_filesystem_info = xfdesktop_regular_file_icon_peek_filesystem_info;
file_icon_class->peek_file = xfdesktop_regular_file_icon_peek_file;
@@ -159,11 +159,11 @@ xfdesktop_regular_file_icon_finalize(GObject *obj)
{
XfdesktopRegularFileIcon *icon = XFDESKTOP_REGULAR_FILE_ICON(obj);
GtkIconTheme *itheme = gtk_icon_theme_get_for_screen(icon->priv->gscreen);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(itheme),
G_CALLBACK(xfdesktop_icon_invalidate_pixbuf),
icon);
-
+
if(icon->priv->file_info)
g_object_unref(icon->priv->file_info);
@@ -171,7 +171,7 @@ xfdesktop_regular_file_icon_finalize(GObject *obj)
g_object_unref(icon->priv->filesystem_info);
g_object_unref(icon->priv->file);
-
+
g_free(icon->priv->display_name);
if(icon->priv->tooltip)
@@ -621,14 +621,14 @@ xfdesktop_regular_file_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
{
GFileInfo *parent_info;
GFile *parent_file;
-
+
actions |= GDK_ACTION_COPY;
-
+
/* we can only move if the parent is writable */
parent_file = g_file_get_parent(file);
- parent_info = g_file_query_info(parent_file,
+ parent_info = g_file_query_info(parent_file,
XFDESKTOP_FILE_INFO_NAMESPACE,
- G_FILE_QUERY_INFO_NONE,
+ G_FILE_QUERY_INFO_NONE,
NULL, NULL);
if(parent_info) {
if(g_file_info_get_attribute_boolean(parent_info,
@@ -640,7 +640,7 @@ xfdesktop_regular_file_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
}
g_object_unref(parent_file);
}
-
+
return actions;
}
@@ -649,13 +649,13 @@ xfdesktop_regular_file_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
GdkDragAction *suggested_action)
{
GFileInfo *info = xfdesktop_file_icon_peek_file_info(XFDESKTOP_FILE_ICON(icon));
-
+
if(!info) {
if(suggested_action)
*suggested_action = 0;
return 0;
}
-
+
/* if it's executable we can 'copy'. if it's a folder we can do anything
* if it's writable. */
if(g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) {
@@ -688,19 +688,19 @@ xfdesktop_regular_file_icon_do_drop_dest(XfdesktopIcon *icon,
GFileInfo *src_info;
GFile *src_file;
gboolean result = FALSE;
-
+
TRACE("entering");
-
+
g_return_val_if_fail(regular_file_icon && src_file_icon, FALSE);
g_return_val_if_fail(xfdesktop_regular_file_icon_get_allowed_drop_actions(icon, NULL) != 0,
FALSE);
-
+
src_file = xfdesktop_file_icon_peek_file(src_file_icon);
src_info = xfdesktop_file_icon_peek_file_info(src_file_icon);
if(!src_info)
return FALSE;
-
+
if(g_file_info_get_file_type(regular_file_icon->priv->file_info) != G_FILE_TYPE_DIRECTORY
&& xfdesktop_file_utils_file_is_executable(regular_file_icon->priv->file_info))
{
@@ -716,16 +716,16 @@ xfdesktop_regular_file_icon_do_drop_dest(XfdesktopIcon *icon,
} else {
GFile *parent, *dest_file = NULL;
gchar *name;
-
+
parent = g_file_get_parent(src_file);
if(!parent)
return FALSE;
g_object_unref(parent);
-
+
name = g_file_get_basename(src_file);
if(!name)
return FALSE;
-
+
switch(action) {
case GDK_ACTION_MOVE:
dest_file = g_object_ref(regular_file_icon->priv->file);
@@ -751,7 +751,7 @@ xfdesktop_regular_file_icon_do_drop_dest(XfdesktopIcon *icon,
g_free(name);
}
-
+
return result;
}
@@ -759,7 +759,7 @@ static const gchar *
xfdesktop_regular_file_icon_peek_tooltip(XfdesktopIcon *icon)
{
XfdesktopRegularFileIcon *regular_file_icon = XFDESKTOP_REGULAR_FILE_ICON(icon);
-
+
if(!regular_file_icon->priv->tooltip) {
GFileInfo *info = xfdesktop_file_icon_peek_file_info(XFDESKTOP_FILE_ICON(icon));
const gchar *content_type, *comment = NULL;
@@ -826,7 +826,7 @@ xfdesktop_regular_file_icon_peek_tooltip(XfdesktopIcon *icon)
g_free(size_string);
g_free(description);
}
-
+
return regular_file_icon->priv->tooltip;
}
@@ -844,7 +844,7 @@ xfdesktop_regular_file_can_write_parent(XfdesktopFileIcon *icon)
if(!parent_file)
return FALSE;
- parent_info = g_file_query_info(parent_file,
+ parent_info = g_file_query_info(parent_file,
XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
@@ -853,7 +853,7 @@ xfdesktop_regular_file_can_write_parent(XfdesktopFileIcon *icon)
return FALSE;
}
- writable = g_file_info_get_attribute_boolean(parent_info,
+ writable = g_file_info_get_attribute_boolean(parent_info,
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
g_object_unref(parent_info);
g_object_unref(parent_file);
@@ -890,12 +890,12 @@ xfdesktop_regular_file_icon_update_file_info(XfdesktopFileIcon *icon,
XfdesktopRegularFileIcon *regular_file_icon = XFDESKTOP_REGULAR_FILE_ICON(icon);
const gchar *old_display_name;
gchar *new_display_name;
-
+
g_return_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon));
g_return_if_fail(G_IS_FILE_INFO(info));
/* release the old file info */
- if(regular_file_icon->priv->file_info) {
+ if(regular_file_icon->priv->file_info) {
g_object_unref(regular_file_icon->priv->file_info);
regular_file_icon->priv->file_info = NULL;
}
@@ -930,7 +930,7 @@ xfdesktop_regular_file_icon_update_file_info(XfdesktopFileIcon *icon,
/* invalidate the tooltip */
g_free(regular_file_icon->priv->tooltip);
regular_file_icon->priv->tooltip = NULL;
-
+
/* not really easy to check if this changed or not, so just invalidate it */
xfdesktop_file_icon_invalidate_icon(XFDESKTOP_FILE_ICON(icon));
xfdesktop_icon_invalidate_pixbuf(XFDESKTOP_ICON(icon));
@@ -996,7 +996,7 @@ xfdesktop_regular_file_icon_new(GFile *file,
regular_file_icon->priv->file_info = g_object_ref(file_info);
/* set the display name */
- regular_file_icon->priv->display_name = xfdesktop_file_utils_get_display_name(file,
+ regular_file_icon->priv->display_name = xfdesktop_file_utils_get_display_name(file,
file_info);
/* query file system information from GIO */
@@ -1045,12 +1045,12 @@ xfdesktop_regular_file_icon_set_pixbuf_opacity(XfdesktopRegularFileIcon *icon,
guint opacity)
{
g_return_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon) && opacity <= 100);
-
+
if(opacity == icon->priv->pix_opacity)
return;
-
+
icon->priv->pix_opacity = opacity;
-
+
xfdesktop_icon_invalidate_pixbuf(XFDESKTOP_ICON(icon));
xfdesktop_icon_pixbuf_changed(XFDESKTOP_ICON(icon));
}
diff --git a/src/xfdesktop-regular-file-icon.h b/src/xfdesktop-regular-file-icon.h
index 96e0563..c0b968e 100644
--- a/src/xfdesktop-regular-file-icon.h
+++ b/src/xfdesktop-regular-file-icon.h
@@ -39,7 +39,7 @@ typedef struct _XfdesktopRegularFileIconPrivate XfdesktopRegularFileIconPrivate
struct _XfdesktopRegularFileIcon
{
XfdesktopFileIcon parent;
-
+
/*< private >*/
XfdesktopRegularFileIconPrivate *priv;
};
diff --git a/src/xfdesktop-special-file-icon.c b/src/xfdesktop-special-file-icon.c
index c255665..d3787f4 100644
--- a/src/xfdesktop-special-file-icon.c
+++ b/src/xfdesktop-special-file-icon.c
@@ -61,7 +61,7 @@ struct _XfdesktopSpecialFileIconPrivate
GFileInfo *filesystem_info;
GFile *file;
GdkScreen *gscreen;
-
+
/* only needed for trash */
guint trash_item_count;
};
@@ -115,11 +115,11 @@ xfdesktop_special_file_icon_class_init(XfdesktopSpecialFileIconClass *klass)
GObjectClass *gobject_class = (GObjectClass *)klass;
XfdesktopIconClass *icon_class = (XfdesktopIconClass *)klass;
XfdesktopFileIconClass *file_icon_class = (XfdesktopFileIconClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfdesktopSpecialFileIconPrivate));
-
+
gobject_class->finalize = xfdesktop_special_file_icon_finalize;
-
+
icon_class->peek_pixbuf = xfdesktop_special_file_icon_peek_pixbuf;
icon_class->peek_label = xfdesktop_special_file_icon_peek_label;
icon_class->get_identifier = xfdesktop_special_file_icon_get_identifier;
@@ -129,7 +129,7 @@ xfdesktop_special_file_icon_class_init(XfdesktopSpecialFileIconClass *klass)
icon_class->get_allowed_drop_actions = xfdesktop_special_file_icon_get_allowed_drop_actions;
icon_class->do_drop_dest = xfdesktop_special_file_icon_do_drop_dest;
icon_class->populate_context_menu = xfdesktop_special_file_icon_populate_context_menu;
-
+
file_icon_class->peek_file_info = xfdesktop_special_file_icon_peek_file_info;
file_icon_class->peek_filesystem_info = xfdesktop_special_file_icon_peek_filesystem_info;
file_icon_class->peek_file = xfdesktop_special_file_icon_peek_file;
@@ -150,7 +150,7 @@ xfdesktop_special_file_icon_finalize(GObject *obj)
{
XfdesktopSpecialFileIcon *icon = XFDESKTOP_SPECIAL_FILE_ICON(obj);
GtkIconTheme *itheme = gtk_icon_theme_get_for_screen(icon->priv->gscreen);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(itheme),
G_CALLBACK(xfdesktop_icon_invalidate_pixbuf),
icon);
@@ -161,7 +161,7 @@ xfdesktop_special_file_icon_finalize(GObject *obj)
icon);
g_object_unref(icon->priv->monitor);
}
-
+
g_object_unref(icon->priv->file);
if(icon->priv->file_info)
@@ -169,7 +169,7 @@ xfdesktop_special_file_icon_finalize(GObject *obj)
if(icon->priv->tooltip)
g_free(icon->priv->tooltip);
-
+
G_OBJECT_CLASS(xfdesktop_special_file_icon_parent_class)->finalize(obj);
}
@@ -178,7 +178,7 @@ static gchar *
xfdesktop_special_file_icon_tfi_get_uri_scheme(ThunarxFileInfo *file_info)
{
XfdesktopSpecialFileIcon *icon = XFDESKTOP_SPECIAL_FILE_ICON(file_info);
-
+
if(XFDESKTOP_SPECIAL_FILE_ICON_TRASH == icon->priv->type)
return g_strdup("trash");
else
@@ -290,7 +290,7 @@ xfdesktop_special_file_icon_peek_label(XfdesktopIcon *icon)
{
XfdesktopSpecialFileIcon *special_file_icon = XFDESKTOP_SPECIAL_FILE_ICON(icon);
GFileInfo *info = special_file_icon->priv->file_info;
-
+
if(XFDESKTOP_SPECIAL_FILE_ICON_HOME == special_file_icon->priv->type)
return _("Home");
else if(XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM == special_file_icon->priv->type)
@@ -319,27 +319,27 @@ xfdesktop_special_file_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
{
XfdesktopSpecialFileIcon *special_file_icon = XFDESKTOP_SPECIAL_FILE_ICON(icon);
GdkDragAction actions = 0;
-
+
switch(special_file_icon->priv->type) {
case XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM:
/* move is just impossible, and copy seems a bit retarded. link
* is possible */
actions = GDK_ACTION_LINK;
break;
-
+
case XFDESKTOP_SPECIAL_FILE_ICON_HOME:
/* user shouldn't be able to move their own homedir. copy might
* be a little silly, but allow it anyway. link is fine. */
actions = GDK_ACTION_COPY | GDK_ACTION_LINK;
break;
-
+
case XFDESKTOP_SPECIAL_FILE_ICON_TRASH:
/* move is impossible, but we can copy and link the trash root
* anywhere */
actions = GDK_ACTION_COPY | GDK_ACTION_LINK;
break;
}
-
+
return actions;
}
@@ -369,7 +369,7 @@ xfdesktop_special_file_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
if(suggested_action)
*suggested_action = GDK_ACTION_MOVE;
}
-
+
if(suggested_action)
*suggested_action = 0;
@@ -387,19 +387,19 @@ xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
GFile *src_file;
GFile *dest_file = NULL;
gboolean result = FALSE;
-
+
TRACE("entering");
-
+
g_return_val_if_fail(special_file_icon && src_file_icon, FALSE);
g_return_val_if_fail(xfdesktop_special_file_icon_get_allowed_drop_actions(icon, NULL),
FALSE);
-
+
src_file = xfdesktop_file_icon_peek_file(src_file_icon);
src_info = xfdesktop_file_icon_peek_file_info(src_file_icon);
if(!src_info)
return FALSE;
-
+
if(special_file_icon->priv->type == XFDESKTOP_SPECIAL_FILE_ICON_TRASH) {
GList files;
@@ -415,7 +415,7 @@ xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
gchar *name = g_file_get_basename(src_file);
if(!name)
return FALSE;
-
+
switch(action) {
case GDK_ACTION_MOVE:
XF_DEBUG("doing move");
@@ -452,7 +452,7 @@ static const gchar *
xfdesktop_special_file_icon_peek_tooltip(XfdesktopIcon *icon)
{
XfdesktopSpecialFileIcon *special_file_icon = XFDESKTOP_SPECIAL_FILE_ICON(icon);
-
+
if(!special_file_icon->priv->tooltip) {
GFileInfo *info = xfdesktop_file_icon_peek_file_info(XFDESKTOP_FILE_ICON(icon));
@@ -466,7 +466,7 @@ xfdesktop_special_file_icon_peek_tooltip(XfdesktopIcon *icon)
special_file_icon->priv->tooltip = g_strdup_printf(g_dngettext(GETTEXT_PACKAGE,
_("Trash contains one item"),
_("Trash contains %d items"),
- special_file_icon->priv->trash_item_count),
+ special_file_icon->priv->trash_item_count),
special_file_icon->priv->trash_item_count);
}
@@ -493,7 +493,7 @@ xfdesktop_special_file_icon_peek_tooltip(XfdesktopIcon *icon)
G_FILE_ATTRIBUTE_TIME_MODIFIED);
time_string = xfdesktop_file_utils_format_time_for_display(mtime);
- special_file_icon->priv->tooltip =
+ special_file_icon->priv->tooltip =
g_strdup_printf(_("%s\nSize: %s\nLast modified: %s"),
description, size_string, time_string);
@@ -501,7 +501,7 @@ xfdesktop_special_file_icon_peek_tooltip(XfdesktopIcon *icon)
g_free(time_string);
}
}
-
+
return special_file_icon->priv->tooltip;
}
@@ -514,7 +514,7 @@ xfdesktop_special_file_icon_trash_open(GtkWidget *w,
icon_view = xfdesktop_icon_peek_icon_view(XFDESKTOP_ICON(file_icon));
toplevel = gtk_widget_get_toplevel(icon_view);
-
+
xfdesktop_file_utils_open_folder(file_icon->priv->file,
file_icon->priv->gscreen,
GTK_WINDOW(toplevel));
@@ -540,17 +540,17 @@ xfdesktop_special_file_icon_populate_context_menu(XfdesktopIcon *icon,
{
XfdesktopSpecialFileIcon *special_file_icon = XFDESKTOP_SPECIAL_FILE_ICON(icon);
GtkWidget *mi, *img;
-
+
if(XFDESKTOP_SPECIAL_FILE_ICON_TRASH != special_file_icon->priv->type)
return FALSE;
-
+
img = gtk_image_new_from_icon_name("document-open", GTK_ICON_SIZE_MENU);
mi = xfdesktop_menu_create_menu_item_with_mnemonic(_("_Open"), img);
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
g_signal_connect(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_special_file_icon_trash_open), icon);
-
+
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
@@ -560,7 +560,7 @@ xfdesktop_special_file_icon_populate_context_menu(XfdesktopIcon *icon,
} else {
img = gtk_image_new_from_icon_name("user-trash-full", GTK_ICON_SIZE_MENU);
}
-
+
mi = xfdesktop_menu_create_menu_item_with_mnemonic(_("_Empty Trash"), img);
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
@@ -570,7 +570,7 @@ xfdesktop_special_file_icon_populate_context_menu(XfdesktopIcon *icon,
icon);
} else
gtk_widget_set_sensitive(mi, FALSE);
-
+
return TRUE;
}
@@ -625,7 +625,7 @@ xfdesktop_special_file_icon_changed(GFileMonitor *monitor,
}
/* reload the file information */
- special_file_icon->priv->file_info = g_file_query_info(special_file_icon->priv->file,
+ special_file_icon->priv->file_info = g_file_query_info(special_file_icon->priv->file,
XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
@@ -699,30 +699,30 @@ xfdesktop_special_file_icon_new(XfdesktopSpecialFileIconType type,
{
XfdesktopSpecialFileIcon *special_file_icon;
GFile *file = NULL;
-
+
switch(type) {
case XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM:
file = g_file_new_for_uri("file:///");
break;
-
+
case XFDESKTOP_SPECIAL_FILE_ICON_HOME:
file = g_file_new_for_path(xfce_get_homedir());
break;
-
+
case XFDESKTOP_SPECIAL_FILE_ICON_TRASH:
file = g_file_new_for_uri("trash:///");
break;
-
+
default:
g_return_val_if_reached(NULL);
}
-
+
special_file_icon = g_object_new(XFDESKTOP_TYPE_SPECIAL_FILE_ICON, NULL);
special_file_icon->priv->type = type;
special_file_icon->priv->gscreen = screen;
special_file_icon->priv->file = file;
- special_file_icon->priv->file_info = g_file_query_info(file,
+ special_file_icon->priv->file_info = g_file_query_info(file,
XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
@@ -754,7 +754,7 @@ xfdesktop_special_file_icon_new(XfdesktopSpecialFileIconType type,
G_CALLBACK(xfdesktop_special_file_icon_changed),
special_file_icon);
}
-
+
return special_file_icon;
}
diff --git a/src/xfdesktop-special-file-icon.h b/src/xfdesktop-special-file-icon.h
index b448d7b..cfcb327 100644
--- a/src/xfdesktop-special-file-icon.h
+++ b/src/xfdesktop-special-file-icon.h
@@ -38,7 +38,7 @@ typedef struct _XfdesktopSpecialFileIconPrivate XfdesktopSpecialFileIconPrivate
struct _XfdesktopSpecialFileIcon
{
XfdesktopFileIcon parent;
-
+
/*< private >*/
XfdesktopSpecialFileIconPrivate *priv;
};
diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c
index 72d696e..b93975f 100644
--- a/src/xfdesktop-volume-icon.c
+++ b/src/xfdesktop-volume-icon.c
@@ -97,7 +97,7 @@ static void xfdesktop_volume_icon_update_file_info(XfdesktopFileIcon *icon,
GFileInfo *info);
static gboolean xfdesktop_volume_icon_activated(XfdesktopIcon *icon);
static gboolean volume_icon_changed_timeout(XfdesktopVolumeIcon *icon);
-static void xfdesktop_volume_icon_changed(GVolume *volume,
+static void xfdesktop_volume_icon_changed(GVolume *volume,
XfdesktopVolumeIcon *volume_icon);
#ifdef HAVE_THUNARX
@@ -127,11 +127,11 @@ xfdesktop_volume_icon_class_init(XfdesktopVolumeIconClass *klass)
XfdesktopFileIconClass *file_icon_class = (XfdesktopFileIconClass *)klass;
xfdesktop_volume_icon_activated_quark = g_quark_from_static_string("xfdesktop-volume-icon-activated");
-
+
g_type_class_add_private(klass, sizeof(XfdesktopVolumeIconClass));
-
+
gobject_class->finalize = xfdesktop_volume_icon_finalize;
-
+
icon_class->peek_pixbuf = xfdesktop_volume_icon_peek_pixbuf;
icon_class->peek_label = xfdesktop_volume_icon_peek_label;
icon_class->get_identifier = xfdesktop_volume_icon_get_identifier;
@@ -142,7 +142,7 @@ xfdesktop_volume_icon_class_init(XfdesktopVolumeIconClass *klass)
icon_class->do_drop_dest = xfdesktop_volume_icon_do_drop_dest;
icon_class->populate_context_menu = xfdesktop_volume_icon_populate_context_menu;
icon_class->activated = xfdesktop_volume_icon_activated;
-
+
file_icon_class->peek_file_info = xfdesktop_volume_icon_peek_file_info;
file_icon_class->peek_filesystem_info = xfdesktop_volume_icon_peek_filesystem_info;
file_icon_class->peek_file = xfdesktop_volume_icon_peek_file;
@@ -167,11 +167,11 @@ xfdesktop_volume_icon_finalize(GObject *obj)
/* remove pending change timeouts */
if(icon->priv->changed_timeout_id > 0)
g_source_remove(icon->priv->changed_timeout_id);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(itheme),
G_CALLBACK(xfdesktop_icon_invalidate_pixbuf),
icon);
-
+
if(icon->priv->label) {
g_free(icon->priv->label);
icon->priv->label = NULL;
@@ -191,7 +191,7 @@ xfdesktop_volume_icon_finalize(GObject *obj)
if(icon->priv->tooltip)
g_free(icon->priv->tooltip);
-
+
G_OBJECT_CLASS(xfdesktop_volume_icon_parent_class)->finalize(obj);
}
@@ -270,7 +270,7 @@ xfdesktop_volume_icon_peek_pixbuf(XfdesktopIcon *icon,
gint opacity = 100;
GIcon *gicon = NULL;
GdkPixbuf *pix = NULL;
-
+
g_return_val_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon), NULL);
if(!xfdesktop_file_icon_has_gicon(XFDESKTOP_FILE_ICON(icon)))
@@ -312,7 +312,7 @@ xfdesktop_volume_icon_peek_label(XfdesktopIcon *icon)
XfdesktopVolumeIcon *volume_icon = XFDESKTOP_VOLUME_ICON(icon);
g_return_val_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon), NULL);
-
+
if(!volume_icon->priv->label) {
volume_icon->priv->label = g_volume_get_name(volume_icon->priv->volume);
}
@@ -342,10 +342,10 @@ xfdesktop_volume_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
* the mount point, but copying and linking should be OK. when not mounted,
* we should just disallow everything, since, even if its ThunarVfsInfo
* is valid, we can't guarantee it won't change after mounting. */
-
+
/* FIXME: should i allow all actions if not mounted as well, and try to
* mount and resolve on drop? */
-
+
if(xfdesktop_volume_icon_is_mounted(icon)) {
GFileInfo *info = xfdesktop_file_icon_peek_file_info(XFDESKTOP_FILE_ICON(icon));
if(info) {
@@ -355,7 +355,7 @@ xfdesktop_volume_icon_get_allowed_drag_actions(XfdesktopIcon *icon)
return GDK_ACTION_LINK;
}
}
-
+
return 0;
}
@@ -365,7 +365,7 @@ xfdesktop_volume_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
{
/* if not mounted, it doesn't really make sense to allow any operations
* here. if mounted, we should allow everything if it's writable. */
-
+
/* FIXME: should i allow all actions if not mounted as well, and try to
* mount and resolve on drop? */
@@ -382,7 +382,7 @@ xfdesktop_volume_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
if(suggested_action)
*suggested_action = 0;
-
+
return 0;
}
@@ -397,13 +397,13 @@ xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
GFile *src_file, *parent, *dest_file = NULL;
gboolean result = FALSE;
gchar *name;
-
+
TRACE("entering");
-
+
g_return_val_if_fail(volume_icon && src_file_icon, FALSE);
g_return_val_if_fail(xfdesktop_volume_icon_get_allowed_drop_actions(icon, NULL),
FALSE);
-
+
src_file = xfdesktop_file_icon_peek_file(src_file_icon);
src_info = xfdesktop_file_icon_peek_file_info(src_file_icon);
@@ -412,32 +412,32 @@ xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
if(!volume_icon->priv->file_info)
return FALSE;
-
+
parent = g_file_get_parent(src_file);
if(!parent)
return FALSE;
g_object_unref(parent);
-
+
name = g_file_get_basename(src_file);
if(!name)
return FALSE;
-
+
switch(action) {
case GDK_ACTION_MOVE:
XF_DEBUG("doing move");
dest_file = g_object_ref(volume_icon->priv->file);
break;
-
+
case GDK_ACTION_COPY:
XF_DEBUG("doing copy");
dest_file = g_file_get_child(volume_icon->priv->file, name);
break;
-
+
case GDK_ACTION_LINK:
XF_DEBUG("doing link");
dest_file = g_object_ref(volume_icon->priv->file);
break;
-
+
default:
g_warning("Unsupported drag action: %d", action);
}
@@ -445,14 +445,14 @@ xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
if(dest_file) {
xfdesktop_file_utils_transfer_file(action, src_file, dest_file,
volume_icon->priv->gscreen);
-
+
g_object_unref(dest_file);
result = TRUE;
}
g_free(name);
-
+
return result;
}
@@ -462,7 +462,7 @@ xfdesktop_volume_icon_peek_tooltip(XfdesktopIcon *icon)
XfdesktopVolumeIcon *volume_icon = XFDESKTOP_VOLUME_ICON(icon);
GFileInfo *fs_info = xfdesktop_file_icon_peek_filesystem_info(XFDESKTOP_FILE_ICON(icon));
GFile *file = xfdesktop_file_icon_peek_file(XFDESKTOP_FILE_ICON(icon));
-
+
if(!volume_icon->priv->tooltip) {
guint64 size, free_space;
gchar *mount_point = NULL, *size_string = NULL, *free_space_string = NULL;
@@ -481,7 +481,7 @@ xfdesktop_volume_icon_peek_tooltip(XfdesktopIcon *icon)
volume_icon->priv->tooltip =
g_strdup_printf(_("Removable Volume\nMounted in \"%s\"\n%s left (%s total)"),
mount_point, free_space_string, size_string);
-
+
g_free(free_space_string);
g_free(size_string);
g_free(mount_point);
@@ -504,7 +504,7 @@ xfdesktop_volume_icon_eject_finish(GObject *object,
GVolume *volume = G_VOLUME(object);
GError *error = NULL;
gboolean eject_successful;
-
+
g_return_if_fail(G_IS_VOLUME(object));
g_return_if_fail(G_IS_ASYNC_RESULT(result));
g_return_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon));
@@ -515,12 +515,12 @@ xfdesktop_volume_icon_eject_finish(GObject *object,
/* ignore GIO errors handled internally */
if(error->domain != G_IO_ERROR || error->code != G_IO_ERROR_FAILED_HANDLED) {
gchar *volume_name = g_volume_get_name(volume);
- gchar *primary = g_markup_printf_escaped(_("Failed to eject \"%s\""),
+ gchar *primary = g_markup_printf_escaped(_("Failed to eject \"%s\""),
volume_name);
/* display an error dialog to inform the user */
xfce_message_dialog(toplevel ? GTK_WINDOW(toplevel) : NULL,
- _("Eject Failed"), "dialog-error",
+ _("Eject Failed"), "dialog-error",
primary, error->message,
XFCE_BUTTON_TYPE_MIXED, "window-close", _("_Close"), GTK_RESPONSE_ACCEPT,
NULL);
@@ -550,7 +550,7 @@ xfdesktop_volume_icon_unmount_finish(GObject *object,
GMount *mount = G_MOUNT(object);
GError *error = NULL;
gboolean unmount_successful;
-
+
g_return_if_fail(G_IS_MOUNT(object));
g_return_if_fail(G_IS_ASYNC_RESULT(result));
g_return_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon));
@@ -561,12 +561,12 @@ xfdesktop_volume_icon_unmount_finish(GObject *object,
/* ignore GIO errors handled internally */
if(error->domain != G_IO_ERROR || error->code != G_IO_ERROR_FAILED_HANDLED) {
gchar *mount_name = g_mount_get_name(mount);
- gchar *primary = g_markup_printf_escaped(_("Failed to eject \"%s\""),
+ gchar *primary = g_markup_printf_escaped(_("Failed to eject \"%s\""),
mount_name);
/* display an error dialog to inform the user */
xfce_message_dialog(toplevel ? GTK_WINDOW(toplevel) : NULL,
- _("Eject Failed"), "dialog-error",
+ _("Eject Failed"), "dialog-error",
primary, error->message,
XFCE_BUTTON_TYPE_MIXED, "window-close", _("_Close"), GTK_RESPONSE_ACCEPT,
NULL);
@@ -602,14 +602,14 @@ xfdesktop_volume_icon_mount_finish(GObject *object,
gchar *primary = g_markup_printf_escaped(_("Failed to mount \"%s\""),
volume_name);
xfce_message_dialog(toplevel ? GTK_WINDOW(toplevel) : NULL,
- _("Mount Failed"), "dialog-error",
+ _("Mount Failed"), "dialog-error",
primary, error->message,
XFCE_BUTTON_TYPE_MIXED, "window-close", _("_Close"), GTK_RESPONSE_ACCEPT,
NULL);
g_free(primary);
g_free(volume_name);
}
-
+
g_clear_error(&error);
} else {
GMount *mount = g_volume_get_mount(volume);
@@ -634,7 +634,7 @@ xfdesktop_volume_icon_mount_finish(GObject *object,
xfdesktop_file_icon_update_file_info(XFDESKTOP_FILE_ICON(icon), info);
- activated = GPOINTER_TO_UINT(g_object_get_qdata(G_OBJECT(icon),
+ activated = GPOINTER_TO_UINT(g_object_get_qdata(G_OBJECT(icon),
xfdesktop_volume_icon_activated_quark));
if(activated) {
XfdesktopIcon *icon_p = XFDESKTOP_ICON(icon);
@@ -648,7 +648,7 @@ xfdesktop_volume_icon_mount_finish(GObject *object,
xfdesktop_file_icon_update_file_info(XFDESKTOP_FILE_ICON(icon), NULL);
}
-
+
if(file)
g_object_unref(file);
@@ -766,12 +766,12 @@ static void
xfdesktop_volume_icon_menu_properties(GtkWidget *widget,
gpointer user_data)
{
- XfdesktopFileIcon *icon = XFDESKTOP_FILE_ICON(user_data);
+ XfdesktopFileIcon *icon = XFDESKTOP_FILE_ICON(user_data);
GFile *file;
-
+
file = xfdesktop_file_icon_peek_file(icon);
- xfdesktop_file_utils_show_properties_dialog(file,
- XFDESKTOP_VOLUME_ICON(icon)->priv->gscreen,
+ xfdesktop_file_utils_show_properties_dialog(file,
+ XFDESKTOP_VOLUME_ICON(icon)->priv->gscreen,
NULL);
}
@@ -815,11 +815,11 @@ xfdesktop_volume_icon_populate_context_menu(XfdesktopIcon *icon,
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
g_signal_connect_swapped(G_OBJECT(mi), "activate",
G_CALLBACK(xfdesktop_icon_activated), icon);
-
+
mi = gtk_separator_menu_item_new();
gtk_widget_show(mi);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
-
+
mount = g_volume_get_mount(volume);
if(mount && g_volume_can_eject(volume)) {
@@ -860,7 +860,7 @@ xfdesktop_volume_icon_populate_context_menu(XfdesktopIcon *icon,
xfdesktop_volume_icon_add_context_menu_option(icon, icon_name, icon_label,
menu, G_CALLBACK(xfdesktop_volume_icon_menu_properties));
}
-
+
return TRUE;
}
@@ -928,13 +928,13 @@ xfdesktop_volume_icon_activated(XfdesktopIcon *icon_p)
XfdesktopVolumeIcon *icon = XFDESKTOP_VOLUME_ICON(icon_p);
GVolume *volume = xfdesktop_volume_icon_peek_volume(icon);
GMount *mount;
-
+
TRACE("entering");
mount = g_volume_get_mount(volume);
-
+
if(!mount) {
- /* set the activated flag so we can chain the event up to the
+ /* set the activated flag so we can chain the event up to the
* parent class in the mount finish callback */
g_object_set_qdata(G_OBJECT(icon), xfdesktop_volume_icon_activated_quark,
GUINT_TO_POINTER(TRUE));
@@ -986,12 +986,12 @@ volume_icon_changed_timeout(XfdesktopVolumeIcon *volume_icon)
if(mount) {
/* load mount point information */
volume_icon->priv->file = g_mount_get_root(mount);
- volume_icon->priv->file_info =
- g_file_query_info(volume_icon->priv->file,
+ volume_icon->priv->file_info =
+ g_file_query_info(volume_icon->priv->file,
XFDESKTOP_FILE_INFO_NAMESPACE,
G_FILE_QUERY_INFO_NONE,
NULL, NULL);
- volume_icon->priv->filesystem_info =
+ volume_icon->priv->filesystem_info =
g_file_query_filesystem_info(volume_icon->priv->file,
XFDESKTOP_FILESYSTEM_INFO_NAMESPACE,
NULL, NULL);
@@ -1044,13 +1044,13 @@ xfdesktop_volume_icon_changed(GVolume *volume,
XF_DEBUG("VOLUME CHANGED");
/**
- * NOTE: We use a timeout here to check if the volume is
+ * NOTE: We use a timeout here to check if the volume is
* now mounted (or has been unmounted). This timeout seems
* to be needed because when the "changed" signal is emitted,
* the GMount is always NULL. In a 500ms timeout we check
* at most 5 times for a valid mount until we give up. This
* hopefully is a suitable workaround for most machines and
- * drives.
+ * drives.
*/
/* abort an existing timeout, we may have to run it a few times
@@ -1063,8 +1063,8 @@ xfdesktop_volume_icon_changed(GVolume *volume,
/* reset timeout information and start a timeout */
volume_icon->priv->changed_timeout_count = 0;
volume_icon->priv->changed_timeout_id =
- g_timeout_add_full(G_PRIORITY_LOW, 500,
- (GSourceFunc) volume_icon_changed_timeout,
+ g_timeout_add_full(G_PRIORITY_LOW, 500,
+ (GSourceFunc) volume_icon_changed_timeout,
g_object_ref(volume_icon),
g_object_unref);
}
@@ -1075,9 +1075,9 @@ xfdesktop_volume_icon_new(GVolume *volume,
{
XfdesktopVolumeIcon *volume_icon;
GMount *mount;
-
+
g_return_val_if_fail(G_IS_VOLUME(volume), NULL);
-
+
volume_icon = g_object_new(XFDESKTOP_TYPE_VOLUME_ICON, NULL);
volume_icon->priv->volume = g_object_ref(G_OBJECT(volume));
volume_icon->priv->gscreen = screen;
@@ -1100,10 +1100,10 @@ xfdesktop_volume_icon_new(GVolume *volume,
G_CALLBACK(xfdesktop_icon_invalidate_pixbuf),
volume_icon);
- g_signal_connect(volume, "changed",
- G_CALLBACK(xfdesktop_volume_icon_changed),
+ g_signal_connect(volume, "changed",
+ G_CALLBACK(xfdesktop_volume_icon_changed),
volume_icon);
-
+
return volume_icon;
}
diff --git a/src/xfdesktop-volume-icon.h b/src/xfdesktop-volume-icon.h
index 7eff728..485c069 100644
--- a/src/xfdesktop-volume-icon.h
+++ b/src/xfdesktop-volume-icon.h
@@ -38,7 +38,7 @@ typedef struct _XfdesktopVolumeIconPrivate XfdesktopVolumeIconPrivate;
struct _XfdesktopVolumeIcon
{
XfdesktopFileIcon parent;
-
+
/*< private >*/
XfdesktopVolumeIconPrivate *priv;
};
diff --git a/src/xfdesktop-window-icon-manager.c b/src/xfdesktop-window-icon-manager.c
index 4c7c48a..5b3b3ee 100644
--- a/src/xfdesktop-window-icon-manager.c
+++ b/src/xfdesktop-window-icon-manager.c
@@ -71,13 +71,13 @@ typedef struct
struct _XfdesktopWindowIconManagerPrivate
{
gboolean inited;
-
+
GtkWidget *desktop;
XfdesktopIconView *icon_view;
-
+
GdkScreen *gscreen;
WnckScreen *wnck_screen;
-
+
gint nworkspaces;
gint active_ws_num;
XfdesktopWindowIconWorkspace **icon_workspaces;
@@ -94,13 +94,13 @@ static void
xfdesktop_window_icon_manager_class_init(XfdesktopWindowIconManagerClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfdesktopWindowIconManagerPrivate));
-
+
gobject_class->set_property = xfdesktop_window_icon_manager_set_property;
gobject_class->get_property = xfdesktop_window_icon_manager_get_property;
gobject_class->finalize = xfdesktop_window_icon_manager_finalize;
-
+
g_object_class_install_property(gobject_class, PROP_SCREEN,
g_param_spec_object("screen", "GDK Screen",
"GDK Screen this icon manager manages",
@@ -124,13 +124,13 @@ xfdesktop_window_icon_manager_set_property(GObject *object,
GParamSpec *pspec)
{
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(object);
-
+
switch(property_id) {
case PROP_SCREEN:
wmanager->priv->gscreen = g_value_peek_pointer(value);
wmanager->priv->wnck_screen = wnck_screen_get(0);
break;
-
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -143,12 +143,12 @@ xfdesktop_window_icon_manager_get_property(GObject *object,
GParamSpec *pspec)
{
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(object);
-
+
switch(property_id) {
case PROP_SCREEN:
g_value_set_object(value, wmanager->priv->gscreen);
break;
-
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -158,12 +158,12 @@ static void
xfdesktop_window_icon_manager_finalize(GObject *obj)
{
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(obj);
-
+
TRACE("entering");
-
+
if(wmanager->priv->inited)
xfdesktop_window_icon_manager_fini(XFDESKTOP_ICON_VIEW_MANAGER(wmanager));
-
+
G_OBJECT_CLASS(xfdesktop_window_icon_manager_parent_class)->finalize(obj);
}
@@ -181,7 +181,7 @@ xfdesktop_window_icon_manager_icon_selection_changed_cb(XfdesktopIconView *icon_
{
XfdesktopWindowIconManager *wmanager = user_data;
GList *selected;
-
+
selected = xfdesktop_icon_view_get_selected_items(icon_view);
if(selected) {
XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(selected->data);
@@ -198,14 +198,14 @@ xfdesktop_window_icon_manager_add_icon(XfdesktopWindowIconManager *wmanager,
gint ws_num)
{
XfdesktopWindowIcon *icon = xfdesktop_window_icon_new(window, ws_num);
-
+
g_hash_table_insert(wmanager->priv->icon_workspaces[ws_num]->icons,
window, icon);
-
+
if(ws_num == wmanager->priv->active_ws_num)
xfdesktop_icon_view_add_item(wmanager->priv->icon_view,
XFDESKTOP_ICON(icon));
-
+
return icon;
}
@@ -233,24 +233,24 @@ workspace_changed_cb(WnckScreen *wnck_screen,
XF_DEBUG("got weird failure of wnck_screen_get_active_workspace(), bailing");
return;
}
-
+
xfdesktop_icon_view_remove_all(wmanager->priv->icon_view);
-
+
wmanager->priv->active_ws_num = n = wnck_workspace_get_number(ws);
-
+
if(!wmanager->priv->icon_workspaces[n]->icons) {
GList *windows, *l;
-
+
wmanager->priv->icon_workspaces[n]->icons =
g_hash_table_new_full(g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify)g_object_unref);
-
+
windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
for(l = windows; l; l = l->next) {
WnckWindow *window = l->data;
-
+
if((ws == wnck_window_get_workspace(window)
|| wnck_window_is_pinned(window))
&& wnck_window_is_minimized(window)
@@ -263,7 +263,7 @@ workspace_changed_cb(WnckScreen *wnck_screen,
} else
g_hash_table_foreach(wmanager->priv->icon_workspaces[n]->icons,
xfdesktop_add_window_icons_foreach, wmanager);
-
+
if(wmanager->priv->icon_workspaces[n]->selected_icon) {
xfdesktop_icon_view_select_item(wmanager->priv->icon_view,
XFDESKTOP_ICON(wmanager->priv->icon_workspaces[n]->selected_icon));
@@ -277,20 +277,20 @@ workspace_created_cb(WnckScreen *wnck_screen,
{
XfdesktopWindowIconManager *wmanager = user_data;
gint ws_num, n_ws;
-
+
n_ws = wnck_screen_get_workspace_count(wnck_screen);
wmanager->priv->nworkspaces = n_ws;
ws_num = wnck_workspace_get_number(workspace);
-
+
wmanager->priv->icon_workspaces = g_realloc(wmanager->priv->icon_workspaces,
sizeof(gpointer) * n_ws);
-
+
if(ws_num != n_ws - 1) {
memmove(wmanager->priv->icon_workspaces + ws_num + 1,
wmanager->priv->icon_workspaces + ws_num,
sizeof(gpointer) * (n_ws - ws_num - 1));
}
-
+
wmanager->priv->icon_workspaces[ws_num] = g_new0(XfdesktopWindowIconWorkspace,
1);
}
@@ -305,21 +305,21 @@ workspace_destroyed_cb(WnckScreen *wnck_screen,
* for each one. preferably that is the case. */
XfdesktopWindowIconManager *wmanager = user_data;
gint ws_num, n_ws;
-
+
n_ws = wnck_screen_get_workspace_count(wnck_screen);
wmanager->priv->nworkspaces = n_ws;
ws_num = wnck_workspace_get_number(workspace);
-
+
if(wmanager->priv->icon_workspaces[ws_num]->icons)
g_hash_table_destroy(wmanager->priv->icon_workspaces[ws_num]->icons);
g_free(wmanager->priv->icon_workspaces[ws_num]);
-
+
if(ws_num != n_ws) {
memmove(wmanager->priv->icon_workspaces + ws_num,
wmanager->priv->icon_workspaces + ws_num + 1,
sizeof(gpointer) * (n_ws - ws_num));
}
-
+
wmanager->priv->icon_workspaces = g_realloc(wmanager->priv->icon_workspaces,
sizeof(gpointer) * n_ws);
}
@@ -335,21 +335,21 @@ window_state_changed_cb(WnckWindow *window,
gint ws_num = -1, i, max_i;
gboolean is_add = FALSE;
XfdesktopWindowIcon *icon;
-
+
TRACE("entering");
-
+
if(!(changed_mask & (WNCK_WINDOW_STATE_MINIMIZED |
WNCK_WINDOW_STATE_SKIP_TASKLIST)))
{
return;
}
-
+
XF_DEBUG("changed_mask indicates an action");
-
+
ws = wnck_window_get_workspace(window);
if(ws)
ws_num = wnck_workspace_get_number(ws);
-
+
if( (changed_mask & WNCK_WINDOW_STATE_MINIMIZED
&& new_state & WNCK_WINDOW_STATE_MINIMIZED)
|| (changed_mask & WNCK_WINDOW_STATE_SKIP_TASKLIST
@@ -357,9 +357,9 @@ window_state_changed_cb(WnckWindow *window,
{
is_add = TRUE;
}
-
+
XF_DEBUG("is_add == %s", is_add?"TRUE":"FALSE");
-
+
/* this is a cute way of handling adding/removing from *all* workspaces
* when we're dealing with a sticky windows, and just adding/removing
* from a single workspace otherwise, without duplicating code */
@@ -372,7 +372,7 @@ window_state_changed_cb(WnckWindow *window,
i = ws_num;
max_i = i + 1;
}
-
+
if(is_add) {
for(; i < max_i; i++) {
TRACE("loop: %d", i);
@@ -382,7 +382,7 @@ window_state_changed_cb(WnckWindow *window,
{
continue;
}
-
+
XF_DEBUG("adding to WS %d", i);
xfdesktop_window_icon_manager_add_icon(wmanager, window, i);
}
@@ -391,7 +391,7 @@ window_state_changed_cb(WnckWindow *window,
TRACE("loop: %d", i);
if(!wmanager->priv->icon_workspaces[i]->icons)
continue;
-
+
icon = g_hash_table_lookup(wmanager->priv->icon_workspaces[i]->icons,
window);
if(icon) {
@@ -417,25 +417,25 @@ window_workspace_changed_cb(WnckWindow *window,
WnckWorkspace *new_ws;
gint i, new_ws_num = -1, n_ws;
XfdesktopIcon *icon;
-
+
TRACE("entering");
-
+
if(!wnck_window_is_minimized(window))
return;
-
+
n_ws = wmanager->priv->nworkspaces;
-
+
new_ws = wnck_window_get_workspace(window);
if(new_ws)
new_ws_num = wnck_workspace_get_number(new_ws);
-
+
for(i = 0; i < n_ws; i++) {
if(!wmanager->priv->icon_workspaces[i]->icons)
continue;
-
+
icon = g_hash_table_lookup(wmanager->priv->icon_workspaces[i]->icons,
window);
-
+
if(new_ws) {
/* window is not sticky */
if(i != new_ws_num && icon) {
@@ -463,11 +463,11 @@ window_destroyed_cb(gpointer data,
WnckWindow *window = (WnckWindow *)where_the_object_was;
gint i;
XfdesktopIcon *icon;
-
+
for(i = 0; i < wmanager->priv->nworkspaces; i++) {
if(!wmanager->priv->icon_workspaces[i]->icons)
continue;
-
+
icon = g_hash_table_lookup(wmanager->priv->icon_workspaces[i]->icons,
window);
if(icon) {
@@ -489,7 +489,7 @@ window_created_cb(WnckScreen *wnck_screen,
gpointer user_data)
{
XfdesktopWindowIconManager *wmanager = user_data;
-
+
g_signal_connect(G_OBJECT(window), "state-changed",
G_CALLBACK(window_state_changed_cb), wmanager);
g_signal_connect(G_OBJECT(window), "workspace-changed",
@@ -504,10 +504,10 @@ xfdesktop_window_icon_manager_populate_context_menu(XfceDesktop *desktop,
{
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(user_data);
XfdesktopWindowIconWorkspace *wiws = wmanager->priv->icon_workspaces[wmanager->priv->active_ws_num];
-
+
if(!wiws->selected_icon)
return;
-
+
xfdesktop_icon_populate_context_menu(XFDESKTOP_ICON(wiws->selected_icon),
GTK_WIDGET(menu));
}
@@ -534,18 +534,18 @@ xfdesktop_window_icon_manager_real_init(XfdesktopIconViewManager *manager,
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(manager);
GList *windows, *l;
gint i;
-
+
wmanager->priv->icon_view = icon_view;
xfdesktop_icon_view_set_selection_mode(icon_view, GTK_SELECTION_SINGLE);
g_signal_connect(G_OBJECT(icon_view), "icon-selection-changed",
G_CALLBACK(xfdesktop_window_icon_manager_icon_selection_changed_cb),
wmanager);
-
+
wmanager->priv->desktop = gtk_widget_get_toplevel(GTK_WIDGET(icon_view));
g_signal_connect(G_OBJECT(wmanager->priv->desktop), "populate-root-menu",
G_CALLBACK(xfdesktop_window_icon_manager_populate_context_menu),
wmanager);
-
+
wnck_screen_force_update(wmanager->priv->wnck_screen);
g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen),
"active-workspace-changed",
@@ -557,7 +557,7 @@ xfdesktop_window_icon_manager_real_init(XfdesktopIconViewManager *manager,
g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen),
"workspace-destroyed",
G_CALLBACK(workspace_destroyed_cb), wmanager);
-
+
wmanager->priv->nworkspaces = wnck_screen_get_workspace_count(wmanager->priv->wnck_screen);
wmanager->priv->active_ws_num = wnck_workspace_get_number(wnck_screen_get_active_workspace(wmanager->priv->wnck_screen));
wmanager->priv->icon_workspaces = g_malloc0(wmanager->priv->nworkspaces
@@ -566,22 +566,22 @@ xfdesktop_window_icon_manager_real_init(XfdesktopIconViewManager *manager,
wmanager->priv->icon_workspaces[i] = g_new0(XfdesktopWindowIconWorkspace,
1);
}
-
+
windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
for(l = windows; l; l = l->next) {
WnckWindow *window = l->data;
-
+
g_signal_connect(G_OBJECT(window), "state-changed",
G_CALLBACK(window_state_changed_cb), wmanager);
g_signal_connect(G_OBJECT(window), "workspace-changed",
G_CALLBACK(window_workspace_changed_cb), wmanager);
g_object_weak_ref(G_OBJECT(window), window_destroyed_cb, wmanager);
}
-
+
workspace_changed_cb(wmanager->priv->wnck_screen, NULL, wmanager);
-
+
wmanager->priv->inited = TRUE;
-
+
return TRUE;
}
@@ -591,11 +591,11 @@ xfdesktop_window_icon_manager_fini(XfdesktopIconViewManager *manager)
XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(manager);
gint i;
GList *windows, *l;
-
+
TRACE("entering");
-
+
wmanager->priv->inited = FALSE;
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
G_CALLBACK(workspace_changed_cb),
wmanager);
@@ -608,11 +608,11 @@ xfdesktop_window_icon_manager_fini(XfdesktopIconViewManager *manager)
g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
G_CALLBACK(workspace_destroyed_cb),
wmanager);
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->desktop),
G_CALLBACK(xfdesktop_window_icon_manager_populate_context_menu),
wmanager);
-
+
windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
for(l = windows; l; l = l->next) {
g_signal_handlers_disconnect_by_func(G_OBJECT(l->data),
@@ -623,12 +623,12 @@ xfdesktop_window_icon_manager_fini(XfdesktopIconViewManager *manager)
wmanager);
g_object_weak_unref(G_OBJECT(l->data), window_destroyed_cb, wmanager);
}
-
+
xfdesktop_icon_view_remove_all(wmanager->priv->icon_view);
g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->icon_view),
G_CALLBACK(xfdesktop_window_icon_manager_icon_selection_changed_cb),
wmanager);
-
+
for(i = 0; i < wmanager->priv->nworkspaces; ++i) {
if(wmanager->priv->icon_workspaces[i]->icons)
g_hash_table_destroy(wmanager->priv->icon_workspaces[i]->icons);
diff --git a/src/xfdesktop-window-icon-manager.h b/src/xfdesktop-window-icon-manager.h
index 0cffed8..2d186ee 100644
--- a/src/xfdesktop-window-icon-manager.h
+++ b/src/xfdesktop-window-icon-manager.h
@@ -39,7 +39,7 @@ typedef struct _XfdesktopWindowIconManagerPrivate XfdesktopWindowIconManagerPri
struct _XfdesktopWindowIconManager
{
GObject parent;
-
+
/*< private >*/
XfdesktopWindowIconManagerPrivate *priv;
};
diff --git a/src/xfdesktop-window-icon.c b/src/xfdesktop-window-icon.c
index 9bd8eea..690948b 100644
--- a/src/xfdesktop-window-icon.c
+++ b/src/xfdesktop-window-icon.c
@@ -63,11 +63,11 @@ xfdesktop_window_icon_class_init(XfdesktopWindowIconClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *)klass;
XfdesktopIconClass *icon_class = (XfdesktopIconClass *)klass;
-
+
g_type_class_add_private(klass, sizeof(XfdesktopWindowIconPrivate));
-
+
gobject_class->finalize = xfdesktop_window_icon_finalize;
-
+
icon_class->peek_pixbuf = xfdesktop_window_icon_peek_pixbuf;
icon_class->peek_label = xfdesktop_window_icon_peek_label;
icon_class->get_identifier = xfdesktop_window_icon_get_identifier;
@@ -88,9 +88,9 @@ xfdesktop_window_icon_finalize(GObject *obj)
XfdesktopWindowIcon *icon = XFDESKTOP_WINDOW_ICON(obj);
gchar data_name[256];
gint16 row, col;
-
+
g_free(icon->priv->label);
-
+
/* save previous position */
if(xfdesktop_icon_get_position(XFDESKTOP_ICON(icon), &row, &col)) {
g_snprintf(data_name, 256, "--xfdesktop-last-row-%d",
@@ -102,14 +102,14 @@ xfdesktop_window_icon_finalize(GObject *obj)
g_object_set_data(G_OBJECT(icon->priv->window),
data_name, GUINT_TO_POINTER(col + 1));
}
-
+
g_signal_handlers_disconnect_by_func(G_OBJECT(icon->priv->window),
G_CALLBACK(xfdesktop_window_name_changed_cb),
icon);
g_signal_handlers_disconnect_by_func(G_OBJECT(icon->priv->window),
G_CALLBACK(xfdesktop_window_icon_changed_cb),
icon);
-
+
G_OBJECT_CLASS(xfdesktop_window_icon_parent_class)->finalize(obj);
}
@@ -120,10 +120,10 @@ xfdesktop_window_name_changed_cb(WnckWindow *window,
gpointer user_data)
{
XfdesktopWindowIcon *icon = user_data;
-
+
g_free(icon->priv->label);
icon->priv->label = NULL;
-
+
xfdesktop_icon_label_changed(XFDESKTOP_ICON(icon));
}
@@ -159,10 +159,10 @@ static const gchar *
xfdesktop_window_icon_peek_label(XfdesktopIcon *icon)
{
XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(icon);
-
+
if(!window_icon->priv->label)
window_icon->priv->label = g_strdup(wnck_window_get_name(window_icon->priv->window));
-
+
return window_icon->priv->label;
}
@@ -176,10 +176,10 @@ static gboolean
xfdesktop_window_icon_activated(XfdesktopIcon *icon)
{
XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(icon);
-
+
wnck_window_activate(window_icon->priv->window,
gtk_get_current_event_time());
-
+
return TRUE;
}
@@ -208,10 +208,10 @@ xfdesktop_window_icon_new(WnckWindow *window,
XfdesktopWindowIcon *icon = g_object_new(XFDESKTOP_TYPE_WINDOW_ICON, NULL);
gchar data_name[256];
gint row, col;
-
+
icon->priv->window = window;
icon->priv->workspace = workspace;
-
+
/* check for availability of old position (if any) */
g_snprintf(data_name, 256, "--xfdesktop-last-row-%d", workspace);
row = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(window),
@@ -221,14 +221,14 @@ xfdesktop_window_icon_new(WnckWindow *window,
data_name));
if(row > 0 && col > 0)
xfdesktop_icon_set_position(XFDESKTOP_ICON(icon), row - 1, col - 1);
-
+
g_signal_connect(G_OBJECT(window), "name-changed",
G_CALLBACK(xfdesktop_window_name_changed_cb),
icon);
g_signal_connect(G_OBJECT(window), "icon-changed",
G_CALLBACK(xfdesktop_window_icon_changed_cb),
icon);
-
+
return icon;
}
diff --git a/src/xfdesktop-window-icon.h b/src/xfdesktop-window-icon.h
index 6f9dd7b..7af6902 100644
--- a/src/xfdesktop-window-icon.h
+++ b/src/xfdesktop-window-icon.h
@@ -39,7 +39,7 @@ typedef struct _XfdesktopWindowIconPrivate XfdesktopWindowIconPrivate;
struct _XfdesktopWindowIcon
{
XfdesktopIcon parent;
-
+
/*< private >*/
XfdesktopWindowIconPrivate *priv;
};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list