aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFichteFoll <fichtefoll2@googlemail.com>2019-09-10 00:00:37 +0200
committerMichael Homer <mwh@ecs.vuw.ac.nz>2019-11-02 12:58:18 +1300
commitfd1b27c3954f5cb915f6a70bdaf27eac3548445a (patch)
treecc13531e2a3895bac8d03cf7f704062dc632ec04
parenturi_collection needs to hold one more item than max (diff)
downloaddragon-fd1b27c3954f5cb915f6a70bdaf27eac3548445a.tar.gz
dragon-fd1b27c3954f5cb915f6a70bdaf27eac3548445a.tar.bz2
dragon-fd1b27c3954f5cb915f6a70bdaf27eac3548445a.zip
Fix debug printing of URIs in drag_all mode
Printing all the URIs sent is not really informative, so just say "we sent them all".
-rw-r--r--dragon.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/dragon.c b/dragon.c
index debe087..3378ff1 100644
--- a/dragon.c
+++ b/dragon.c
@@ -84,23 +84,27 @@ void drag_data_get(GtkWidget *widget,
gpointer user_data) {
struct draggable_thing *dd = (struct draggable_thing *)user_data;
if (info == TARGET_TYPE_URI) {
- if (verbose)
- fprintf(stderr, "Writing as URI: %s\n", dd->uri);
char** uris;
- if(drag_all){
+ if (drag_all) {
uri_collection[uri_count] = NULL;
uris = uri_collection;
} else {
char* a[] = {dd->uri, NULL};
uris = a;
}
+ if (verbose) {
+ if (drag_all)
+ fputs("Sending all as URI\n", stderr);
+ else
+ fprintf(stderr, "Sending as URI: %s\n", dd->uri);
+ }
gtk_selection_data_set_uris(data, uris);
g_signal_stop_emission_by_name(widget, "drag-data-get");
} else if (info == TARGET_TYPE_TEXT) {
if (verbose)
- fprintf(stderr, "Writing as TEXT: %s\n", dd->text);
+ fprintf(stderr, "Sending as TEXT: %s\n", dd->text);
gtk_selection_data_set_text(data, dd->text, -1);
} else {
fprintf(stderr, "Error: bad target type %i\n", info);
bgstack15