Remove dead code
authorColin Clark <colin.clark@cclark.uk>
Thu, 20 Jul 2023 08:42:57 +0000 (09:42 +0100)
committerColin Clark <colin.clark@cclark.uk>
Thu, 20 Jul 2023 08:42:57 +0000 (09:42 +0100)
Dead code found with:
ag '//.*;' src/

24 files changed:
src/bar-exif.cc
src/bar-keywords.cc
src/bar.cc
src/collect-table.cc
src/editors.cc
src/exiv2.cc
src/image-load-ffmpegthumbnailer.cc
src/image-load-jpeg.cc
src/image-load.cc
src/image.cc
src/layout-image.cc
src/layout-util.cc
src/layout-util.h
src/layout.cc
src/pan-view/pan-view-filter.cc
src/pixbuf-renderer.cc
src/pixbuf-renderer.h
src/rcfile.cc
src/remote.cc
src/renderer-tiles.cc
src/trash.cc
src/typedefs.h
src/ui-tree-edit.h
src/utilops.cc

index bf1d449..bcf6378 100644 (file)
@@ -141,9 +141,7 @@ static void bar_pane_exif_setup_entry_box(PaneExifData *ped, ExifEntry *ee)
        else
                {
                ee->value_widget = gtk_label_new(nullptr);
-//             gtk_label_set_width_chars(GTK_LABEL(ee->value_widget), 20);
                gtk_label_set_ellipsize(GTK_LABEL(ee->value_widget), PANGO_ELLIPSIZE_END);
-//             gtk_widget_set_size_request(ee->value_widget, 100, -1);
                gtk_label_set_xalign(GTK_LABEL(ee->value_widget), 0.0);
                gtk_label_set_yalign(GTK_LABEL(ee->value_widget), 0.5);
                }
index 2c94f93..7adb15a 100644 (file)
@@ -1568,8 +1568,6 @@ static GtkWidget *bar_pane_keywords_new(const gchar *id, const gchar *title, con
 
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(pkd->keyword_treeview), FALSE);
 
-//     gtk_tree_view_set_search_column(GTK_TREE_VIEW(pkd->keyword_treeview), FILTER_KEYWORD_COLUMN_);
-
        column = gtk_tree_view_column_new();
        gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
 
index b1d0609..28e2542 100644 (file)
@@ -847,8 +847,9 @@ GtkWidget *bar_pane_expander_title(const gchar *title)
        GtkWidget *widget = gtk_label_new(title);
 
        pref_label_bold(widget, TRUE, FALSE);
-       //gtk_label_set_ellipsize(GTK_LABEL(widget), PANGO_ELLIPSIZE_END);
-       /** @FIXME do not work */
+       /** @FIXME do not work
+        * gtk_label_set_ellipsize(GTK_LABEL(widget), PANGO_ELLIPSIZE_END);
+       */
 
        return widget;
 }
index 99def0d..3edad28 100644 (file)
@@ -1534,8 +1534,9 @@ static void collection_table_insert_marker(CollectTable *ct, CollectInfo *info,
                cairo_t *cr = cairo_create(img);
                gdk_cairo_set_source_pixbuf(cr, pb, 0, 0);
                cairo_paint(cr);
-               /** @FIXME this is a hack to get the background color */
-               //~ pattern = cairo_pattern_create_for_surface(img);
+               /** @FIXME this is a hack to get the background color
+                * pattern = cairo_pattern_create_for_surface(img);
+                */
                pattern = cairo_pattern_create_rgb (1.0, 0.0, 0.0);
                mask = gdk_cairo_region_create_from_surface(img);
                gdk_window_shape_combine_region(ct->marker_window, mask, 0, 0);
index 8cb6119..4290182 100644 (file)
@@ -588,8 +588,7 @@ static EditorVerboseData *editor_verbose_window(EditorData *ed, const gchar *tex
        buf = g_strdup_printf(_("Output of %s"), text);
        generic_dialog_add_message(vd->gd, nullptr, buf, nullptr, FALSE);
        g_free(buf);
-       //~ vd->button_stop = generic_dialog_add_button(vd->gd, GTK_STOCK_STOP, NULL,
-                                                  //~ editor_verbose_window_stop, FALSE);
+
        vd->button_stop = generic_dialog_add_button(vd->gd, "process-stop", nullptr,
                                                   editor_verbose_window_stop, FALSE);
        gtk_widget_set_sensitive(vd->button_stop, FALSE);
index 00b7f76..a6402f1 100644 (file)
@@ -188,7 +188,6 @@ public:
                try
                        {
                        image_ = Exiv2::ImageFactory::open(pathl_);
-//                     g_assert (image.get() != 0);
                        image_->readMetadata();
 
 #if EXIV2_TEST_VERSION(0,16,0)
@@ -712,7 +711,6 @@ char *exif_item_get_description(ExifItem *item)
                return utf8_validate_or_convert((reinterpret_cast<Exiv2::Metadatum *>(item))->tagLabel().c_str());
        }
        catch (std::exception& e) {
-//             debug_exception(e);
                return nullptr;
        }
 }
index eeb59ce..f7500b9 100644 (file)
@@ -148,11 +148,11 @@ static gboolean image_loader_ft_load (gpointer loader, const guchar *UNUSED(buf)
                return FALSE;
                }
 
-/* See comment in image_loader_area_prepared_cb
+/** See comment in image_loader_area_prepared_cb
  * Geeqie uses area_prepared signal to fill pixbuf with background color.
- * We can't do it here as pixbuf already contains the data */
-//     lft->area_prepared_cb(loader, lft->data);
-
+ * We can't do it here as pixbuf already contains the data
+ * lft->area_prepared_cb(loader, lft->data);
+ */
        lft->area_updated_cb(loader, 0, 0, gdk_pixbuf_get_width(lft->pixbuf), gdk_pixbuf_get_height(lft->pixbuf), lft->data);
 
        return TRUE;
index 62bb312..708e978 100644 (file)
@@ -269,7 +269,6 @@ static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsiz
        struct error_handler_data jerr;
 
        lj->stereo = FALSE;
-//     DEBUG_1("TG: JPG requested size w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
 
        MPOData *mpo = jpeg_get_mpo_data(buf, count);
        if (mpo && mpo->num_images > 1)
@@ -350,7 +349,6 @@ static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsiz
 
        lj->requested_width = lj->stereo ? cinfo.image_width * 2: cinfo.image_width;
        lj->requested_height = cinfo.image_height;
-//     DEBUG_1("TG: JPG requested size v2 w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
        lj->size_cb(loader, lj->requested_width, lj->requested_height, lj->data);
 
        cinfo.scale_num = 1;
index b6619d8..d8c908b 100644 (file)
@@ -155,9 +155,6 @@ static void image_loader_class_init(ImageLoaderClass *loader_class)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (loader_class);
 
-//     gobject_class->set_property = image_loader_set_property;
-//     gobject_class->get_property = image_loader_get_property;
-
        gobject_class->finalize = image_loader_finalize;
 
 
index 853211d..15a969b 100644 (file)
@@ -832,7 +832,6 @@ static gint image_cache_get(ImageWindow *imd)
                image_change_pixbuf(imd, imd->image_fd->pixbuf, image_zoom_get(imd), FALSE);
                }
 
-//     file_cache_dump(image_get_cache());
        return success;
 }
 
@@ -925,8 +924,6 @@ static void image_load_done_cb(ImageLoader *UNUSED(il), gpointer data)
        image_loader_free(imd->il);
        imd->il = nullptr;
 
-//     image_post_process(imd, TRUE);
-
        image_read_ahead_start(imd);
 }
 
@@ -1004,7 +1001,6 @@ static gboolean image_read_ahead_check(ImageWindow *imd)
                file_data_unref(imd->read_ahead_fd);
                imd->read_ahead_fd = nullptr;
 
-//             image_post_process(imd, FALSE);
                return TRUE;
                }
 
index bb217cf..d848661 100644 (file)
@@ -2226,7 +2226,6 @@ void layout_image_activate(LayoutWindow *lw, gint i, gboolean force)
 
        if (fd)
                {
-//             layout_list_sync_path(lw, path);
                layout_set_fd(lw, fd);
                }
        layout_status_update_image(lw);
index f83987c..ffd495a 100644 (file)
@@ -3881,7 +3881,6 @@ void layout_util_sync(LayoutWindow *lw)
        layout_util_sync_views(lw);
        layout_util_sync_thumb(lw);
        layout_menu_recent_update(lw);
-//     layout_menu_edit_update(lw);
 }
 
 /**
@@ -3973,8 +3972,6 @@ void layout_bar_set(LayoutWindow *lw, GtkWidget *bar)
        g_signal_connect(G_OBJECT(lw->bar), "destroy",
                         G_CALLBACK(layout_bar_destroyed), lw);
 
-
-//     gtk_box_pack_start(GTK_BOX(lw->utility_box), lw->bar, FALSE, FALSE, 0);
        gtk_paned_pack2(GTK_PANED(lw->utility_paned), lw->bar, FALSE, TRUE);
 
        bar_set_fd(lw->bar, layout_image_get_fd(lw));
index 7468d7e..faa7b15 100644 (file)
@@ -36,8 +36,6 @@ void layout_util_sync(LayoutWindow *lw);
 void layout_util_status_update_write(LayoutWindow *lw);
 void layout_util_status_update_write_all();
 
-//void layout_edit_update_all(void);
-
 void layout_recent_update_all();
 void layout_recent_add_path(const gchar *path);
 
index f60b621..e6d31d5 100644 (file)
@@ -2389,8 +2389,6 @@ void layout_sync_options_with_current_state(LayoutWindow *lw)
 
        layout_geometry_get_dividers(lw, &lw->options.main_window.hdivider_pos, &lw->options.main_window.vdivider_pos);
 
-//     layout_sort_get(NULL, &options->file_sort.method, &options->file_sort.ascending);
-
        layout_geometry_get_tools(lw, &lw->options.float_window.x, &lw->options.float_window.y,
                                  &lw->options.float_window.w, &lw->options.float_window.h, &lw->options.float_window.vdivider_pos);
 
@@ -2567,10 +2565,6 @@ LayoutWindow *layout_new_with_geometry(FileData *dir_fd, LayoutOptions *lop,
        lw->sort_ascend = TRUE;
 
        layout_set_unique_id(lw);
-//     lw->options.tools_float = popped;
-//     lw->options.tools_hidden = hidden;
-//     lw->bar_sort_enabled = options->panels.sort.enabled;
-//     lw->bar_enabled = options->panels.info.enabled;
 
        /* default layout */
 
index cd95fdd..d74be2c 100644 (file)
@@ -81,8 +81,6 @@ PanViewFilterUi *pan_filter_ui_new(PanWindow *pw)
        gtk_widget_show(combo);
 
        ui->filter_label = gtk_label_new("");/** @todo (xsdg): Figure out whether it's useful to keep this label around. */
-       //gtk_box_pack_start(GTK_BOX(hbox), ui->filter_label, FALSE, FALSE, 0);
-       //gtk_widget_show(ui->filter_label);
 
        ui->filter_kw_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
        gtk_box_pack_start(GTK_BOX(hbox), ui->filter_kw_hbox, TRUE, TRUE, 0);
@@ -127,9 +125,6 @@ void pan_filter_ui_destroy(PanViewFilterUi **ui_ptr)
 {
        if (ui_ptr == nullptr || *ui_ptr == nullptr) return;
 
-       // Note that g_clear_pointer handles already-NULL pointers.
-       //g_clear_pointer(&(*ui_ptr)->filter_kw_table, g_hash_table_destroy);
-
        g_free(*ui_ptr);
        *ui_ptr = nullptr;
 }
index 183c6e3..9c2ab42 100644 (file)
@@ -517,7 +517,6 @@ static void pixbuf_renderer_set_property(GObject *object, guint prop_id,
                        pr->complete = g_value_get_boolean(value);
                        break;
                case PROP_CACHE_SIZE_DISPLAY:
-//                     pr->tile_cache_max = g_value_get_uint(value);
                        break;
                case PROP_CACHE_SIZE_TILES:
                        pr->source_tiles_cache_size = g_value_get_uint(value);
@@ -583,7 +582,6 @@ static void pixbuf_renderer_get_property(GObject *object, guint prop_id,
                        g_value_set_boolean(value, pr->complete);
                        break;
                case PROP_CACHE_SIZE_DISPLAY:
-//                     g_value_set_uint(value, pr->tile_cache_max);
                        break;
                case PROP_CACHE_SIZE_TILES:
                        g_value_set_uint(value, pr->source_tiles_cache_size);
@@ -988,10 +986,6 @@ static gboolean pr_source_tile_visible(PixbufRenderer *pr, SourceTile *st)
 
        if (!st) return FALSE;
 
-//     x1 = ROUND_DOWN(pr->x_scroll, pr->tile_width);
-//     y1 = ROUND_DOWN(pr->y_scroll, pr->tile_height);
-//     x2 = ROUND_UP(pr->x_scroll + pr->vis_width, pr->tile_width);
-//     y2 = ROUND_UP(pr->y_scroll + pr->vis_height, pr->tile_height);
        x1 = pr->x_scroll;
        y1 = pr->y_scroll;
        x2 = pr->x_scroll + pr->vis_width;
@@ -1428,7 +1422,6 @@ void pr_tile_coords_map_orientation(gint orientation,
                        /* The other values are out of range */
                        break;
                }
-//     log_printf("tile coord y:%f, ih:%d, th:%f ry:%f\n", tile_y, image_h, tile_h, *res_x);
 }
 
 void pr_tile_region_map_orientation(gint orientation,
@@ -1491,7 +1484,6 @@ void pr_tile_region_map_orientation(gint orientation,
                        /* The other values are out of range */
                        break;
                }
-//     log_printf("inside y:%d, th:%d, ah:%d ry:%d\n", area_y, tile_h, area_h, *res_x);
 }
 
 void pr_coords_map_orientation_reverse(gint orientation,
@@ -3020,12 +3012,6 @@ void pixbuf_renderer_set_size_early(PixbufRenderer *UNUSED(pr), guint UNUSED(wid
        pr->image_height = height;
 
        pr_zoom_clamp(pr, zoom, PR_ZOOM_FORCE, NULL);
-
-       //w = width;
-       //h = height;
-
-       //pr->width = width;
-       //pr->height = height;
 #endif
 }
 
index b7d2aa4..9d62a5f 100644 (file)
@@ -93,8 +93,6 @@ enum OverlayRendererFlags {
 
 struct RendererFuncs
 {
-//     void (*redraw)(void *renderer, gint x, gint y, gint w, gint h,
-  //                   gint clamp, ImageRenderType render, gboolean new_data, gboolean only_existing);
     void (*area_changed)(void *renderer, gint src_x, gint src_y, gint src_w, gint src_h); /**< pixbuf area changed */
        void (*invalidate_region)(void *renderer, gint x, gint y, gint w, gint h);
        void (*scroll)(void *renderer, gint x_off, gint y_off); /**< scroll */
@@ -333,13 +331,6 @@ gboolean pixbuf_renderer_get_scaled_size(PixbufRenderer *pr, gint *width, gint *
  */
 gboolean pixbuf_renderer_get_visible_rect(PixbufRenderer *pr, GdkRectangle *rect);
 
-/**
- * @headerfile pixbuf_renderer_get_virtual_rect
- * actual size of the PixbufRenderer window minus borders,
- * x and y are the scroll offset and include zoom factor.
- */
-//gboolean pixbuf_renderer_get_virtual_rect(PixbufRenderer *pr, GdkRectangle *rect);
-
 /**
  * @headerfile pixbuf_renderer_set_color
  *  background color
index ef94a09..219b563 100644 (file)
@@ -1608,8 +1608,6 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext
 static void options_parse_layout_end(GQParserData *UNUSED(parser_data), GMarkupParseContext *UNUSED(context), const gchar *UNUSED(element_name), gpointer data, GError **UNUSED(error))
 {
        auto lw = static_cast<LayoutWindow *>(data);
-       //~ LayoutWindow *lw = (LayoutWindow *)data;
-       //~ LayoutWindow *lw = data;
        layout_util_sync(lw);
 }
 
index e0c2547..7c65936 100644 (file)
@@ -529,7 +529,7 @@ static void gr_slideshow_start_rec(const gchar *text, GIOChannel *UNUSED(channel
        list = filelist_recursive_full(dir_fd, lw_id->sort_method, lw_id->sort_ascend);
        file_data_unref(dir_fd);
        if (!list) return;
-//printf("length: %d\n", g_list_length(list));
+
        layout_image_slideshow_stop(lw_id);
        layout_image_slideshow_start_from_list(lw_id, list);
 }
index 924dfb8..20b804e 100644 (file)
@@ -475,10 +475,6 @@ static ImageTile *rt_tile_get(RendererTiles *rt, gint x, gint y, gboolean only_e
 
 static gint pixmap_calc_size(cairo_surface_t *UNUSED(surface))
 {
-//     gint w, h, d;
-
-//     d = gdk_drawable_get_depth(pixmap);
-//     gdk_drawable_get_size(pixmap, &w, &h);
        return options->image.tile_size * options->image.tile_size * 4 / 8;
 }
 
@@ -1503,8 +1499,6 @@ static void rt_tile_expose(RendererTiles *rt, ImageTile *it,
                           gboolean new_data, gboolean fast)
 {
        PixbufRenderer *pr = rt->pr;
-       //~ GtkWidget *box;
-       //~ GdkWindow *window;
        cairo_t *cr;
 
        /* clamp to visible */
@@ -1531,9 +1525,6 @@ static void rt_tile_expose(RendererTiles *rt, ImageTile *it,
 
        rt_tile_render(rt, it, x, y, w, h, new_data, fast);
 
-       //~ box = GTK_WIDGET(pr);
-       //~ window = gtk_widget_get_window(box);
-
        cr = cairo_create(rt->surface);
        cairo_set_source_surface(cr, it->surface, pr->x_offset + (it->x - rt->x_scroll) + rt->stereo_off_x, pr->y_offset + (it->y - rt->y_scroll) + rt->stereo_off_y);
        cairo_rectangle (cr, pr->x_offset + (it->x - rt->x_scroll) + x + rt->stereo_off_x, pr->y_offset + (it->y - rt->y_scroll) + y + rt->stereo_off_y, w, h);
index 054dd9b..25f388a 100644 (file)
@@ -199,7 +199,6 @@ gboolean file_util_safe_unlink(const gchar *path)
                        g_error_free(error);
 
                        /* A second warning dialog is not necessary */
-                       // success = FALSE;
                        }
        }
 
index 3aa02f1..53dadae 100644 (file)
@@ -822,18 +822,11 @@ struct LayoutWindow
        GtkWidget *tools;
        GtkWidget *tools_pane;
 
-//     gint tools_float;
-//     gint tools_hidden;
        GtkWidget *menu_tool_bar; /**< Combined menu and toolbar box */
        GtkWidget *menu_bar; /**< referenced by lw, exist during whole lw lifetime */
        /* toolbar */
 
        GtkWidget *toolbar[TOOLBAR_COUNT]; /**< referenced by lw, exist during whole lw lifetime */
-//     gint toolbar_hidden;
-
-//     GtkWidget *thumb_button;
-//     gint thumbs_enabled;
-//     gint marks_enabled;
 
        GtkWidget *back_button;
 
@@ -844,14 +837,11 @@ struct LayoutWindow
        ViewDir *vd;
        GtkWidget *dir_view;
 
-//     DirViewType dir_view_type;
-
        /* file view */
 
        LayoutLocation file_location;
 
        ViewFile *vf;
-//     FileViewType file_view_type;
 
        GtkWidget *file_view;
 
@@ -874,12 +864,6 @@ struct LayoutWindow
 
        FullScreenData *full_screen;
 
-       /* dividers */
-
-//     gint div_h;
-//     gint div_v;
-//     gint div_float;
-
        /* misc */
 
        GtkWidget *utility_box; /**< referenced by lw, exist during whole lw lifetime */
@@ -888,9 +872,6 @@ struct LayoutWindow
        GtkWidget *bar;
 
        gboolean bar_sort_enabled; /**< Set during start-up, and checked when the editors have loaded */
-//     gint bar_enabled;
-
-//     gint bar_width;
 
        GtkWidget *exif_window;
        GtkWidget *sar_window; /**< Search and Run window */
index f9fb4b3..20e52eb 100644 (file)
@@ -83,13 +83,6 @@ gint tree_view_row_make_visible(GtkTreeView *widget, GtkTreeIter *iter, gboolean
  */
 gboolean tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gboolean only_selected);
 
-/**
- * @headerfile tree_path_to_row
- * utility to return row position of given GtkTreePath
- */
-//gint tree_path_to_row(GtkTreePath *tpath);
-
-
 /**
  * @headerfile shift_color
  * shifts a GdkColor values lighter or darker \n
@@ -98,15 +91,6 @@ gboolean tree_view_move_cursor_away(GtkTreeView *widget, GtkTreeIter *iter, gboo
  */
 void shift_color(GdkColor *src, gshort val, gint direction);
 
-/**
- * @headerfile style_shift_color
- * Shifts a style's color for given state
- * Useful for alternating dark/light rows in lists. \n
- *
- * shift_value is 1 to 100, representing the percent of the shift.
- */
-//void style_shift_color(GtkStyle *style, GtkStateType type, gshort shift_value, gint direction);
-
 /**
  * @def STYLE_SHIFT_STANDARD
  * The standard shift percent for alternating list row colors
index 806afbd..ba848cd 100644 (file)
@@ -1681,10 +1681,6 @@ static void file_util_dialog_init_source_dest(UtilityData *ud, gboolean second_i
        gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_SINGLE);
        gtk_tree_selection_set_select_function(selection, file_util_preview_cb, ud, nullptr);
 
-
-//     column = file_util_rename_multiple_add_column(rd, _("Preview"), RENAME_COLUMN_PREVIEW);
-//     gtk_tree_view_column_set_visible(column, FALSE);
-
        gtk_tree_view_set_reorderable(GTK_TREE_VIEW(ud->listview), TRUE);
 
        store = gtk_tree_view_get_model(GTK_TREE_VIEW(ud->listview));
@@ -1701,7 +1697,6 @@ static void file_util_dialog_init_source_dest(UtilityData *ud, gboolean second_i
                generic_dialog_add_image(ud->gd, box, nullptr, nullptr, FALSE, nullptr, nullptr, FALSE);
                }
 
-//     gtk_container_add(GTK_CONTAINER(scrolled), view);
        gtk_widget_show(ud->gd->dialog);
 
 
@@ -1785,8 +1780,6 @@ static void file_util_dialog_init_source_dest(UtilityData *ud, gboolean second_i
                                        0.0, 1000000.0, 1.0, 0, options->cp_mv_rn.formatted_start,
                                        G_CALLBACK(file_util_rename_preview_adj_cb), ud);
 
-//     gtk_combo_box_set_active(GTK_COMBO_BOX(ud->combo_type), 0); /* callback will take care of the rest */
-
        file_util_dialog_list_select(ud->listview, 0);
 }
 
@@ -2873,8 +2866,6 @@ static void file_util_rename_dir_full(FileData *fd, const gchar *new_path, GtkWi
                return;
                }
 
-//     ud->flist = filelist_recursive(fd);
-
        file_util_dialog_run(ud);
 }