One can now enable debug mode without restarting geeqie.
A possibility to disable all debugging code and related options
at compile time was added.
#include "format_nikon.h"
#include "format_olympus.h"
-
+#ifdef DEBUG
/* so that debugging is honored */
extern gint debug;
-
+#endif
typedef struct _FormatRawEntry FormatRawEntry;
struct _FormatRawEntry {
gint dupe_custom_threshold = 99;
+#ifdef DEBUG
gint debug = FALSE;
+#endif
/* layout */
gchar *layout_order = NULL;
#define DEFAULT_THUMB_WIDTH 96
#define DEFAULT_THUMB_HEIGHT 72
+#if 1 /* set to 0 to disable debugging code and related options */
+# ifndef DEBUG
+# define DEBUG 1
+# endif
+#endif
+#ifndef DEBUG
+# define debug 0
+#endif
#include "typedefs.h"
extern gint dupe_custom_threshold;
+#ifdef DEBUG
extern gint debug;
+#endif
extern gint recent_list_max;
parse_command_line_process_file(cmd_all, path, file,
&list, collection_list, &first_dir);
}
+#ifdef DEBUG
else if (strcmp(cmd_line, "--debug") == 0)
{
/* we now increment the debug state for verbosity */
debug++;
printf("debugging output enabled (level %d)\n", debug);
}
+#endif
else if (strcmp(cmd_line, "+t") == 0 ||
strcmp(cmd_line, "--with-tools") == 0)
{
print_term(_(" --geometry=GEOMETRY set main window location\n"));
print_term(_(" -r, --remote send following commands to open window\n"));
print_term(_(" -rh,--remote-help print remote command list\n"));
+#ifdef DEBUG
print_term(_(" --debug turn on debug output\n"));
+#endif
print_term(_(" -v, --version print version info\n"));
print_term(_(" -h, --help show this message\n\n"));
static gint dupe_custom_threshold_c;
+#ifdef DEBUG
+static gint debug_c;
+#endif
+
static GtkWidget *configwindow = NULL;
static GtkWidget *startup_path_entry;
static GtkListStore *filter_store = NULL;
dupe_custom_threshold = dupe_custom_threshold_c;
tree_descend_subdirs = tree_descend_subdirs_c;
+#ifdef DEBUG
+ debug = debug_c;
+#endif
#ifdef HAVE_LCMS
for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
GTK_FILL | GTK_EXPAND, 0, 0, 0);
gtk_widget_show(tabcomp);
+#ifdef DEBUG
+ group = pref_group_new(vbox, FALSE, _("Debugging"), GTK_ORIENTATION_VERTICAL);
+
+ pref_spin_new_int(group, _("Debug level:"), NULL,
+ 0, 9, 1, debug, &debug_c);
+#endif
+
gtk_widget_show(notebook);
gtk_widget_show(configwindow);