diff --git a/plugins/thunar-sendto-email/main.c b/plugins/thunar-sendto-email/main.c index c6e8f11850ba22521f88ca1b9c9b394db2e4c042..eea70f977ebe76754f86b7a959f82529c7e9476d 100644 --- a/plugins/thunar-sendto-email/main.c +++ b/plugins/thunar-sendto-email/main.c @@ -257,7 +257,7 @@ tse_progress (const gchar *working_directory, GtkWidget *vbox; gboolean succeed = FALSE; GPid pid; - gint pulse_timer_id; + guint pulse_timer_id; gint watch_id; gint response; gint status; diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c index a155fa1bab317769f3c7542dc22b2456ebfb3485..d1f5eadc6e8117b6a46c1d8844d07d6f7fc700a0 100644 --- a/thunar/thunar-launcher.c +++ b/thunar/thunar-launcher.c @@ -151,7 +151,7 @@ struct _ThunarLauncher ThunarDeviceMonitor *device_monitor; ThunarSendtoModel *sendto_model; - gint sendto_idle_id; + guint sendto_idle_id; }; struct _ThunarLauncherMountData diff --git a/thunar/thunar-location-button.c b/thunar/thunar-location-button.c index 37e493e0eccadc3ec94f131a806a2b0c3a143513..7f9cd0ff5399147cc9b68274370e3eec9c37550a 100644 --- a/thunar/thunar-location-button.c +++ b/thunar/thunar-location-button.c @@ -137,7 +137,7 @@ struct _ThunarLocationButton ThunarFileIconState file_icon_state; /* enter folders using DnD */ - gint enter_timeout_id; + guint enter_timeout_id; /* drop support for the button */ GList *drop_file_list; diff --git a/thunar/thunar-renamer-progress.c b/thunar/thunar-renamer-progress.c index 8e3fa39872975ca9dca1447a96e0b68f48b4930a..4e971206c06972856e6e8d4bc1bc57bba3b8c8ee 100644 --- a/thunar/thunar-renamer-progress.c +++ b/thunar/thunar-renamer-progress.c @@ -57,7 +57,7 @@ struct _ThunarRenamerProgress gboolean pairs_undo; /* whether we're undoing previous changes */ /* internal main loop for the _rename() method */ - gint next_idle_id; + guint next_idle_id; GMainLoop *next_idle_loop; }; @@ -85,8 +85,6 @@ thunar_renamer_progress_class_init (ThunarRenamerProgressClass *klass) static void thunar_renamer_progress_init (ThunarRenamerProgress *renamer_progress) { - renamer_progress->next_idle_id = -1; - gtk_alignment_set (GTK_ALIGNMENT (renamer_progress), 0.5f, 0.5f, 1.0f, 0.0f); renamer_progress->bar = gtk_progress_bar_new (); @@ -102,7 +100,7 @@ thunar_renamer_progress_finalize (GObject *object) ThunarRenamerProgress *renamer_progress = THUNAR_RENAMER_PROGRESS (object); /* make sure we're not finalized while the main loop is active */ - _thunar_assert (renamer_progress->next_idle_id < 0); + _thunar_assert (renamer_progress->next_idle_id == 0); _thunar_assert (renamer_progress->next_idle_loop == NULL); /* release the pairs */ @@ -264,7 +262,7 @@ thunar_renamer_progress_next_idle (gpointer user_data) static void thunar_renamer_progress_next_idle_destroy (gpointer user_data) { - THUNAR_RENAMER_PROGRESS (user_data)->next_idle_id = -1; + THUNAR_RENAMER_PROGRESS (user_data)->next_idle_id = 0; } @@ -337,7 +335,8 @@ thunar_renamer_progress_run (ThunarRenamerProgress *renamer_progress, _thunar_return_if_fail (THUNAR_IS_RENAMER_PROGRESS (renamer_progress)); /* make sure we're not already renaming */ - if (G_UNLIKELY (renamer_progress->next_idle_id >= 0 || renamer_progress->next_idle_loop != NULL)) + if (G_UNLIKELY (renamer_progress->next_idle_id != 0 + || renamer_progress->next_idle_loop != NULL)) return; /* take an additional reference on the progress */ @@ -362,7 +361,7 @@ thunar_renamer_progress_run (ThunarRenamerProgress *renamer_progress, renamer_progress->next_idle_loop = NULL; /* be sure to cancel any pending idle source */ - if (G_UNLIKELY (renamer_progress->next_idle_id >= 0)) + if (G_UNLIKELY (renamer_progress->next_idle_id != 0)) g_source_remove (renamer_progress->next_idle_id); /* release the list of completed items */ diff --git a/thunar/thunar-text-renderer.c b/thunar/thunar-text-renderer.c index 997264141d61779a474135d75709e279552e47c4..ee12286e91a3cc0dbbcc44c42a494a7ed3dc0c72 100644 --- a/thunar/thunar-text-renderer.c +++ b/thunar/thunar-text-renderer.c @@ -137,7 +137,7 @@ struct _ThunarTextRenderer /* cell editing support */ GtkWidget *entry; gboolean entry_menu_active; - gint entry_menu_popdown_timer_id; + guint entry_menu_popdown_timer_id; }; @@ -279,7 +279,6 @@ static void thunar_text_renderer_init (ThunarTextRenderer *text_renderer) { text_renderer->wrap_width = -1; - text_renderer->entry_menu_popdown_timer_id = -1; text_renderer->alignment = PANGO_ALIGN_LEFT; } @@ -794,7 +793,7 @@ thunar_text_renderer_populate_popup (GtkEntry *entry, GtkMenu *menu, ThunarTextRenderer *text_renderer) { - if (G_UNLIKELY (text_renderer->entry_menu_popdown_timer_id >= 0)) + if (G_UNLIKELY (text_renderer->entry_menu_popdown_timer_id != 0)) g_source_remove (text_renderer->entry_menu_popdown_timer_id); text_renderer->entry_menu_active = TRUE; @@ -810,7 +809,7 @@ thunar_text_renderer_popup_unmap (GtkMenu *menu, { text_renderer->entry_menu_active = FALSE; - if (G_LIKELY (text_renderer->entry_menu_popdown_timer_id < 0)) + if (G_LIKELY (text_renderer->entry_menu_popdown_timer_id == 0)) { text_renderer->entry_menu_popdown_timer_id = g_timeout_add_full (G_PRIORITY_LOW, 500u, thunar_text_renderer_entry_menu_popdown_timer, text_renderer, thunar_text_renderer_entry_menu_popdown_timer_destroy); @@ -840,7 +839,7 @@ thunar_text_renderer_entry_menu_popdown_timer (gpointer user_data) static void thunar_text_renderer_entry_menu_popdown_timer_destroy (gpointer user_data) { - THUNAR_TEXT_RENDERER (user_data)->entry_menu_popdown_timer_id = -1; + THUNAR_TEXT_RENDERER (user_data)->entry_menu_popdown_timer_id = 0; } diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 72428d584e71f2f54eff98571c2f3bd48430af5a..0d877115ba5aab42ff4bbf78633cfc63da10a4e6 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -241,13 +241,13 @@ struct _ThunarTreeView gulong queue_resize_signal_id; /* set cursor to current directory idle source */ - gint cursor_idle_id; + guint cursor_idle_id; /* autoscroll during drag timer source */ - gint drag_scroll_timer_id; + guint drag_scroll_timer_id; /* expand drag dest row timer source */ - gint expand_timer_id; + guint expand_timer_id; }; enum @@ -374,11 +374,6 @@ thunar_tree_view_init (ThunarTreeView *view) GtkTreeSelection *selection; GtkCellRenderer *renderer; - /* initialize the view internals */ - view->cursor_idle_id = -1; - view->drag_scroll_timer_id = -1; - view->expand_timer_id = -1; - /* grab a reference on the provider factory */ view->provider_factory = thunarx_provider_factory_get_default (); @@ -459,15 +454,15 @@ thunar_tree_view_finalize (GObject *object) g_signal_handler_disconnect (G_OBJECT (view->preferences), view->queue_resize_signal_id); /* be sure to cancel the cursor idle source */ - if (G_UNLIKELY (view->cursor_idle_id >= 0)) + if (G_UNLIKELY (view->cursor_idle_id != 0)) g_source_remove (view->cursor_idle_id); /* cancel any running autoscroll timer */ - if (G_LIKELY (view->drag_scroll_timer_id >= 0)) + if (G_LIKELY (view->drag_scroll_timer_id != 0)) g_source_remove (view->drag_scroll_timer_id); /* be sure to cancel the expand timer source */ - if (G_UNLIKELY (view->expand_timer_id >= 0)) + if (G_UNLIKELY (view->expand_timer_id != 0)) g_source_remove (view->expand_timer_id); /* reset the current-directory property */ @@ -631,7 +626,7 @@ thunar_tree_view_set_current_directory (ThunarNavigator *navigator, } /* schedule an idle source to set the cursor to the current directory */ - if (G_LIKELY (view->cursor_idle_id < 0)) + if (G_LIKELY (view->cursor_idle_id == 0)) view->cursor_idle_id = g_idle_add_full (G_PRIORITY_LOW, thunar_tree_view_cursor_idle, view, thunar_tree_view_cursor_idle_destroy); /* drop any existing "new-files" closure */ @@ -903,7 +898,7 @@ thunar_tree_view_drag_motion (GtkWidget *widget, } /* start the drag autoscroll timer if not already running */ - if (G_UNLIKELY (view->drag_scroll_timer_id < 0)) + if (G_UNLIKELY (view->drag_scroll_timer_id == 0)) { /* schedule the drag autoscroll timer */ view->drag_scroll_timer_id = g_timeout_add_full (G_PRIORITY_LOW, 50, thunar_tree_view_drag_scroll_timer, @@ -923,7 +918,7 @@ thunar_tree_view_drag_leave (GtkWidget *widget, ThunarTreeView *view = THUNAR_TREE_VIEW (widget); /* cancel any running autoscroll timer */ - if (G_LIKELY (view->drag_scroll_timer_id >= 0)) + if (G_LIKELY (view->drag_scroll_timer_id != 0)) g_source_remove (view->drag_scroll_timer_id); /* reset the "drop-file" of the icon renderer */ @@ -1036,7 +1031,7 @@ thunar_tree_view_test_expand_row (GtkTreeView *tree_view, } /* cancel the cursor idle source if not expandable */ - if (!expandable && view->cursor_idle_id >= 0) + if (!expandable && view->cursor_idle_id != 0) g_source_remove (view->cursor_idle_id); return !expandable; @@ -1399,7 +1394,7 @@ thunar_tree_view_get_dest_actions (ThunarTreeView *view, ThunarFile *file = NULL; /* cancel any previously active expand timer */ - if (G_LIKELY (view->expand_timer_id >= 0)) + if (G_LIKELY (view->expand_timer_id != 0)) g_source_remove (view->expand_timer_id); /* determine the path for x/y */ @@ -2429,7 +2424,7 @@ thunar_tree_view_cursor_idle (gpointer user_data) static void thunar_tree_view_cursor_idle_destroy (gpointer user_data) { - THUNAR_TREE_VIEW (user_data)->cursor_idle_id = -1; + THUNAR_TREE_VIEW (user_data)->cursor_idle_id = 0; } @@ -2479,7 +2474,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data) * if a path is expanded while scrolling through the view. * reschedule it if the drag dest path is still visible. */ - if (G_UNLIKELY (view->expand_timer_id >= 0)) + if (G_UNLIKELY (view->expand_timer_id != 0)) { /* drop the current expand timer source */ g_source_remove (view->expand_timer_id); @@ -2523,7 +2518,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data) static void thunar_tree_view_drag_scroll_timer_destroy (gpointer user_data) { - THUNAR_TREE_VIEW (user_data)->drag_scroll_timer_id = -1; + THUNAR_TREE_VIEW (user_data)->drag_scroll_timer_id = 0; } @@ -2537,7 +2532,7 @@ thunar_tree_view_expand_timer (gpointer user_data) GDK_THREADS_ENTER (); /* cancel the drag autoscroll timer when expanding a row */ - if (G_UNLIKELY (view->drag_scroll_timer_id >= 0)) + if (G_UNLIKELY (view->drag_scroll_timer_id != 0)) g_source_remove (view->drag_scroll_timer_id); /* determine the drag dest row */ @@ -2559,7 +2554,7 @@ thunar_tree_view_expand_timer (gpointer user_data) static void thunar_tree_view_expand_timer_destroy (gpointer user_data) { - THUNAR_TREE_VIEW (user_data)->expand_timer_id = -1; + THUNAR_TREE_VIEW (user_data)->expand_timer_id = 0; } diff --git a/thunar/thunar-user.c b/thunar/thunar-user.c index 184e57564f523bf2fa5ecae165fef7f9d9285ea7..059cca91533113d5469c54ea76a6625286a8b647 100644 --- a/thunar/thunar-user.c +++ b/thunar/thunar-user.c @@ -484,7 +484,7 @@ struct _ThunarUserManager GHashTable *groups; GHashTable *users; - gint flush_timer_id; + guint flush_timer_id; }; @@ -534,7 +534,7 @@ thunar_user_manager_finalize (GObject *object) ThunarUserManager *manager = THUNAR_USER_MANAGER (object); /* stop the flush timer */ - if (G_LIKELY (manager->flush_timer_id >= 0)) + if (G_LIKELY (manager->flush_timer_id != 0)) g_source_remove (manager->flush_timer_id); /* destroy the hash tables */ @@ -591,7 +591,7 @@ thunar_user_manager_flush_timer (gpointer user_data) static void thunar_user_manager_flush_timer_destroy (gpointer user_data) { - THUNAR_USER_MANAGER (user_data)->flush_timer_id = -1; + THUNAR_USER_MANAGER (user_data)->flush_timer_id = 0; } diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 8925f92390299f1a0e9f2688ce51086066b22854..a2bd3c0eec29921726f9f33175e1e2c605d09b59 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -318,10 +318,10 @@ struct _ThunarWindow ThunarZoomLevel zoom_level; /* menu merge idle source */ - gint merge_idle_id; + guint merge_idle_id; /* support to remember window geometry */ - gint save_geometry_timer_id; + guint save_geometry_timer_id; /* support to toggle side pane using F9, * see the toggle_sidepane() function. @@ -1009,11 +1009,11 @@ thunar_window_dispose (GObject *object) ThunarWindow *window = THUNAR_WINDOW (object); /* destroy the save geometry timer source */ - if (G_UNLIKELY (window->save_geometry_timer_id > 0)) + if (G_UNLIKELY (window->save_geometry_timer_id != 0)) g_source_remove (window->save_geometry_timer_id); /* destroy the merge idle source */ - if (G_UNLIKELY (window->merge_idle_id > 0)) + if (G_UNLIKELY (window->merge_idle_id != 0)) g_source_remove (window->merge_idle_id); /* un-merge the custom preferences */ @@ -1367,7 +1367,7 @@ thunar_window_configure_event (GtkWidget *widget, if (widget->allocation.width != event->width || widget->allocation.height != event->height) { /* drop any previous timer source */ - if (window->save_geometry_timer_id > 0) + if (window->save_geometry_timer_id != 0) g_source_remove (window->save_geometry_timer_id); /* check if we should schedule another save timer */ diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c index 1b5d2a3ed96784e296fadcd1d236db306ea4f66d..6d141033fe86822b0be3399d1b83e8da442403c4 100644 --- a/thunarx/thunarx-provider-factory.c +++ b/thunarx/thunarx-provider-factory.c @@ -63,7 +63,7 @@ struct _ThunarxProviderFactory ThunarxProviderInfo *infos; /* provider types and cached provider references */ gint n_infos; /* number of items in the infos array */ - gint timer_id; /* GSource timer to cleanup cached providers */ + guint timer_id; /* GSource timer to cleanup cached providers */ }; @@ -101,7 +101,7 @@ thunarx_provider_factory_finalize (GObject *object) gint n; /* stop the "provider cache" cleanup timer */ - if (G_LIKELY (factory->timer_id > 0)) + if (G_LIKELY (factory->timer_id != 0)) g_source_remove (factory->timer_id); /* release provider infos */