diff --git a/ChangeLog b/ChangeLog index 28eab75d..1614280d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-01 00:00 nick + + * Fix a bunch of compiler warnings. + * Remove deprecated gtk_type_class. + * Fix icon update hook in launcher, this is bothering me for a long time. + * Install settings desktop file in $(datadir)/xfce4/settings-dialogs too. + * Fix german typo: Bug 4066. + * Fix dnd to launcher: Bug 3958. + 2008-07-15 13:04 jannis * autogen.sh: Change @REVISION@ substitution for git svn repositories diff --git a/libxfce4panel/xfce-hvbox.c b/libxfce4panel/xfce-hvbox.c index 17199c76..302e3a37 100644 --- a/libxfce4panel/xfce-hvbox.c +++ b/libxfce4panel/xfce-hvbox.c @@ -76,26 +76,22 @@ xfce_hvbox_class_init (XfceHVBoxClass *klass) -static GtkWidgetClass * -get_class (XfceHVBox *hvbox) +static gpointer +xfce_hvbox_get_class (XfceHVBox *hvbox) { - GtkWidgetClass *klass; - - switch (hvbox->orientation) - { - case GTK_ORIENTATION_HORIZONTAL: - klass = GTK_WIDGET_CLASS (gtk_type_class (GTK_TYPE_HBOX)); - break; - case GTK_ORIENTATION_VERTICAL: - klass = GTK_WIDGET_CLASS (gtk_type_class (GTK_TYPE_VBOX)); - break; - default: - g_assert_not_reached (); - klass = NULL; - break; - } - - return klass; + GType type; + gpointer klass; + + if (hvbox->orientation == GTK_ORIENTATION_HORIZONTAL) + type = GTK_TYPE_HBOX; + else + type = GTK_TYPE_VBOX; + + /* peek the class, this only works if the class already exists */ + klass = g_type_class_peek (type); + + /* return the type or create the class */ + return klass ? klass : g_type_class_ref (type); } @@ -104,14 +100,13 @@ static void xfce_hvbox_size_request (GtkWidget *widget, GtkRequisition *requisition) { - GtkWidgetClass *klass; - XfceHVBox *hvbox; + gpointer klass; - hvbox = XFCE_HVBOX (widget); - - klass = get_class (hvbox); - - klass->size_request (widget, requisition); + /* get the widget class */ + klass = xfce_hvbox_get_class (XFCE_HVBOX (widget)); + + /* request the size */ + (*GTK_WIDGET_CLASS (klass)->size_request) (widget, requisition); } @@ -120,14 +115,13 @@ static void xfce_hvbox_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { - GtkWidgetClass *klass; - XfceHVBox *hvbox; - - hvbox = XFCE_HVBOX (widget); + gpointer klass; - klass = get_class (hvbox); + /* get the widget class */ + klass = xfce_hvbox_get_class (XFCE_HVBOX (widget)); - klass->size_allocate (widget, allocation); + /* allocate the size */ + (*GTK_WIDGET_CLASS (klass)->size_allocate) (widget, allocation); } diff --git a/mcs-plugin/Makefile.am b/mcs-plugin/Makefile.am index e0348e5f..65b44c9d 100644 --- a/mcs-plugin/Makefile.am +++ b/mcs-plugin/Makefile.am @@ -45,6 +45,10 @@ desktop_in_files = \ xfce4-panel-manager.desktop.in desktop_DATA = \ $(desktop_in_files:.desktop.in=.desktop) + +settingsdir = $(datadir)/xfce4/settings-dialogs +settings_DATA = $(desktop_DATA) + @INTLTOOL_DESKTOP_RULE@ CLEANFILES = \ diff --git a/panel/panel-app.c b/panel/panel-app.c index 12fe95e2..556e4d0d 100644 --- a/panel/panel-app.c +++ b/panel/panel-app.c @@ -145,7 +145,7 @@ static gint signal_pipe[2]; static void cleanup_panels (void) { - gint i; + guint i; GList *l; Panel *panel; XfceMonitor *xmon; @@ -420,7 +420,7 @@ session_die (gpointer client_data) static void monitor_size_changed (GdkScreen *screen) { - gint i; + guint i; XfceMonitor *monitor; GtkWidget *panel; @@ -453,6 +453,7 @@ create_monitor_list (void) gint n_screens; gint n_monitors = 0; gint i, j; + guint k, m; gint w = 0, h = 0; gboolean equal_w, equal_h; XfceMonitor *mon1, *mon2; @@ -516,16 +517,16 @@ create_monitor_list (void) } /* check layout */ - for (i = 0; i < panel_app.monitor_list->len; ++i) + for (k = 0; k < panel_app.monitor_list->len; ++k) { - mon1 = g_ptr_array_index (panel_app.monitor_list, i); + mon1 = g_ptr_array_index (panel_app.monitor_list, k); - for (j = 0; j < panel_app.monitor_list->len; ++j) + for (m = 0; m < panel_app.monitor_list->len; ++m) { - if (j == i) + if (m == k) continue; - mon2 = g_ptr_array_index (panel_app.monitor_list, j); + mon2 = g_ptr_array_index (panel_app.monitor_list, m); if (mon2->geometry.x < mon1->geometry.x && mon2->geometry.y < mon1->geometry.y + mon1->geometry.height @@ -878,7 +879,7 @@ void panel_app_remove_panel (GtkWidget *panel) { gint response = GTK_RESPONSE_NONE; - gint n; + guint n; gchar *first; if (!xfce_allow_panel_customization()) @@ -985,13 +986,13 @@ panel_app_get_ipc_window (void) } XfceMonitor * -panel_app_get_monitor (gint n) +panel_app_get_monitor (guint n) { return g_ptr_array_index (panel_app.monitor_list, - CLAMP (n, 0, panel_app.monitor_list->len - 1)); + MIN (n, panel_app.monitor_list->len - 1)); } -gint +guint panel_app_get_n_monitors (void) { return panel_app.monitor_list->len; @@ -1013,7 +1014,7 @@ panel_app_register_dialog (GtkWidget *dialog) void panel_app_set_current_panel (gpointer *panel) { - gint i; + guint i; panel_app.current_panel = 0; @@ -1032,13 +1033,13 @@ panel_app_set_current_panel (gpointer *panel) void panel_app_unset_current_panel (gpointer *panel) { - gint i; + guint i; for (i = 0; i < panel_app.panel_list->len; ++i) { if (g_ptr_array_index (panel_app.panel_list, i) == panel) { - if (i == panel_app.current_panel) + if (i == (guint) panel_app.current_panel) panel_app.current_panel = 0; break; } diff --git a/panel/panel-app.h b/panel/panel-app.h index 17da82c2..93df5209 100644 --- a/panel/panel-app.h +++ b/panel/panel-app.h @@ -100,9 +100,9 @@ void panel_app_about (GtkWidget *panel); Window panel_app_get_ipc_window (void); -XfceMonitor *panel_app_get_monitor (int n); +XfceMonitor *panel_app_get_monitor (guint n); -int panel_app_get_n_monitors (void); +guint panel_app_get_n_monitors (void); gboolean panel_app_monitors_equal_height (void); diff --git a/panel/panel-config.c b/panel/panel-config.c index 737398a5..2ae5d604 100644 --- a/panel/panel-config.c +++ b/panel/panel-config.c @@ -157,7 +157,7 @@ panel_config_save_panels (GPtrArray * panels) { gchar *file; gboolean failed = FALSE; - gint i; + guint i; const gchar *path = "xfce4" G_DIR_SEPARATOR_S "panel" G_DIR_SEPARATOR_S "panels.xml"; @@ -623,9 +623,9 @@ gboolean config_save_to_file (GPtrArray *array, const gchar *filename) { - FILE *fp; - gchar tmp_path[PATH_MAX]; - gint i; + FILE *fp; + gchar tmp_path[PATH_MAX]; + guint i; g_return_val_if_fail (array != NULL, FALSE); g_return_val_if_fail (filename != NULL || (strlen (filename) > 0), FALSE); diff --git a/panel/panel-dialogs.c b/panel/panel-dialogs.c index af41c1ed..99eae69e 100644 --- a/panel/panel-dialogs.c +++ b/panel/panel-dialogs.c @@ -430,7 +430,7 @@ add_item_treeview (PanelItemsDialog *pid) GtkTreeModel *model; GtkTreePath *path; GtkTreeIter iter; - gint i; + guint i; GdkColor *color; GtkRequisition req; @@ -701,7 +701,7 @@ static void update_widgets (PanelManagerDialog *pmd) { PanelPrivate *priv = PANEL_GET_PRIVATE (pmd->panel); - gint i; + guint i; GtkToggleButton *tb; XfceHandleStyle style; @@ -714,7 +714,7 @@ update_widgets (PanelManagerDialog *pmd) { tb = g_ptr_array_index (pmd->monitors, i); - gtk_toggle_button_set_active (tb, i == priv->monitor); + gtk_toggle_button_set_active (tb, i == (guint) priv->monitor); } } @@ -746,7 +746,7 @@ update_widgets (PanelManagerDialog *pmd) { gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (pmd->screen_position[i]), - (gint) priv->screen_position == i+1); + priv->screen_position == i + 1); } gtk_combo_box_set_active (GTK_COMBO_BOX (pmd->fullwidth), @@ -1222,7 +1222,7 @@ monitor_pressed (GtkToggleButton *tb, GdkEvent *ev, PanelManagerDialog *pmd) { - gint i; + guint i; GtkToggleButton *mon; if (ev->type == GDK_KEY_PRESS && @@ -1527,7 +1527,8 @@ add_panel (GtkWidget *w, PanelManagerDialog *pmd) { gchar name[20]; - gint n, x, y; + guint n; + gint x, y; n = pmd->panels->len; @@ -1558,8 +1559,8 @@ static void remove_panel (GtkWidget *w, PanelManagerDialog *pmd) { - gint n = pmd->panels->len; - gint i; + guint n = pmd->panels->len; + guint i; gchar name[20]; panel_app_remove_panel (GTK_WIDGET (pmd->panel)); @@ -1586,7 +1587,7 @@ static GtkWidget * create_panel_selector (PanelManagerDialog *pmd) { GtkWidget *hbox, *img; - gint i; + guint i; gchar name[20]; hbox = gtk_hbox_new (FALSE, BORDER); diff --git a/panel/panel-item-manager.c b/panel/panel-item-manager.c index cd1af406..014ae7ff 100644 --- a/panel/panel-item-manager.c +++ b/panel/panel-item-manager.c @@ -525,7 +525,7 @@ xfce_panel_item_manager_get_item_info_list (void) void xfce_panel_item_manager_free_item_info_list (GPtrArray *info_list) { - gint i; + guint i; for (i = 0; i < info_list->len; ++i) { diff --git a/panel/panel-properties.c b/panel/panel-properties.c index b43bfe92..3d949c78 100644 --- a/panel/panel-properties.c +++ b/panel/panel-properties.c @@ -1194,9 +1194,9 @@ panel_set_full_width (Panel *panel, priv = panel->priv; - if (fullwidth != priv->full_width) + if ((XfcePanelWidthType) fullwidth != priv->full_width) { - priv->full_width = fullwidth; + priv->full_width = (XfcePanelWidthType) fullwidth; if (GTK_WIDGET_VISIBLE (panel)) { diff --git a/panel/panel.c b/panel/panel.c index 78c9b3ea..803c02b8 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -778,7 +778,7 @@ _item_start_move_end (GtkWidget *item, if (!priv->edit_mode) { const GPtrArray *panels = panel_app_get_panel_list (); - gint i; + guint i; for (i = 0; i < panels->len; ++i) { @@ -802,7 +802,7 @@ _item_start_move (GtkWidget *item, const GPtrArray *panels = panel_app_get_panel_list (); PanelPrivate *priv; Panel *p; - gint i; + guint i; for (i = 0; i < panels->len; ++i) { diff --git a/plugins/clock/clock-dialog.c b/plugins/clock/clock-dialog.c index 2023fd02..b306f032 100644 --- a/plugins/clock/clock-dialog.c +++ b/plugins/clock/clock-dialog.c @@ -139,7 +139,7 @@ xfce_clock_dialog_tooltip_format_changed (GtkComboBox *combo, entry = g_object_get_data (G_OBJECT (combo), I_("entry")); /* set one of the default formats */ - if (index < G_N_ELEMENTS (tooltip_formats)) + if (index < (gint) G_N_ELEMENTS (tooltip_formats)) { /* hide the entry */ gtk_widget_hide (entry); @@ -260,7 +260,7 @@ xfce_clock_dialog_digital_format_changed (GtkComboBox *combo, entry = g_object_get_data (G_OBJECT (combo), I_("entry")); /* set one of the default formats */ - if (index < G_N_ELEMENTS (digital_formats)) + if (index < (gint) G_N_ELEMENTS (digital_formats)) { /* hide the entry */ gtk_widget_hide (entry); diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c index 55fe07ea..06c1dbe7 100644 --- a/plugins/launcher/launcher-dialog.c +++ b/plugins/launcher/launcher-dialog.c @@ -1061,7 +1061,7 @@ launcher_dialog_tree_button_clicked (GtkWidget *button, list_length = g_list_length (ld->launcher->entries); /* select previous item, if last item was removed */ - if (position >= list_length) + if (position >= (guint) list_length) gtk_tree_path_prev (path); /* select the new item (also updates treeview buttons) */ diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c index 009eb067..18416088 100644 --- a/plugins/launcher/launcher.c +++ b/plugins/launcher/launcher.c @@ -111,10 +111,6 @@ launcher_utility_icon_theme_changed (GSignalInvocationHint *ihint, const GValue *param_values, LauncherPlugin *launcher) { - /* only update if we already have an image, this fails when the signal is connected */ - if (G_LIKELY (gtk_image_get_storage_type (GTK_IMAGE (launcher->image)) == GTK_IMAGE_EMPTY)) - return TRUE; - /* update the button icon */ launcher_icon_button_set_icon (launcher); @@ -133,21 +129,38 @@ launcher_utility_filenames_from_selection_data (GtkSelectionData *selection_data gchar **uri_list; GSList *filenames = NULL; gchar *filename; + gboolean is_uri = TRUE; guint i; /* check whether the retrieval worked */ if (G_LIKELY (selection_data->length > 0)) { - /* split the received uri list */ - uri_list = g_uri_list_extract_uris ((gchar *) selection_data->data); + if (g_str_equal(gdk_atom_name(selection_data->target), "text/uri-list")) + { + /* split the received uri list */ + uri_list = g_uri_list_extract_uris ((gchar *) selection_data->data); + } + else + { + /* split input by \n, \r or \r\n, this might result in empty elements, we sort + * them out below */ + uri_list = g_strsplit_set ((gchar *) selection_data->data, "\n\r", 0); + is_uri = FALSE; + } if (G_LIKELY (uri_list)) { - /* walk though the list */ + /* walk through the list */ for (i = 0; uri_list[i] != NULL; i++) { + if (! uri_list[i][0]) /* skip emtpy elements */ + continue; + /* convert the uri to a filename */ - filename = g_filename_from_uri (uri_list[i], NULL, NULL); + if (is_uri) + filename = g_filename_from_uri (uri_list[i], NULL, NULL); + else + filename = g_strdup (uri_list[i]); /* prepend the filename */ if (G_LIKELY (filename)) diff --git a/plugins/launcher/launcher.h b/plugins/launcher/launcher.h index ada3ea3f..8b013fe5 100644 --- a/plugins/launcher/launcher.h +++ b/plugins/launcher/launcher.h @@ -105,6 +105,9 @@ enum static const GtkTargetEntry drop_targets[] = { { "text/uri-list", 0, 0, }, + { "STRING", 0, 0 }, + { "UTF8_STRING", 0, 0 }, + { "text/plain", 0, 0 }, }; diff --git a/po/de.po b/po/de.po index 110efcf2..f3ff5109 100644 --- a/po/de.po +++ b/po/de.po @@ -811,7 +811,7 @@ msgstr "Arbeitsfläche anzeigen/verstecken" #: ../plugins/systray/systray.desktop.in.in.h:1 msgid "Show notification icons" -msgstr "Symbole für Benchrichtigungen anzeigen" +msgstr "Symbole für Benachrichtigung anzeigen" #: ../plugins/tasklist/tasklist.desktop.in.in.h:1 msgid "Show all running applications"