From 6da4a4dfad17e033bfc19fc662ae055ce6f97804 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 30 Jul 2020 14:45:11 -0500 Subject: [PATCH] Fix or silence gtk warnings (#1380) * chore: disable deprecation warnings in GTK client Yes, updating the GTK codebase is still a goal. (help welcomed!) But there's a deluge of deprecation warnings that drown out other more important warnings, so turn off deprecation warnings for now. * fixup! chore: disable deprecation warnings in GTK client * fix: gtk_tree_sortable_set_sort_column_id caller. * fix: gtk_window_resize caller. --- gtk/CMakeLists.txt | 5 +++++ gtk/actions.c | 2 +- gtk/details.c | 4 +++- gtk/file-list.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index a7156fe2d..28b2589e8 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -166,6 +166,11 @@ target_link_libraries(${TR_NAME}-gtk ${EVENT2_LIBRARIES} ) +if(NOT MSVC) + # https://github.com/transmission/transmission/issues/1381 patches welcome + target_compile_options(${TR_NAME}-gtk PRIVATE -Wno-deprecated-declarations) +endif() + if(MSVC) tr_append_target_property(${TR_NAME}-gtk LINK_FLAGS "/ENTRY:mainCRTStartup") endif() diff --git a/gtk/actions.c b/gtk/actions.c index 03fbb7257..31f4d537b 100644 --- a/gtk/actions.c +++ b/gtk/actions.c @@ -95,7 +95,7 @@ static GtkActionEntry entries[] = { "pause-all-torrents", "media-playback-pause", N_("_Pause All"), NULL, N_("Pause all torrents"), G_CALLBACK(action_cb) }, { "start-all-torrents", "media-playback-start", N_("_Start All"), NULL, N_("Start all torrents"), G_CALLBACK(action_cb) }, { "relocate-torrent", NULL, N_("Set _Location…"), NULL, NULL, G_CALLBACK(action_cb) }, - { "remove-torrent", "list-remove", N_("Remove torrent"), "Delete", G_CALLBACK(action_cb) }, + { "remove-torrent", "list-remove", N_("Remove torrent"), "Delete", NULL, G_CALLBACK(action_cb) }, { "delete-torrent", "edit-delete", N_("_Delete Files and Remove"), "Delete", NULL, G_CALLBACK(action_cb) }, { "new-torrent", "document-new", N_("_New…"), NULL, N_("Create a torrent"), G_CALLBACK(action_cb) }, { "quit", "application-exit", N_("_Quit"), NULL, NULL, G_CALLBACK(action_cb) }, diff --git a/gtk/details.c b/gtk/details.c index c576a41d0..b64679c98 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -2949,7 +2949,9 @@ GtkWidget* gtr_torrent_details_dialog_new(GtkWindow* parent, TrCore* core) gtk_window_set_role(GTK_WINDOW(d), "tr-info"); /* return saved window size */ - gtk_window_resize(d, gtr_pref_int_get(TR_KEY_details_window_width), gtr_pref_int_get(TR_KEY_details_window_height)); + gtk_window_resize(GTK_WINDOW(d), + gtr_pref_int_get(TR_KEY_details_window_width), + gtr_pref_int_get(TR_KEY_details_window_height)); g_signal_connect(d, "size-allocate", G_CALLBACK(on_details_window_size_allocated), NULL); g_signal_connect_swapped(d, "response", G_CALLBACK(gtk_widget_destroy), d); diff --git a/gtk/file-list.c b/gtk/file-list.c index a58a3f366..3e74371f3 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -593,7 +593,7 @@ void gtr_file_list_set_torrent(GtkWidget* w, int torrentId) gtk_tree_view_set_model(GTK_TREE_VIEW(data->view), data->model); /* set default sort by label */ - gtk_tree_sortable_set_sort_column_id(data->model, FC_LABEL, GTK_SORT_ASCENDING); + gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(data->store), FC_LABEL, GTK_SORT_ASCENDING); gtk_tree_view_expand_all(GTK_TREE_VIEW(data->view)); g_object_unref(data->model);