From 761b4c87e8b0b426f93f635f5ec639102b41b0c1 Mon Sep 17 00:00:00 2001 From: "raveit65 (via Travis CI)" Date: Wed, 21 Feb 2024 17:14:24 +0000 Subject: Deploy mate-desktop/caja-extensions to github.com/mate-desktop/caja-extensions.git:gh-pages --- .../0.html | 799 ++++++ .../1.html | 361 +++ .../10.html | 345 +++ .../11.html | 315 +++ .../12.html | 315 +++ .../13.html | 1007 +++++++ .../14.html | 1009 +++++++ .../15.html | 359 +++ .../16.html | 1593 +++++++++++ .../17.html | 345 +++ .../18.html | 359 +++ .../19.html | 565 ++++ .../2.html | 863 ++++++ .../20.html | 339 +++ .../21.html | 1961 ++++++++++++++ .../22.html | 469 ++++ .../23.html | 361 +++ .../24.html | 863 ++++++ .../25.html | 289 ++ .../26.html | 273 ++ .../27.html | 659 +++++ .../28.html | 801 ++++++ .../29.html | 433 +++ .../3.html | 353 +++ .../30.html | 1215 +++++++++ .../31.html | 765 ++++++ .../32.html | 895 +++++++ .../33.html | 2809 ++++++++++++++++++++ .../34.html | 363 +++ .../35.html | 331 +++ .../36.html | 2271 ++++++++++++++++ .../37.html | 361 +++ .../38.html | 343 +++ .../39.html | 611 +++++ .../4.html | 547 ++++ .../40.html | 857 ++++++ .../41.html | 339 +++ .../5.html | 335 +++ .../6.html | 1015 +++++++ .../7.html | 833 ++++++ .../8.html | 1189 +++++++++ .../9.html | 643 +++++ .../index.html | 473 ++++ .../stats.html | 193 ++ .../style.css | 177 ++ 45 files changed, 31601 insertions(+) create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/0.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/1.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/10.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/11.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/12.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/13.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/14.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/15.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/16.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/17.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/18.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/19.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/2.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/20.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/21.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/22.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/23.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/24.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/25.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/26.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/27.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/28.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/29.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/3.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/30.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/31.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/32.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/33.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/34.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/35.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/36.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/37.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/38.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/39.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/4.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/40.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/41.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/5.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/6.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/7.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/8.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/9.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/index.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/stats.html create mode 100644 2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/style.css (limited to '2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim') diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/0.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/0.html new file mode 100644 index 0000000..cd6600e --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/0.html @@ -0,0 +1,799 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
/* bacon-video-widget-properties.c
+
+   Copyright (C) 2002 Bastien Nocera
+
+   The Gnome Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301  USA.
+
+   Author: Bastien Nocera <hadess@hadess.net>
+ */
+
+#include "config.h"<--- Include file: "config.h" not found.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <math.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "bacon-video-widget-properties.h"
+
+static void bacon_video_widget_properties_dispose (GObject *object);
+
+struct BaconVideoWidgetPropertiesPrivate {
+	GtkBuilder *xml;
+	int time;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_BOX)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
+
+static void
+bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->dispose = bacon_video_widget_properties_dispose;
+}
+
+static void
+bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
+{
+	props->priv = bacon_video_widget_properties_get_instance_private (props);
+
+	gtk_orientable_set_orientation (GTK_ORIENTABLE (props), GTK_ORIENTATION_VERTICAL);
+}
+
+static void
+bacon_video_widget_properties_dispose (GObject *object)
+{
+	BaconVideoWidgetProperties *props;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (object));
+
+	props = BACON_VIDEO_WIDGET_PROPERTIES (object);
+
+	g_clear_object (&props->priv->xml);
+
+	G_OBJECT_CLASS (bacon_video_widget_properties_parent_class)->dispose (object);
+}
+
+void
+bacon_video_widget_properties_set_label (BaconVideoWidgetProperties *props,
+					 const char                 *name,
+					 const char                 *text)
+{
+	GtkLabel *item;
+
+	g_return_if_fail (props != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
+	g_return_if_fail (name != NULL);
+
+	item = GTK_LABEL (gtk_builder_get_object (props->priv->xml, name));
+	g_return_if_fail (item != NULL);
+	gtk_label_set_text (item, text);
+}
+
+void
+bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props)
+{
+	GtkWidget *item;
+
+	g_return_if_fail (props != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
+
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox"));
+	gtk_widget_show (item);
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video"));
+	gtk_widget_set_sensitive (item, FALSE);
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio"));
+	gtk_widget_set_sensitive (item, FALSE);
+
+	/* Title */
+	bacon_video_widget_properties_set_label (props, "title", C_("Title", "Unknown"));
+	/* Artist */
+	bacon_video_widget_properties_set_label (props, "artist", C_("Artist", "Unknown"));
+	/* Album */
+	bacon_video_widget_properties_set_label (props, "album", C_("Album", "Unknown"));
+	/* Year */
+	bacon_video_widget_properties_set_label (props, "year", C_("Year", "Unknown"));
+	/* Duration */
+	bacon_video_widget_properties_set_duration (props, 0);
+	/* Comment */
+	bacon_video_widget_properties_set_label (props, "comment", "");
+	/* Container */
+	bacon_video_widget_properties_set_label (props, "container", C_("Media container", "Unknown"));
+
+	/* Dimensions */
+	bacon_video_widget_properties_set_label (props, "dimensions", C_("Dimensions", "N/A"));
+	/* Video Codec */
+	bacon_video_widget_properties_set_label (props, "vcodec", C_("Video codec", "N/A"));
+	/* Video Bitrate */
+	bacon_video_widget_properties_set_label (props, "video_bitrate",
+			C_("Video bit rate", "N/A"));
+	/* Framerate */
+	bacon_video_widget_properties_set_label (props, "framerate",
+			C_("Frame rate", "N/A"));
+
+	/* Audio Bitrate */
+	bacon_video_widget_properties_set_label (props, "audio_bitrate",
+			C_("Audio bit rate", "N/A"));
+	/* Audio Codec */
+	bacon_video_widget_properties_set_label (props, "acodec", C_("Audio codec", "N/A"));
+	/* Sample rate */
+	bacon_video_widget_properties_set_label (props, "samplerate", _("0 Hz"));
+	/* Channels */
+	bacon_video_widget_properties_set_label (props, "channels", _("0 Channels"));
+}
+
+static char *
+time_to_string_text (gint64 msecs)
+{
+	char *secs, *mins, *hours, *string;
+	int sec, min, hour, _time;
+
+	_time = (int) (msecs / 1000);
+	sec = _time % 60;
+	_time = _time - sec;
+	min = (_time % (60*60)) / 60;
+	_time = _time - (min * 60);
+	hour = _time / (60*60);
+
+	hours = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d hour", "%d hours", hour), hour);
+
+	mins = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d minute",
+					  "%d minutes", min), min);
+
+	secs = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%d second",
+					  "%d seconds", sec), sec);
+
+	if (hour > 0)
+	{
+		/* 5 hours 2 minutes 12 seconds */
+		string = g_strdup_printf (C_("time", "%s %s %s"), hours, mins, secs);
+	} else if (min > 0) {
+		/* 2 minutes 12 seconds */
+		string = g_strdup_printf (C_("time", "%s %s"), mins, secs);
+	} else if (sec > 0) {
+		/* 10 seconds */
+		string = g_strdup (secs);
+	} else {
+		/* 0 seconds */
+		string = g_strdup (_("0 seconds"));
+	}
+
+	g_free (hours);
+	g_free (mins);
+	g_free (secs);
+
+	return string;
+}
+
+void
+bacon_video_widget_properties_set_duration (BaconVideoWidgetProperties *props,
+					    int _time)
+{
+	char *string;
+
+	g_return_if_fail (props != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
+
+	if (_time == props->priv->time)
+		return;
+
+	string = time_to_string_text (_time);
+	bacon_video_widget_properties_set_label (props, "duration", string);
+	g_free (string);
+
+	props->priv->time = _time;
+}
+
+void
+bacon_video_widget_properties_set_has_type (BaconVideoWidgetProperties *props,
+					    gboolean                    has_video,
+					    gboolean                    has_audio)
+{
+	GtkWidget *item;
+
+	g_return_if_fail (props != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
+
+	/* Video */
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video"));
+	gtk_widget_set_sensitive (item, has_video);
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "video_vbox"));
+	gtk_widget_set_visible (item, has_video);
+
+	/* Audio */
+	item = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "audio"));
+	gtk_widget_set_sensitive (item, has_audio);
+}
+
+void
+bacon_video_widget_properties_set_framerate (BaconVideoWidgetProperties *props,
+					     float                       framerate)
+{
+	gchar *temp;
+
+	g_return_if_fail (props != NULL);
+	g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
+
+	if (framerate > 1.0) {
+		temp = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%0.2f frame per second", "%0.2f frames per second", (int) (ceilf (framerate))), framerate);
+	} else {
+		temp = g_strdup (C_("Frame rate", "N/A"));
+	}
+	bacon_video_widget_properties_set_label (props, "framerate", temp);
+	g_free (temp);
+}
+
+GtkWidget*
+bacon_video_widget_properties_new (void)
+{
+	BaconVideoWidgetProperties *props;
+	GtkBuilder *xml;
+	GtkWidget *vbox;
+	GtkSizeGroup *group;
+	const char *labels[] = { "title_label", "artist_label", "album_label",
+			"year_label", "duration_label", "comment_label", "container_label",
+			"dimensions_label", "vcodec_label", "framerate_label",
+			"vbitrate_label", "abitrate_label", "acodec_label",
+			"samplerate_label", "channels_label" };
+	guint i;
+
+	xml = gtk_builder_new ();
+	gtk_builder_set_translation_domain (xml, GETTEXT_PACKAGE);
+	if (gtk_builder_add_from_resource (xml, "/org/mate/caja/extensions/totemproperties/ui/properties.ui", NULL) == 0) {
+		g_object_unref (xml);
+		return NULL;
+	}
+
+	props = BACON_VIDEO_WIDGET_PROPERTIES (g_object_new
+			(BACON_TYPE_VIDEO_WIDGET_PROPERTIES, NULL));
+
+	props->priv->xml = xml;
+	vbox = GTK_WIDGET (gtk_builder_get_object (props->priv->xml, "vbox1"));
+	gtk_box_pack_start (GTK_BOX (props), vbox, FALSE, FALSE, 0);
+
+	bacon_video_widget_properties_reset (props);
+
+	group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+	for (i = 0; i < G_N_ELEMENTS (labels); i++)
+		gtk_size_group_add_widget (group, GTK_WIDGET (gtk_builder_get_object (xml, labels[i])));
+
+	g_object_unref (group);
+
+	gtk_widget_show_all (GTK_WIDGET (props));
+
+	return GTK_WIDGET (props);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/1.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/1.html new file mode 100644 index 0000000..4c722a2 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/1.html @@ -0,0 +1,361 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
/* bacon-video-widget-properties.h: Properties dialog for BaconVideoWidget
+
+   Copyright (C) 2002 Bastien Nocera <hadess@hadess.net>
+
+   The Gnome Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301  USA.
+
+   Author: Bastien Nocera <hadess@hadess.net>
+ */
+
+#ifndef BACON_VIDEO_WIDGET_PROPERTIES_H
+#define BACON_VIDEO_WIDGET_PROPERTIES_H
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define BACON_TYPE_VIDEO_WIDGET_PROPERTIES            (bacon_video_widget_properties_get_type ())
+#define BACON_VIDEO_WIDGET_PROPERTIES(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetProperties))
+#define BACON_VIDEO_WIDGET_PROPERTIES_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesClass))
+#define BACON_IS_VIDEO_WIDGET_PROPERTIES(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES))
+#define BACON_IS_VIDEO_WIDGET_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BACON_TYPE_VIDEO_WIDGET_PROPERTIES))
+
+typedef struct BaconVideoWidgetProperties		BaconVideoWidgetProperties;
+typedef struct BaconVideoWidgetPropertiesClass		BaconVideoWidgetPropertiesClass;
+typedef struct BaconVideoWidgetPropertiesPrivate	BaconVideoWidgetPropertiesPrivate;
+
+struct BaconVideoWidgetProperties {
+	GtkBox parent;
+	BaconVideoWidgetPropertiesPrivate *priv;
+};
+
+struct BaconVideoWidgetPropertiesClass {
+	GtkBoxClass parent_class;
+};
+
+GType bacon_video_widget_properties_get_type		(void);
+GtkWidget *bacon_video_widget_properties_new		(void);
+
+void bacon_video_widget_properties_reset		(BaconVideoWidgetProperties *props);
+void bacon_video_widget_properties_set_label		(BaconVideoWidgetProperties *props,
+							 const char                 *name,
+							 const char                 *text);
+void bacon_video_widget_properties_set_duration		(BaconVideoWidgetProperties *props,
+							 int                         duration);
+void bacon_video_widget_properties_set_has_type		(BaconVideoWidgetProperties *props,
+							 gboolean                    has_video,
+							 gboolean                    has_audio);
+void bacon_video_widget_properties_set_framerate	(BaconVideoWidgetProperties *props,
+							 float                       framerate);
+
+#endif /* BACON_VIDEO_WIDGET_PROPERTIES_H */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/10.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/10.html new file mode 100644 index 0000000..e8d014f --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/10.html @@ -0,0 +1,345 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
/*
+ *  caja-image-converter.h
+ *
+ *  Copyright (C) 2004-2005 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifndef CAJA_IMAGE_CONVERTER_H
+#define CAJA_IMAGE_CONVERTER_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* Declarations for the open terminal extension object.  This object will be
+ * instantiated by caja.  It implements the GInterfaces
+ * exported by libcaja. */
+
+#define CAJA_TYPE_IMAGE_CONVERTER	  (caja_image_converter_get_type ())
+#define CAJA_IMAGE_CONVERTER(o)		  (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_IMAGE_CONVERTER, CajaImageConverter))
+#define CAJA_IS_IMAGE_CONVERTER(o)	  (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_IMAGE_CONVERTER))
+typedef struct _CajaImageConverter	  CajaImageConverter;
+typedef struct _CajaImageConverterClass	  CajaImageConverterClass;
+
+struct _CajaImageConverter {
+	GObject parent_slot;
+};
+
+struct _CajaImageConverterClass {
+	GObjectClass parent_slot;
+};
+
+GType caja_image_converter_get_type      (void);
+void  caja_image_converter_register_type (GTypeModule *module);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/11.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/11.html new file mode 100644 index 0000000..30e68df --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/11.html @@ -0,0 +1,315 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
/*
+ *  caja-image-resize-dialog.h
+ *
+ *  Copyright (C) 2004-2005 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifndef __CAJA_IMAGE_RESIZER_H__
+#define __CAJA_IMAGE_RESIZER_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define CAJA_TYPE_IMAGE_RESIZER         (caja_image_resizer_get_type ())
+G_DECLARE_FINAL_TYPE (CajaImageResizer, caja_image_resizer, CAJA, IMAGE_RESIZER, GObject)
+
+CajaImageResizer *caja_image_resizer_new (GList *files);
+void caja_image_resizer_show_dialog (CajaImageResizer *dialog);
+
+G_END_DECLS
+
+#endif /* __CAJA_IMAGE_RESIZER_H__ */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/12.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/12.html new file mode 100644 index 0000000..003a3ae --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/12.html @@ -0,0 +1,315 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
/*
+ *  caja-image-rotator.h
+ *
+ *  Copyright (C) 2004-2006 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifndef __CAJA_IMAGE_ROTATOR_H__
+#define __CAJA_IMAGE_ROTATOR_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define CAJA_TYPE_IMAGE_ROTATOR         (caja_image_rotator_get_type ())
+G_DECLARE_FINAL_TYPE (CajaImageRotator, caja_image_rotator, CAJA, IMAGE_ROTATOR, GObject)
+
+CajaImageRotator *caja_image_rotator_new (GList *files);
+void caja_image_rotator_show_dialog (CajaImageRotator *dialog);
+
+G_END_DECLS
+
+#endif /* __CAJA_IMAGE_ROTATOR_H__ */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/13.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/13.html new file mode 100644 index 0000000..48d40ce --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/13.html @@ -0,0 +1,1007 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
/*
+ *  caja-image-resizer.c
+ *
+ *  Copyright (C) 2004-2008 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-image-resizer.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+struct _CajaImageResizer {
+	GObject parent_instance;
+
+	GList *files;
+
+	gchar *suffix;
+
+	int images_resized;
+	int images_total;
+	gboolean cancelled;
+
+	gchar *size;
+
+	GtkDialog *resize_dialog;
+	GtkRadioButton *default_size_radiobutton;
+	GtkComboBoxText *size_combobox;
+	GtkRadioButton *custom_pct_radiobutton;
+	GtkSpinButton *pct_spinbutton;
+	GtkRadioButton *custom_size_radiobutton;
+	GtkSpinButton *width_spinbutton;
+	GtkSpinButton *height_spinbutton;
+	GtkRadioButton *append_radiobutton;
+	GtkEntry *name_entry;
+	GtkRadioButton *inplace_radiobutton;
+
+	GtkWidget *progress_dialog;
+	GtkWidget *progress_bar;
+	GtkWidget *progress_label;
+};
+
+G_DEFINE_TYPE (CajaImageResizer, caja_image_resizer, G_TYPE_OBJECT)
+
+enum {
+	PROP_FILES = 1,
+};
+
+typedef enum {
+	/* Place Signal Types Here */
+	SIGNAL_TYPE_EXAMPLE,
+	LAST_SIGNAL
+} CajaImageResizerSignalType;
+
+static void
+caja_image_resizer_finalize (GObject *object)
+{
+	CajaImageResizer *resizer = CAJA_IMAGE_RESIZER (object);
+
+	g_free (resizer->suffix);
+
+	if (resizer->size)
+		g_free (resizer->size);
+
+	G_OBJECT_CLASS(caja_image_resizer_parent_class)->finalize(object);
+}
+
+static void
+caja_image_resizer_set_property (GObject      *object,
+                                 guint         property_id,
+                                 const GValue *value,
+                                 GParamSpec   *pspec)
+{
+	CajaImageResizer *resizer = CAJA_IMAGE_RESIZER (object);
+
+	switch (property_id) {
+		case PROP_FILES:
+			resizer->files = g_value_get_pointer (value);
+			resizer->images_total = g_list_length (resizer->files);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+caja_image_resizer_get_property (GObject      *object,
+                                 guint         property_id,
+                                 GValue       *value,
+                                 GParamSpec   *pspec)
+{
+	CajaImageResizer *resizer = CAJA_IMAGE_RESIZER (object);
+
+	switch (property_id) {
+		case PROP_FILES:
+			g_value_set_pointer (value, resizer->files);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+caja_image_resizer_class_init (CajaImageResizerClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+	GParamSpec *files_param_spec;
+
+	object_class->finalize = caja_image_resizer_finalize;
+	object_class->set_property = caja_image_resizer_set_property;
+	object_class->get_property = caja_image_resizer_get_property;
+
+	files_param_spec = g_param_spec_pointer ("files",
+	"Files",
+	"Set selected files",
+	G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+
+	g_object_class_install_property (object_class,
+	PROP_FILES,
+	files_param_spec);
+}
+
+static void run_op (CajaImageResizer *resizer);
+
+static GFile *
+caja_image_resizer_transform_filename (CajaImageResizer *resizer,
+                                       GFile            *orig_file)
+{
+	GFile *parent_file, *new_file;
+	char *basename, *extension, *new_basename;
+
+	g_return_val_if_fail (G_IS_FILE (orig_file), NULL);
+
+	parent_file = g_file_get_parent (orig_file);
+
+	basename = g_strdup (g_file_get_basename (orig_file));
+
+	extension = g_strdup (strrchr (basename, '.'));
+	if (extension != NULL)
+		basename[strlen (basename) - strlen (extension)] = '\0';
+
+	new_basename = g_strdup_printf ("%s%s%s", basename,
+	                                resizer->suffix == NULL ? ".tmp" : resizer->suffix,
+	                                extension == NULL ? "" : extension);
+	g_free (basename);
+	g_free (extension);
+
+	new_file = g_file_get_child (parent_file, new_basename);
+
+	g_object_unref (parent_file);
+	g_free (new_basename);
+
+	return new_file;
+}
+
+static void
+op_finished (GPid              pid,
+             gint              status,
+             gpointer          data)
+{
+	CajaImageResizer *resizer = CAJA_IMAGE_RESIZER (data);
+	gboolean          retry = TRUE;
+	CajaFileInfo     *file = CAJA_FILE_INFO (resizer->files->data);
+
+	if (status != 0) {
+		/* resizing failed */
+		GtkBuilder *builder;
+		GtkWidget  *msg_dialog;
+		GObject    *dialog_text;
+		int         response_id;
+		char       *msg;
+		char       *name;
+
+		name = caja_file_info_get_name (file);
+
+		builder = gtk_builder_new_from_resource ("/org/mate/caja/extensions/imageconverter/error-dialog.ui");
+		msg_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "error_dialog"));
+		dialog_text = gtk_builder_get_object (builder, "error_text");
+		msg = g_strdup_printf ("'%s' cannot be resized. Check whether you have permission to write to this folder.", name);
+		gtk_label_set_text (GTK_LABEL (dialog_text), msg);
+		g_free (msg);
+		g_object_unref (builder);
+
+		response_id = gtk_dialog_run (GTK_DIALOG (msg_dialog));
+		gtk_widget_destroy (msg_dialog);
+		if (response_id == 0) {
+			retry = TRUE;
+		} else if (response_id == GTK_RESPONSE_CANCEL) {
+			resizer->cancelled = TRUE;
+		} else if (response_id == 1) {
+			retry = FALSE;
+		}
+
+	} else if (resizer->suffix == NULL) {
+		/* resize image in place */
+		GFile *orig_location = caja_file_info_get_location (file);
+		GFile *new_location = caja_image_resizer_transform_filename (resizer, orig_location);
+		g_file_move (new_location, orig_location, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, NULL);
+		g_object_unref (orig_location);
+		g_object_unref (new_location);
+	}
+
+	if (status == 0 || !retry) {
+		/* image has been successfully resized (or skipped) */
+		resizer->images_resized++;
+		resizer->files = resizer->files->next;
+	}
+
+	if (!resizer->cancelled && resizer->files != NULL) {
+		/* process next image */
+		run_op (resizer);
+	} else {
+		/* cancel/terminate operation */
+		gtk_widget_destroy (resizer->progress_dialog);
+	}
+}
+
+static void
+run_op (CajaImageResizer *resizer)
+{
+	g_return_if_fail (resizer->files != NULL);
+
+	CajaFileInfo *file = CAJA_FILE_INFO (resizer->files->data);
+
+	GFile *orig_location = caja_file_info_get_location (file);
+	char *filename = g_file_get_path (orig_location);
+	GFile *new_location = caja_image_resizer_transform_filename (resizer, orig_location);
+	char *new_filename = g_file_get_path (new_location);
+	g_object_unref (orig_location);
+	g_object_unref (new_location);
+
+	/* FIXME: check whether new_uri already exists and provide "Replace _All", "_Skip", and "_Replace" options */
+
+	gchar *argv[6];
+	argv[0] = "convert";
+	argv[1] = filename;
+	argv[2] = "-resize";
+	argv[3] = resizer->size;
+	argv[4] = new_filename;
+	argv[5] = NULL;
+
+	pid_t pid;
+
+	if (filename == NULL || new_filename == NULL ||
+	    !g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, NULL)) {
+		// FIXME: error handling
+		g_free (filename);
+		g_free (new_filename);
+		return;
+	}
+
+	g_free (filename);
+	g_free (new_filename);
+
+	g_child_watch_add (pid, op_finished, resizer);
+
+	char *tmp;
+
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (resizer->progress_bar),
+	                               (double) (resizer->images_resized + 1) / resizer->images_total);
+	tmp = g_strdup_printf (_("Resizing image: %d of %d"),
+	                       resizer->images_resized + 1,
+	                       resizer->images_total);
+	gtk_progress_bar_set_text (GTK_PROGRESS_BAR (resizer->progress_bar), tmp);
+	g_free (tmp);
+
+	char *name = caja_file_info_get_name (file);
+	tmp = g_strdup_printf (_("<i>Resizing \"%s\"</i>"), name);
+	g_free (name);
+	gtk_label_set_markup (GTK_LABEL (resizer->progress_label), tmp);
+	g_free (tmp);
+
+}
+
+static void
+on_caja_image_resizer_response (GtkDialog        *dialog,
+                                gint              response_id,
+                                CajaImageResizer *resizer)
+{
+	if (response_id == GTK_RESPONSE_OK) {
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (resizer->append_radiobutton))) {
+			if (strlen (gtk_entry_get_text (resizer->name_entry)) == 0) {
+				GtkWidget *msg_dialog;
+				msg_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
+				                                     GTK_DIALOG_DESTROY_WITH_PARENT,
+				                                     GTK_MESSAGE_ERROR,
+				                                     GTK_BUTTONS_OK,
+				                                     _("Please enter a valid filename suffix!"));
+				gtk_dialog_run (GTK_DIALOG (msg_dialog));
+				gtk_widget_destroy (msg_dialog);
+				return;
+			}
+			resizer->suffix = g_strdup (gtk_entry_get_text (resizer->name_entry));
+		}
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (resizer->default_size_radiobutton))) {
+			resizer->size = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (resizer->size_combobox));
+		} else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (resizer->custom_pct_radiobutton))) {
+			resizer->size = g_strdup_printf ("%d%%",
+			                                 gtk_spin_button_get_value_as_int (resizer->pct_spinbutton));
+		} else {
+			resizer->size = g_strdup_printf ("%dx%d",
+			                                 gtk_spin_button_get_value_as_int (resizer->width_spinbutton),
+			                                 gtk_spin_button_get_value_as_int (resizer->height_spinbutton));
+		}
+
+		run_op (resizer);
+	}
+
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+caja_image_resizer_init (CajaImageResizer *resizer)
+{
+	GtkBuilder *builder;
+
+	builder = gtk_builder_new_from_resource ("/org/mate/caja/extensions/imageconverter/caja-image-resize.ui");
+#ifdef ENABLE_NLS
+	gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	/* Grab some widgets */
+	resizer->resize_dialog = GTK_DIALOG (gtk_builder_get_object (builder, "resize_dialog"));
+	resizer->default_size_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "default_size_radiobutton"));
+	resizer->size_combobox = GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder, "comboboxtext_size"));
+	resizer->custom_pct_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "custom_pct_radiobutton"));
+	resizer->pct_spinbutton = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "pct_spinbutton"));
+	resizer->custom_size_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "custom_size_radiobutton"));
+	resizer->width_spinbutton = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "width_spinbutton"));
+	resizer->height_spinbutton = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "height_spinbutton"));
+	resizer->append_radiobutton = GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "append_radiobutton"));
+	resizer->name_entry = GTK_ENTRY (gtk_builder_get_object (builder, "name_entry"));
+	resizer->inplace_radiobutton = GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "inplace_radiobutton"));
+
+	/* Set default item in combo box */
+	/* gtk_combo_box_set_active  (resizer->size_combobox, 4);  1024x768 */
+
+	/* Connect signal */
+	g_signal_connect (resizer->resize_dialog, "response",
+	                  G_CALLBACK (on_caja_image_resizer_response),
+	                  resizer);
+
+	g_object_unref (builder);
+}
+
+CajaImageResizer *
+caja_image_resizer_new (GList *files)
+{
+	return g_object_new (CAJA_TYPE_IMAGE_RESIZER, "files", files, NULL);
+}
+
+void
+caja_image_resizer_show_dialog (CajaImageResizer *resizer)
+{
+	gtk_widget_show (GTK_WIDGET (resizer->resize_dialog));
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/14.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/14.html new file mode 100644 index 0000000..d41a327 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/14.html @@ -0,0 +1,1009 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
/*
+ *  caja-image-rotator.c
+ *
+ *  Copyright (C) 2004-2008 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-image-rotator.h"
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+struct _CajaImageRotator {
+	GObject parent_instance;
+
+	GList *files;
+
+	gchar *suffix;
+
+	int images_rotated;
+	int images_total;
+	gboolean cancelled;
+
+	gchar *angle;
+
+	GtkDialog *rotate_dialog;
+	GtkRadioButton *default_angle_radiobutton;
+	GtkComboBox *angle_combobox;
+	GtkRadioButton *custom_angle_radiobutton;
+	GtkSpinButton *angle_spinbutton;
+	GtkRadioButton *append_radiobutton;
+	GtkEntry *name_entry;
+	GtkRadioButton *inplace_radiobutton;
+
+	GtkWidget *progress_dialog;
+	GtkWidget *progress_bar;
+	GtkWidget *progress_label;
+};
+
+G_DEFINE_TYPE (CajaImageRotator, caja_image_rotator, G_TYPE_OBJECT)
+
+enum {
+	PROP_FILES = 1,
+};
+
+typedef enum {
+	/* Place Signal Types Here */
+	SIGNAL_TYPE_EXAMPLE,
+	LAST_SIGNAL
+} CajaImageRotatorSignalType;
+
+static void
+caja_image_rotator_finalize (GObject *object)
+{
+	CajaImageRotator *rotator = CAJA_IMAGE_ROTATOR (object);
+
+	g_free (rotator->suffix);
+
+	if (rotator->angle)
+		g_free (rotator->angle);
+
+	G_OBJECT_CLASS(caja_image_rotator_parent_class)->finalize(object);
+}
+
+static void
+caja_image_rotator_set_property (GObject      *object,
+                                 guint         property_id,
+                                 const GValue *value,
+                                 GParamSpec   *pspec)
+{
+	CajaImageRotator *rotator = CAJA_IMAGE_ROTATOR (object);
+
+	switch (property_id) {
+		case PROP_FILES:
+			rotator->files = g_value_get_pointer (value);
+			rotator->images_total = g_list_length (rotator->files);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID(object,property_id,pspec);
+	}
+}
+
+static void
+caja_image_rotator_get_property (GObject      *object,
+                                 guint         property_id,
+                                 GValue       *value,
+                                 GParamSpec   *pspec)
+{
+	CajaImageRotator *rotator = CAJA_IMAGE_ROTATOR (object);
+
+	switch (property_id) {
+		case PROP_FILES:
+			g_value_set_pointer (value, rotator->files);
+			break;
+		default:
+			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+	}
+}
+
+static void
+caja_image_rotator_class_init(CajaImageRotatorClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+	GParamSpec *files_param_spec;
+
+	object_class->finalize = caja_image_rotator_finalize;
+	object_class->set_property = caja_image_rotator_set_property;
+	object_class->get_property = caja_image_rotator_get_property;
+
+	files_param_spec = g_param_spec_pointer ("files",
+	"Files",
+	"Set selected files",
+	G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+
+	g_object_class_install_property (object_class,
+	PROP_FILES,
+	files_param_spec);
+}
+
+static void run_op (CajaImageRotator *rotator);
+
+static GFile *
+caja_image_rotator_transform_filename (CajaImageRotator *rotator, GFile *orig_file)
+{
+	GFile *parent_file, *new_file;
+	char *basename, *extension, *new_basename;
+
+	g_return_val_if_fail (G_IS_FILE (orig_file), NULL);
+
+	parent_file = g_file_get_parent (orig_file);
+
+	basename = g_strdup (g_file_get_basename (orig_file));
+
+	extension = g_strdup (strrchr (basename, '.'));
+	if (extension != NULL)
+		basename[strlen (basename) - strlen (extension)] = '\0';
+
+	new_basename = g_strdup_printf ("%s%s%s", basename,
+	                                rotator->suffix == NULL ? ".tmp" : rotator->suffix,
+	                                extension == NULL ? "" : extension);
+	g_free (basename);
+	g_free (extension);
+
+	new_file = g_file_get_child (parent_file, new_basename);
+
+	g_object_unref (parent_file);
+	g_free (new_basename);
+
+	return new_file;
+}
+
+static void
+op_finished (GPid      pid,
+             gint      status,
+             gpointer  data)
+{
+	CajaImageRotator *rotator = CAJA_IMAGE_ROTATOR (data);
+	gboolean          retry = TRUE;
+	CajaFileInfo     *file = CAJA_FILE_INFO (rotator->files->data);
+
+	if (status != 0) {
+		/* rotating failed */
+		GtkBuilder *builder;
+		GtkWidget  *msg_dialog;
+		GObject    *dialog_text;
+		int         response_id;
+		char       *msg;
+		char       *name;
+
+		name  = caja_file_info_get_name (file);
+
+		builder = gtk_builder_new_from_resource ("/org/mate/caja/extensions/imageconverter/error-dialog.ui");
+		msg_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "error_dialog"));
+		dialog_text = gtk_builder_get_object (builder, "error_text");
+		msg = g_strdup_printf ("'%s' cannot be rotated. Check whether you have permission to write to this folder.", name);
+		gtk_label_set_text (GTK_LABEL (dialog_text), msg);
+		g_free (msg);
+		g_object_unref (builder);
+
+		response_id = gtk_dialog_run (GTK_DIALOG (msg_dialog));
+		gtk_widget_destroy (msg_dialog);
+		if (response_id == 0) {
+			retry = TRUE;
+		} else if (response_id == GTK_RESPONSE_CANCEL) {
+			rotator->cancelled = TRUE;
+		} else if (response_id == 1) {
+			retry = FALSE;
+		}
+
+	} else if (rotator->suffix == NULL) {
+		/* rotate image in place */
+		GFile *orig_location = caja_file_info_get_location (file);
+		GFile *new_location = caja_image_rotator_transform_filename (rotator, orig_location);
+		g_file_move (new_location, orig_location, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, NULL);
+		g_object_unref (orig_location);
+		g_object_unref (new_location);
+	}
+
+	if (status == 0 || !retry) {
+		/* image has been successfully rotated (or skipped) */
+		rotator->images_rotated++;
+		rotator->files = rotator->files->next;
+	}
+
+	if (!rotator->cancelled && rotator->files != NULL) {
+		/* process next image */
+		run_op (rotator);
+	} else {
+		/* cancel/terminate operation */
+		gtk_widget_destroy (rotator->progress_dialog);
+	}
+}
+
+static void
+run_op (CajaImageRotator *rotator)
+{
+	g_return_if_fail (rotator->files != NULL);
+
+	CajaFileInfo *file = CAJA_FILE_INFO (rotator->files->data);
+
+	GFile *orig_location = caja_file_info_get_location (file);
+	char *filename = g_file_get_path (orig_location);
+	GFile *new_location = caja_image_rotator_transform_filename (rotator, orig_location);
+	char *new_filename = g_file_get_path (new_location);
+	g_object_unref (orig_location);
+	g_object_unref (new_location);
+
+	/* FIXME: check whether new_uri already exists and provide "Replace _All", "_Skip", and "_Replace" options */
+
+	gchar *argv[8];
+	argv[0] = "convert";
+	argv[1] = filename;
+	argv[2] = "-rotate";
+	argv[3] = rotator->angle;
+	argv[4] = "-orient";
+	argv[5] = "TopLeft";
+	argv[6] = new_filename;
+	argv[7] = NULL;
+
+	pid_t pid;
+
+	if (filename == NULL || new_filename == NULL ||
+	    !g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, NULL, NULL, &pid, NULL)) {
+		// FIXME: error handling
+		g_free (filename);
+		g_free (new_filename);
+		return;
+	}
+
+	g_free (filename);
+	g_free (new_filename);
+
+	g_child_watch_add (pid, op_finished, rotator);
+
+	char *tmp;
+
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (rotator->progress_bar), (double) (rotator->images_rotated + 1) / rotator->images_total);
+	tmp = g_strdup_printf (_("Rotating image: %d of %d"), rotator->images_rotated + 1, rotator->images_total);
+	gtk_progress_bar_set_text (GTK_PROGRESS_BAR (rotator->progress_bar), tmp);
+	g_free (tmp);
+
+	char *name = caja_file_info_get_name (file);
+	tmp = g_strdup_printf (_("<i>Rotating \"%s\"</i>"), name);
+	g_free (name);
+	gtk_label_set_markup (GTK_LABEL (rotator->progress_label), tmp);
+	g_free (tmp);
+
+}
+
+static void
+on_caja_image_rotator_response (GtkDialog        *dialog,
+                                gint              response_id,
+                                CajaImageRotator *rotator)
+{
+	if (response_id == GTK_RESPONSE_OK) {
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rotator->append_radiobutton))) {
+			if (strlen (gtk_entry_get_text (rotator->name_entry)) == 0) {
+				GtkWidget *msg_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
+					GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
+					GTK_BUTTONS_OK, _("Please enter a valid filename suffix!"));
+				gtk_dialog_run (GTK_DIALOG (msg_dialog));
+				gtk_widget_destroy (msg_dialog);
+				return;
+			}
+			rotator->suffix = g_strdup (gtk_entry_get_text (rotator->name_entry));
+		}
+		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rotator->default_angle_radiobutton))) {
+			switch (gtk_combo_box_get_active (GTK_COMBO_BOX (rotator->angle_combobox))) {
+			case 0:
+				rotator->angle = g_strdup_printf ("90");
+				break;
+			case 1:
+				rotator->angle = g_strdup_printf ("-90");
+				break;
+			case 2:
+				rotator->angle = g_strdup_printf ("180");
+				break;
+			default:
+				g_assert_not_reached ();
+			}
+		} else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rotator->custom_angle_radiobutton))) {
+			rotator->angle = g_strdup_printf ("%d",
+			                                  gtk_spin_button_get_value_as_int (rotator->angle_spinbutton));
+		} else {
+			g_assert_not_reached ();
+		}
+
+		run_op (rotator);
+	}
+
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
+caja_image_rotator_init (CajaImageRotator *rotator)
+{
+	GtkBuilder *builder;
+
+	builder = gtk_builder_new_from_resource ("/org/mate/caja/extensions/imageconverter/caja-image-rotate.ui");
+#ifdef ENABLE_NLS
+	gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	/* Grab some widgets */
+	rotator->rotate_dialog = GTK_DIALOG (gtk_builder_get_object (builder, "rotate_dialog"));
+	rotator->default_angle_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "default_angle_radiobutton"));
+	rotator->angle_combobox = GTK_COMBO_BOX (gtk_builder_get_object (builder, "angle_combobox"));
+	rotator->custom_angle_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "custom_angle_radiobutton"));
+	rotator->angle_spinbutton =
+		GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "angle_spinbutton"));
+	rotator->append_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "append_radiobutton"));
+	rotator->name_entry = GTK_ENTRY (gtk_builder_get_object (builder, "name_entry"));
+	rotator->inplace_radiobutton =
+		GTK_RADIO_BUTTON (gtk_builder_get_object (builder, "inplace_radiobutton"));
+
+	/* Set default value for combobox */
+	gtk_combo_box_set_active  (rotator->angle_combobox, 0); /* 90° clockwise */
+
+	/* Connect the signal */
+	g_signal_connect (rotator->rotate_dialog, "response",
+	                  G_CALLBACK (on_caja_image_rotator_response),
+			  rotator);
+
+	g_object_unref (builder);
+}
+
+CajaImageRotator *
+caja_image_rotator_new (GList *files)
+{
+	return g_object_new (CAJA_TYPE_IMAGE_ROTATOR, "files", files, NULL);
+}
+
+void
+caja_image_rotator_show_dialog (CajaImageRotator *rotator)
+{
+	gtk_widget_show (GTK_WIDGET (rotator->rotate_dialog));
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/15.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/15.html new file mode 100644 index 0000000..5d7a8e9 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/15.html @@ -0,0 +1,359 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
/*
+ *  image-converter.c
+ *
+ *  Copyright (C) 2004-2005 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-image-converter.h"
+
+static GType type_list[1];
+
+void
+caja_module_initialize (GTypeModule *module)
+{
+	g_print ("Initializing caja-image-converter extension\n");
+
+	caja_image_converter_register_type (module);
+	type_list[0] = CAJA_TYPE_IMAGE_CONVERTER;
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+	g_print ("Shutting down caja-image-converter extension\n");
+}
+
+void
+caja_module_list_types (const GType **types,
+			    int          *num_types)
+{
+	*types = type_list;
+	*num_types = G_N_ELEMENTS (type_list);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/16.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/16.html new file mode 100644 index 0000000..26ff0cd --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/16.html @@ -0,0 +1,1593 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
/*
+ *  caja-open-terminal.c
+ *
+ *  Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Christian Neumair <chris@gnome-de.org>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-open-terminal.h"
+
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-configurable.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gtk/gtkicontheme.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtkwidget.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtkmain.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libmate-desktop/mate-desktop-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <errno.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <fcntl.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h> /* for strcmp, strdup, ... */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <unistd.h> /* for chdir */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h> /* for atoi */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define COT_SCHEMA "org.mate.caja-open-terminal"
+#define COT_DESKTOP_KEY "desktop-opens-home-dir"
+#define CAJA_SCHEMA "org.mate.caja.preferences"
+#define CAJA_DESKTOP_KEY "desktop-is-home-dir"
+#define TERM_SCHEMA "org.mate.applications-terminal"
+#define TERM_EXEC_KEY "exec"
+
+static void caja_open_terminal_instance_init (CajaOpenTerminal      *cvs);
+static void caja_open_terminal_class_init    (CajaOpenTerminalClass *class);
+
+static GType terminal_type = 0;
+
+typedef enum {
+	FILE_INFO_LOCAL,
+	FILE_INFO_DESKTOP,
+	FILE_INFO_SFTP,
+	FILE_INFO_OTHER
+} TerminalFileInfo;
+
+static TerminalFileInfo
+get_terminal_file_info (CajaFileInfo *file_info)
+{
+	TerminalFileInfo  ret;
+	char             *uri;
+	char             *uri_scheme;
+
+	uri = caja_file_info_get_activation_uri (file_info);
+	uri_scheme = g_uri_parse_scheme (uri);
+
+	if (strcmp (uri_scheme, "file") == 0) {
+		ret = FILE_INFO_LOCAL;
+	} else if (strcmp (uri_scheme, "x-caja-desktop") == 0) {
+		ret = FILE_INFO_DESKTOP;
+	} else if (strcmp (uri_scheme, "sftp") == 0 ||
+		   strcmp (uri_scheme, "ssh") == 0) {
+		ret = FILE_INFO_SFTP;
+	} else {
+		ret = FILE_INFO_OTHER;
+	}
+
+	g_free (uri_scheme);
+	g_free (uri);
+
+	return ret;
+}
+
+static char *
+lookup_in_data_dir (const char *basename,
+                    const char *data_dir)
+{
+	char *path;
+
+	path = g_build_filename (data_dir, basename, NULL);
+	if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+		g_free (path);
+		return NULL;
+	}
+
+	return path;
+}
+
+static char *
+lookup_in_data_dirs (const char *basename)
+{
+	const char * const *system_data_dirs;
+	const char          *user_data_dir;
+	char                *retval;
+	int                  i;
+
+	user_data_dir    = g_get_user_data_dir ();
+	system_data_dirs = g_get_system_data_dirs ();
+
+	if ((retval = lookup_in_data_dir (basename, user_data_dir))) {
+		return retval;
+	}
+
+	for (i = 0; system_data_dirs[i]; i++) {
+		if ((retval = lookup_in_data_dir (basename, system_data_dirs[i])))
+			return retval;
+	}
+
+	return NULL;
+}
+
+static inline gboolean
+desktop_opens_home_dir (void)
+{
+	gboolean result;
+	GSettings* settings;
+
+	settings = g_settings_new (COT_SCHEMA);
+	result = g_settings_get_boolean (settings, COT_DESKTOP_KEY);
+	g_object_unref (settings);
+	return result;
+}
+
+static inline gboolean
+set_desktop_opens_home_dir (gboolean val)
+{
+	gboolean result;
+	GSettings* settings;
+
+	settings = g_settings_new (COT_SCHEMA);
+	result = g_settings_set_boolean (settings, COT_DESKTOP_KEY, val);
+	g_object_unref (settings);
+	return result;
+}
+
+static inline gboolean
+desktop_is_home_dir (void)
+{
+	gboolean result;
+	GSettings* settings;
+
+	settings = g_settings_new (CAJA_SCHEMA);
+	result = g_settings_get_boolean (settings, CAJA_DESKTOP_KEY);
+	g_object_unref (settings);
+	return result;
+}
+
+static inline gchar*
+default_terminal_application (void)
+{
+	gchar *result;
+	GSettings* settings;
+
+	settings = g_settings_new (TERM_SCHEMA);
+	result = g_settings_get_string (settings, TERM_EXEC_KEY);
+	g_object_unref (settings);
+
+	if (result == NULL || strlen (result) == 0) {
+		g_free (result);
+		result = g_strdup ("mate-terminal");
+	}
+
+	return result;
+}
+
+static inline gboolean
+set_default_terminal_application (const gchar* exec)
+{
+	gboolean result;
+	GSettings* settings;
+
+	settings = g_settings_new (TERM_SCHEMA);
+	result = g_settings_set_string (settings, TERM_EXEC_KEY, exec);
+	g_object_unref (settings);
+	return result;
+}
+
+static void
+parse_sftp_uri (GFile *file, char **host, guint *port, char **user,
+		char **path)
+{
+	char *uri = g_file_get_uri (file);
+	char *u, *h, *s, *p;
+	char *h_end;
+
+	g_assert (uri != NULL);
+
+	u = strchr(uri, ':');
+	g_assert (u != NULL);
+	u += 3;  /* Skip over :// to userid */
+
+	p = strchr (u, '/');
+	h = strchr(u, '@');
+
+	if (h && ((p == NULL) || (h < p))) {
+		*h='\0';
+		h++;
+	} else {
+		h = u;
+		u = NULL;
+	}
+
+	s = strchr(h, ':');
+
+	if (s && (p == NULL || s < p)) {
+		h_end = s;
+		*s = '\0';
+		s++;
+	} else {
+		h_end = p;
+		s = NULL;
+	}
+
+	if (h_end == NULL) {
+		h_end = h + strlen(h);
+	}
+
+	*user = g_strdup(u);
+	*port = s == NULL ? 0 : atoi(s); /* FIXME: getservbyname ? */
+	*path = g_uri_unescape_string (p, "/");
+	*h_end = '\0';
+	*host = g_strdup(h);
+
+	g_free (uri);
+}
+
+static void
+append_sftp_info (char **terminal_exec,
+		  CajaFileInfo *file_info)
+{
+	GFile *vfs_uri;
+	char *host_name, *path, *user_name;
+	char *user_host, *cmd, *quoted_cmd;
+	char *host_port_switch;
+	char *quoted_path;
+	char *remote_cmd;
+	char *quoted_remote_cmd;
+	guint host_port;
+
+	g_assert (terminal_exec != NULL);
+	g_assert (file_info != NULL);
+
+	vfs_uri = g_file_new_for_uri (caja_file_info_get_activation_uri (file_info));
+	g_assert (vfs_uri != NULL);
+
+	g_assert (g_file_has_uri_scheme(vfs_uri, "sftp")==TRUE ||
+		  g_file_has_uri_scheme(vfs_uri, "ssh")==TRUE);
+
+	parse_sftp_uri (vfs_uri, &host_name, &host_port, &user_name, &path);
+
+	if (host_port == 0) {
+		host_port_switch = g_strdup ("");
+	} else {
+		host_port_switch = g_strdup_printf ("-p %d", host_port);
+	}
+
+	if (user_name != NULL) {
+		user_host = g_strdup_printf ("%s@%s", user_name, host_name);
+	} else {
+		user_host = g_strdup (host_name);
+	}
+
+	quoted_path = g_shell_quote (path);
+	remote_cmd = g_strdup_printf ("cd %s && $SHELL -l", quoted_path);
+	quoted_remote_cmd = g_shell_quote (remote_cmd);
+
+	cmd = g_strdup_printf ("ssh %s %s -t %s", user_host, host_port_switch, quoted_remote_cmd);
+	quoted_cmd = g_shell_quote (cmd);
+	g_free (cmd);
+
+	*terminal_exec = g_realloc (*terminal_exec, strlen (*terminal_exec) + strlen (quoted_cmd) + 4 + 1);
+	strcpy (*terminal_exec + strlen (*terminal_exec), " -e ");
+	strcpy (*terminal_exec + strlen (*terminal_exec), quoted_cmd);
+
+	g_free (host_name);
+	g_free (user_name);
+	g_free (host_port_switch);
+	g_free (path);
+	g_free (quoted_path);
+
+	g_free (remote_cmd);
+	g_free (quoted_remote_cmd);
+	g_free (quoted_cmd);
+	g_free (user_host);
+	g_object_unref (vfs_uri);
+}
+
+static void
+open_terminal_callback (CajaMenuItem *item,
+			CajaFileInfo *file_info)
+{
+	GdkDisplay   *display;
+	const gchar *display_str;
+	const gchar *old_display_str;
+	gchar *uri;
+	gchar **argv, *terminal_exec;
+	gchar *working_directory;
+	gchar *dfile;
+	MateDesktopItem *ditem;
+	GdkScreen *screen;
+
+	terminal_exec = default_terminal_application();
+
+	switch (get_terminal_file_info (file_info)) {
+		case FILE_INFO_LOCAL:
+			uri = caja_file_info_get_activation_uri (file_info);
+			if (uri != NULL) {
+				working_directory = g_filename_from_uri (uri, NULL, NULL);
+			} else {
+				working_directory = g_strdup (g_get_home_dir ());
+			}
+			g_free (uri);
+			break;
+
+		case FILE_INFO_DESKTOP:
+			if (desktop_is_home_dir () || desktop_opens_home_dir ()) {
+				working_directory = g_strdup (g_get_home_dir ());
+			} else {
+				working_directory = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
+			}
+			break;
+
+		case FILE_INFO_SFTP:
+			working_directory = NULL;
+			append_sftp_info (&terminal_exec, file_info);
+			break;
+
+		case FILE_INFO_OTHER:
+		default:
+			g_assert_not_reached ();
+	}
+
+	if (g_str_has_prefix (terminal_exec, "mate-terminal")) {
+		dfile = lookup_in_data_dirs ("applications/mate-terminal.desktop");
+	} else {
+		dfile = NULL;
+	}
+
+	g_shell_parse_argv (terminal_exec, NULL, &argv, NULL);
+
+	display_str = NULL;
+	old_display_str = g_getenv ("DISPLAY");
+
+	screen = g_object_get_data (G_OBJECT (item), "CajaOpenTerminal::screen");
+	display = gdk_screen_get_display (screen);
+	if (screen != NULL) {
+		display_str = gdk_display_get_name (display);
+		g_setenv ("DISPLAY", display_str, TRUE);
+	}
+
+	if (dfile != NULL) {
+		int orig_cwd = -1;
+
+		do {
+			orig_cwd = open (".", O_RDONLY);
+		} while (orig_cwd == -1 && errno == EINTR);
+
+		if (orig_cwd == -1) {
+			g_message ("CajaOpenTerminal: Failed to open current Caja working directory.");
+		} else if (working_directory != NULL) {
+
+			if (chdir (working_directory) == -1) {
+				int ret;
+
+				g_message ("CajaOpenTerminal: Failed to change Caja working directory to \"%s\".",
+					   working_directory);
+
+				do {
+					ret = close (orig_cwd);
+				} while (ret == -1 && errno == EINTR);
+
+				if (ret == -1) {
+					g_message ("CajaOpenTerminal: Failed to close() current Caja working directory.");
+				}
+
+				orig_cwd = -1;
+			}
+		}
+
+		ditem = mate_desktop_item_new_from_file (dfile, 0, NULL);
+
+		mate_desktop_item_set_string (ditem, "Exec", terminal_exec);
+		if (gtk_get_current_event_time () > 0) {
+			mate_desktop_item_set_launch_time (ditem, gtk_get_current_event_time ());
+		}
+		mate_desktop_item_launch (ditem, NULL, MATE_DESKTOP_ITEM_LAUNCH_USE_CURRENT_DIR, NULL);
+		mate_desktop_item_unref (ditem);
+		g_free (dfile);
+
+		if (orig_cwd != -1) {
+			int ret;
+
+			ret = fchdir (orig_cwd);
+			if (ret == -1) {
+				g_message ("CajaOpenTerminal: Failed to change back Caja working directory to original location after changing it to \"%s\".",
+					   working_directory);
+			}
+
+			do {
+				ret = close (orig_cwd);
+			} while (ret == -1 && errno == EINTR);
+
+			if (ret == -1) {
+				g_message ("CajaOpenTerminal: Failed to close Caja working directory.");
+			}
+		}
+	} else {
+		g_spawn_async (working_directory,
+			       argv,
+			       NULL,
+			       G_SPAWN_SEARCH_PATH,
+			       NULL,
+			       NULL,
+			       NULL,
+			       NULL);
+	}
+
+	g_setenv ("DISPLAY", old_display_str, TRUE);
+
+	g_strfreev (argv);
+	g_free (terminal_exec);
+	g_free (working_directory);
+}
+
+static CajaMenuItem *
+open_terminal_menu_item_new (CajaFileInfo	  *file_info,
+                             TerminalFileInfo  terminal_file_info,
+                             GdkScreen        *screen,
+                             gboolean          is_file_item)
+{
+	CajaMenuItem *ret;
+	const char *name;
+	const char *tooltip;
+
+	switch (terminal_file_info) {
+		case FILE_INFO_LOCAL:
+		case FILE_INFO_SFTP:
+			name = _("Open in _Terminal");
+			if (is_file_item) {
+				tooltip = _("Open the currently selected folder in a terminal");
+			} else {
+				tooltip = _("Open the currently open folder in a terminal");
+			}
+			break;
+
+		case FILE_INFO_DESKTOP:
+			if (desktop_opens_home_dir ()) {
+				name = _("Open _Terminal");
+				tooltip = _("Open a terminal");
+			} else {
+				name = _("Open in _Terminal");
+				tooltip = _("Open the currently open folder in a terminal");
+			}
+			break;
+
+		case FILE_INFO_OTHER:
+		default:
+			g_assert_not_reached ();
+	}
+
+	ret = caja_menu_item_new ("CajaOpenTerminal::open_terminal",
+				      name, tooltip, "terminal");
+
+	g_object_set_data (G_OBJECT (ret),
+			   "CajaOpenTerminal::screen",
+			   screen);
+
+	g_object_set_data_full (G_OBJECT (ret), "file-info",
+				g_object_ref (file_info),
+				(GDestroyNotify) g_object_unref);
+	g_signal_connect (ret, "activate",
+			  G_CALLBACK (open_terminal_callback),
+			  file_info);
+
+	return ret;
+}
+
+static GList *
+caja_open_terminal_get_background_items (CajaMenuProvider *provider,
+                                         GtkWidget        *window,
+                                         CajaFileInfo     *file_info)
+{
+	CajaMenuItem *item;
+	TerminalFileInfo  terminal_file_info;
+
+	terminal_file_info = get_terminal_file_info (file_info);
+	switch (terminal_file_info) {
+		case FILE_INFO_LOCAL:
+		case FILE_INFO_DESKTOP:
+		case FILE_INFO_SFTP:
+			item = open_terminal_menu_item_new (file_info, terminal_file_info, gtk_widget_get_screen (window), FALSE);
+			return g_list_append (NULL, item);
+
+		case FILE_INFO_OTHER:
+			return NULL;
+
+		default:
+			g_assert_not_reached ();
+	}
+}
+
+static GList *
+caja_open_terminal_get_file_items (CajaMenuProvider *provider,
+                                   GtkWidget        *window,
+                                   GList            *files)
+{
+	CajaMenuItem *item;
+	TerminalFileInfo  terminal_file_info;
+
+	if (g_list_length (files) != 1 ||
+	    (!caja_file_info_is_directory (files->data) &&
+	     caja_file_info_get_file_type (files->data) != G_FILE_TYPE_SHORTCUT &&
+	     caja_file_info_get_file_type (files->data) != G_FILE_TYPE_MOUNTABLE)) {
+		return NULL;
+	}
+
+	terminal_file_info = get_terminal_file_info (files->data);
+	switch (terminal_file_info) {
+		case FILE_INFO_LOCAL:
+		case FILE_INFO_SFTP:
+			item = open_terminal_menu_item_new (files->data, terminal_file_info, gtk_widget_get_screen (window), TRUE);
+			return g_list_append (NULL, item);
+
+		case FILE_INFO_DESKTOP:
+		case FILE_INFO_OTHER:
+			return NULL;
+
+		default:
+			g_assert_not_reached ();
+	}
+}
+
+static void
+caja_open_terminal_run_config (CajaConfigurable *provider)
+{
+	GtkWidget *extconf_dialog, *extconf_content, *extconf_desktophomedir, *extconf_inform1, *extconf_inform2, *extconf_exec;
+	gchar * terminal;
+
+	extconf_dialog = gtk_dialog_new ();
+	extconf_content = gtk_dialog_get_content_area (GTK_DIALOG (extconf_dialog));
+
+	extconf_desktophomedir = gtk_check_button_new_with_label (_("Open at Home if trying to open on desktop"));
+	extconf_exec = gtk_entry_new ();
+	extconf_inform1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+	extconf_inform2 = gtk_label_new (_("Terminal application:"));
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (extconf_desktophomedir), desktop_opens_home_dir ());
+
+	terminal = default_terminal_application();
+	gtk_entry_set_text (GTK_ENTRY (extconf_exec), terminal);
+	g_free (terminal);
+
+	gtk_container_add (GTK_CONTAINER (extconf_inform1), extconf_inform2);
+	gtk_widget_show (extconf_inform2);
+	gtk_container_add (GTK_CONTAINER (extconf_inform1), extconf_exec);
+	gtk_widget_show (extconf_exec);
+	gtk_box_set_child_packing (GTK_BOX (extconf_inform1), extconf_exec, FALSE, FALSE, 0, GTK_PACK_END);
+
+	gtk_container_add (GTK_CONTAINER (extconf_content), extconf_desktophomedir);
+	gtk_widget_show (extconf_desktophomedir);
+	gtk_container_add (GTK_CONTAINER (extconf_content), extconf_inform1);
+	gtk_widget_show (extconf_inform1);
+	gtk_container_add (GTK_CONTAINER (extconf_content), extconf_exec);
+	gtk_widget_show (extconf_exec);
+	gtk_dialog_add_buttons (GTK_DIALOG (extconf_dialog), _("Close"), GTK_RESPONSE_OK, NULL);
+
+	gtk_container_set_border_width (GTK_CONTAINER (extconf_inform1), 6);
+	gtk_container_set_border_width (GTK_CONTAINER (extconf_dialog), 6);
+	gtk_container_set_border_width (GTK_CONTAINER (extconf_content), 6);
+
+	gtk_window_set_title (GTK_WINDOW (extconf_dialog), _("open-terminal Configuration"));
+	gtk_dialog_run (GTK_DIALOG (extconf_dialog));
+
+	set_default_terminal_application (gtk_entry_get_text (GTK_ENTRY (extconf_exec)));
+	set_desktop_opens_home_dir (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (extconf_desktophomedir)));
+
+	gtk_widget_destroy (GTK_WIDGET (extconf_dialog));
+}
+
+static void
+caja_open_terminal_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_background_items = caja_open_terminal_get_background_items;
+	iface->get_file_items = caja_open_terminal_get_file_items;
+}
+
+static void
+caja_open_terminal_configurable_iface_init (CajaConfigurableIface *iface)
+{
+	iface->run_config = caja_open_terminal_run_config;
+}
+
+static void
+caja_open_terminal_instance_init (CajaOpenTerminal *cvs)
+{
+}
+
+static void
+caja_open_terminal_class_init (CajaOpenTerminalClass *class)
+{
+}
+
+GType
+caja_open_terminal_get_type (void)
+{
+	return terminal_type;
+}
+
+void
+caja_open_terminal_register_type (GTypeModule *module)
+{
+	static const GTypeInfo info = {
+		sizeof (CajaOpenTerminalClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) caja_open_terminal_class_init,
+		NULL,
+		NULL,
+		sizeof (CajaOpenTerminal),
+		0,
+		(GInstanceInitFunc) caja_open_terminal_instance_init,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_open_terminal_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo configurable_iface_info = {
+		(GInterfaceInitFunc) caja_open_terminal_configurable_iface_init,
+		NULL,
+		NULL
+	};
+
+	terminal_type = g_type_module_register_type (module,
+						     G_TYPE_OBJECT,
+						     "CajaOpenTerminal",
+						     &info, 0);
+
+	g_type_module_add_interface (module,
+				     terminal_type,
+				     CAJA_TYPE_MENU_PROVIDER,
+				     &menu_provider_iface_info);
+
+	g_type_module_add_interface (module,
+				     terminal_type,
+				     CAJA_TYPE_CONFIGURABLE,
+				     &configurable_iface_info);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/17.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/17.html new file mode 100644 index 0000000..a52351d --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/17.html @@ -0,0 +1,345 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
/*
+ *  caja-open-terminal.h
+ *
+ *  Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Christian Neumair <chris@gnome-de.org>
+ *
+ */
+
+#ifndef CAJA_OPEN_TERMINAL_H
+#define CAJA_OPEN_TERMINAL_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* Declarations for the open terminal extension object.  This object will be
+ * instantiated by caja.  It implements the GInterfaces
+ * exported by libcaja. */
+
+#define CAJA_TYPE_OPEN_TERMINAL	  (caja_open_terminal_get_type ())
+#define CAJA_OPEN_TERMINAL(o)	  (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_OPEN_TERMINAL, CajaOpenTerminal))
+#define CAJA_IS_OPEN_TERMINAL(o)	  (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_OPEN_TERMINAL))
+typedef struct _CajaOpenTerminal      CajaOpenTerminal;
+typedef struct _CajaOpenTerminalClass CajaOpenTerminalClass;
+
+struct _CajaOpenTerminal {
+	GObject parent_slot;
+};
+
+struct _CajaOpenTerminalClass {
+	GObjectClass parent_slot;
+};
+
+GType caja_open_terminal_get_type      (void);
+void  caja_open_terminal_register_type (GTypeModule *module);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/18.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/18.html new file mode 100644 index 0000000..59bff7d --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/18.html @@ -0,0 +1,359 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
/*
+ *  open-terminal.c
+ *
+ *  Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Christian Neumair <chris@gnome-de.org>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-open-terminal.h"
+
+static GType type_list[1];
+
+void
+caja_module_initialize (GTypeModule *module)
+{
+	g_print ("Initializing caja-open-terminal extension\n");
+
+	caja_open_terminal_register_type (module);
+	type_list[0] = CAJA_TYPE_OPEN_TERMINAL;
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+	g_print ("Shutting down caja-open-terminal extension\n");
+}
+
+void
+caja_module_list_types (const GType **types,
+			    int          *num_types)
+{
+	*types = type_list;
+	*num_types = G_N_ELEMENTS (type_list);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/19.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/19.html new file mode 100644 index 0000000..8c7279c --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/19.html @@ -0,0 +1,565 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
/*
+ *  Caja-sendto
+ *
+ *  Copyright (C) 2004 Free Software Foundation, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Roberto Majadas <roberto.majadas@openshine.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-nste.h"
+
+static GObjectClass *parent_class;
+
+static void
+sendto_callback (CajaMenuItem *item,
+	      gpointer          user_data)
+{
+	GList            *files, *scan;
+	gchar            *uri;
+	GString          *cmd;
+
+	files = g_object_get_data (G_OBJECT (item), "files");
+
+	cmd = g_string_new ("caja-sendto");
+
+	for (scan = files; scan; scan = scan->next) {
+		CajaFileInfo *file = scan->data;
+
+		uri = caja_file_info_get_uri (file);
+		g_string_append_printf (cmd, " \"%s\"", uri);
+		g_free (uri);
+	}
+
+	g_spawn_command_line_async (cmd->str, NULL);
+
+	g_string_free (cmd, TRUE);
+}
+
+static GList *
+caja_nste_get_file_items (CajaMenuProvider *provider,
+			      GtkWidget            *window,
+			      GList                *files)
+{
+	GList    *items = NULL;
+	gboolean  one_item;
+	CajaMenuItem *item;
+
+	if (files == NULL)
+		return NULL;
+
+	one_item = (files != NULL) && (files->next == NULL);<--- Condition 'files!=NULL' is always true
+	if (one_item &&
+	    !caja_file_info_is_directory ((CajaFileInfo *)files->data)) {
+		item = caja_menu_item_new ("CajaNste::sendto",
+					       _("Send to..."),
+					       _("Send file by mail, instant message..."),
+					       "document-send");
+	} else {
+		item = caja_menu_item_new ("CajaNste::sendto",
+					       _("Send to..."),
+					       _("Send files by mail, instant message..."),
+					       "document-send");
+	}
+  g_signal_connect (item,
+      "activate",
+      G_CALLBACK (sendto_callback),
+      provider);
+  g_object_set_data_full (G_OBJECT (item),
+      "files",
+      caja_file_info_list_copy (files),
+      (GDestroyNotify) caja_file_info_list_free);
+
+  items = g_list_append (items, item);
+
+	return items;
+}
+
+static void
+caja_nste_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_file_items = caja_nste_get_file_items;
+}
+
+static void
+caja_nste_instance_init (CajaNste *nste)
+{
+}
+
+static void
+caja_nste_class_init (CajaNsteClass *class)
+{
+	parent_class = g_type_class_peek_parent (class);
+}
+
+static GType nste_type = 0;
+
+GType
+caja_nste_get_type (void)
+{
+	return nste_type;
+}
+
+void
+caja_nste_register_type (GTypeModule *module)
+{
+	static const GTypeInfo info = {
+		sizeof (CajaNsteClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) caja_nste_class_init,
+		NULL,
+		NULL,
+		sizeof (CajaNste),
+		0,
+		(GInstanceInitFunc) caja_nste_instance_init,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_nste_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	nste_type = g_type_module_register_type (module,
+					         G_TYPE_OBJECT,
+					         "CajaNste",
+					         &info, 0);
+
+	g_type_module_add_interface (module,
+				     nste_type,
+				     CAJA_TYPE_MENU_PROVIDER,
+				     &menu_provider_iface_info);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/2.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/2.html new file mode 100644 index 0000000..ae5d736 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/2.html @@ -0,0 +1,863 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
+# define SECTION __attribute__ ((section (".gresource.totemproperties"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[1725]; const double alignment; void * const ptr;}  totemproperties_resource_data = { {<--- union member 'Anonymous0::alignment' is never used.<--- union member 'Anonymous0::ptr' is never used.
+  0107, 0126, 0141, 0162, 0151, 0141, 0156, 0164, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0030, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0010, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 
+  0220, 0031, 0335, 0327, 0004, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0003, 0000, 0114, 0000, 
+  0004, 0001, 0000, 0000, 0010, 0001, 0000, 0000, 0201, 0321, 0040, 0031, 0003, 0000, 0000, 0000, 
+  0010, 0001, 0000, 0000, 0005, 0000, 0114, 0000, 0020, 0001, 0000, 0000, 0024, 0001, 0000, 0000, 
+  0211, 0027, 0242, 0266, 0000, 0000, 0000, 0000, 0024, 0001, 0000, 0000, 0015, 0000, 0166, 0000, 
+  0050, 0001, 0000, 0000, 0173, 0006, 0000, 0000, 0113, 0120, 0220, 0013, 0005, 0000, 0000, 0000, 
+  0173, 0006, 0000, 0000, 0004, 0000, 0114, 0000, 0200, 0006, 0000, 0000, 0204, 0006, 0000, 0000, 
+  0003, 0225, 0105, 0260, 0006, 0000, 0000, 0000, 0204, 0006, 0000, 0000, 0020, 0000, 0114, 0000, 
+  0224, 0006, 0000, 0000, 0230, 0006, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 
+  0230, 0006, 0000, 0000, 0001, 0000, 0114, 0000, 0234, 0006, 0000, 0000, 0240, 0006, 0000, 0000, 
+  0176, 0157, 0252, 0021, 0007, 0000, 0000, 0000, 0240, 0006, 0000, 0000, 0013, 0000, 0114, 0000, 
+  0254, 0006, 0000, 0000, 0260, 0006, 0000, 0000, 0137, 0144, 0153, 0207, 0001, 0000, 0000, 0000, 
+  0260, 0006, 0000, 0000, 0005, 0000, 0114, 0000, 0270, 0006, 0000, 0000, 0274, 0006, 0000, 0000, 
+  0165, 0151, 0057, 0000, 0002, 0000, 0000, 0000, 0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 0151, 0145, 0163, 0056, 0165, 
+  0151, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0164, 0166, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0135, 0115, 0223, 0243, 0066, 0020, 0275, 0357, 0257, 0040, 0134, 0123, 0036, 
+  0033, 0073, 0073, 0331, 0332, 0262, 0275, 0065, 0273, 0251, 0231, 0034, 0122, 0271, 0144, 0066, 
+  0125, 0071, 0271, 0004, 0310, 0266, 0142, 0131, 0042, 0222, 0360, 0307, 0376, 0372, 0025, 0037, 
+  0236, 0061, 0014, 0306, 0006, 0263, 0001, 0114, 0337, 0246, 0260, 0004, 0352, 0326, 0173, 0055, 
+  0272, 0365, 0304, 0214, 0077, 0355, 0326, 0324, 0330, 0140, 0041, 0011, 0147, 0023, 0323, 0272, 
+  0033, 0230, 0006, 0146, 0016, 0167, 0011, 0133, 0114, 0314, 0257, 0317, 0217, 0275, 0017, 0346, 
+  0247, 0351, 0273, 0361, 0117, 0275, 0236, 0361, 0204, 0031, 0026, 0110, 0141, 0327, 0330, 0022, 
+  0265, 0064, 0026, 0024, 0271, 0330, 0030, 0335, 0015, 0007, 0167, 0003, 0243, 0327, 0323, 0215, 
+  0010, 0123, 0130, 0314, 0221, 0203, 0247, 0357, 0014, 0143, 0054, 0360, 0177, 0076, 0021, 0130, 
+  0032, 0224, 0330, 0023, 0163, 0241, 0126, 0077, 0233, 0257, 0017, 0032, 0335, 0131, 0226, 0331, 
+  0017, 0333, 0161, 0373, 0137, 0354, 0050, 0303, 0241, 0110, 0312, 0211, 0371, 0244, 0126, 0237, 
+  0371, 0316, 0064, 0210, 0073, 0061, 0067, 0066, 0337, 0131, 0146, 0320, 0110, 0067, 0363, 0004, 
+  0367, 0260, 0120, 0173, 0203, 0241, 0065, 0236, 0230, 0133, 0342, 0252, 0345, 0054, 0170, 0006, 
+  0226, 0312, 0234, 0216, 0176, 0175, 0077, 0356, 0037, 0232, 0144, 0367, 0330, 0020, 0111, 0154, 
+  0212, 0315, 0351, 0263, 0360, 0361, 0271, 0306, 0016, 0142, 0263, 0071, 0167, 0174, 0151, 0116, 
+  0037, 0021, 0225, 0147, 0333, 0257, 0221, 0130, 0020, 0066, 0263, 0271, 0122, 0174, 0155, 0116, 
+  0255, 0341, 0271, 0016, 0066, 0027, 0056, 0026, 0263, 0320, 0014, 0163, 0172, 0177, 0256, 0071, 
+  0027, 0004, 0063, 0205, 0224, 0166, 0236, 0071, 0325, 0136, 0124, 0304, 0101, 0364, 0134, 0047, 
+  0351, 0041, 0107, 0317, 0243, 0036, 0316, 0207, 0067, 0115, 0235, 0045, 0241, 0156, 0364, 0167, 
+  0356, 0034, 0054, 0302, 0111, 0247, 0263, 0140, 0056, 0314, 0103, 0373, 0202, 0316, 0055, 0343, 
+  0340, 0322, 0116, 0310, 0165, 0304, 0175, 0146, 0353, 0204, 0057, 0262, 0375, 0361, 0007, 0262, 
+  0061, 0215, 0074, 0142, 0157, 0266, 0336, 0354, 0340, 0026, 0032, 0136, 0077, 0356, 0133, 0302, 
+  0067, 0145, 0375, 0223, 0325, 0057, 0032, 0220, 0241, 0004, 0142, 0222, 0042, 0205, 0364, 0203, 
+  0047, 0346, 0036, 0353, 0333, 0104, 0364, 0245, 0227, 0336, 0310, 0227, 0170, 0246, 0121, 0275, 
+  0362, 0275, 0142, 0003, 0337, 0041, 0112, 0026, 0172, 0176, 0006, 0047, 0073, 0040, 0245, 0004, 
+  0261, 0175, 0205, 0145, 0362, 0207, 0343, 0237, 0016, 0054, 0307, 0144, 0261, 0124, 0072, 0156, 
+  0040, 0352, 0207, 0244, 0241, 0156, 0024, 0065, 0216, 0372, 0364, 0263, 0357, 0067, 0356, 0107, 
+  0223, 0230, 0270, 0246, 0161, 0260, 0322, 0100, 0310, 0267, 0000, 0357, 0074, 0304, 0334, 0202, 
+  0176, 0237, 0023, 0112, 0213, 0071, 0312, 0343, 0222, 0104, 0120, 0076, 0341, 0052, 0175, 0065, 
+  0075, 0334, 0161, 0077, 0205, 0325, 0113, 0260, 0373, 0044, 0210, 0233, 0040, 0163, 0223, 0360, 
+  0052, 0370, 0166, 0226, 0117, 0317, 0314, 0247, 0161, 0352, 0257, 0331, 0153, 0307, 0267, 0361, 
+  0366, 0264, 0203, 0316, 0022, 0134, 0021, 0105, 0161, 0046, 0263, 0113, 0173, 0353, 0032, 0217, 
+  0345, 0054, 0067, 0122, 0041, 0241, 0362, 0254, 0057, 0026, 0041, 0236, 0003, 0303, 0077, 0026, 
+  0271, 0327, 0245, 0101, 0242, 0124, 0240, 0070, 0023, 0054, 0062, 0003, 0206, 0124, 0173, 0075, 
+  0027, 0207, 0170, 0101, 0224, 0176, 0206, 0223, 0216, 0030, 0171, 0121, 0343, 0160, 0133, 0307, 
+  0301, 0122, 0317, 0053, 0241, 0044, 0153, 0124, 0341, 0333, 0015, 0015, 0027, 0042, 0103, 0355, 
+  0275, 0203, 0123, 0173, 0163, 0056, 0264, 0143, 0365, 0334, 0140, 0025, 0303, 0350, 0304, 0263, 
+  0363, 0156, 0237, 0025, 0270, 0116, 0007, 0257, 0314, 0031, 0306, 0163, 0065, 0323, 0366, 0041, 
+  0147, 0171, 0316, 0275, 0251, 0236, 0212, 0173, 0227, 0164, 0314, 0210, 0114, 0231, 0321, 0251, 
+  0044, 0001, 0065, 0250, 0211, 0124, 0135, 0144, 0340, 0103, 0150, 0071, 0120, 0260, 0042, 0012, 
+  0106, 0100, 0152, 0061, 0007, 0255, 0332, 0070, 0350, 0372, 0042, 0164, 0156, 0027, 0131, 0370, 
+  0133, 0154, 0073, 0360, 0260, 0042, 0036, 0036, 0300, 0324, 0142, 0046, 0376, 0122, 0033, 0023, 
+  0367, 0030, 0211, 0056, 0262, 0360, 0037, 0155, 0067, 0060, 0260, 0042, 0006, 0006, 0040, 0152, 
+  0061, 0373, 0106, 0365, 0275, 0213, 0122, 0333, 0137, 0167, 0362, 0125, 0064, 0060, 0034, 0370, 
+  0127, 0325, 0233, 0150, 0340, 0315, 0026, 0023, 0160, 0130, 0033, 0001, 0243, 0064, 0372, 0377, 
+  0241, 0136, 0321, 0256, 0161, 0130, 0370, 0312, 0126, 0214, 0157, 0131, 0221, 0236, 0133, 0201, 
+  0112, 0260, 0104, 0142, 0252, 0375, 0204, 0112, 0231, 0211, 0051, 0045, 0236, 0044, 0337, 0164, 
+  0127, 0314, 0334, 0037, 0300, 0315, 0122, 0054, 0241, 0330, 0355, 0331, 0373, 0124, 0321, 0044, 
+  0016, 0267, 0265, 0263, 0305, 0152, 0153, 0351, 0004, 0350, 0322, 0021, 0272, 0044, 0052, 0145, 
+  0355, 0345, 0213, 0125, 0357, 0353, 0035, 0320, 0245, 0053, 0164, 0071, 0172, 0231, 0157, 0057, 
+  0133, 0206, 0265, 0226, 0042, 0156, 0216, 0054, 0267, 0017, 0373, 0243, 0012, 0122, 0173, 0121, 
+  0077, 0252, 0275, 0024, 0336, 0154, 0344, 0017, 0014, 0211, 0035, 0316, 0134, 0011, 0330, 0077, 
+  0306, 0176, 0152, 0037, 0243, 0275, 0370, 0257, 0257, 0000, 0355, 0360, 0365, 0032, 0263, 0116, 
+  0356, 0307, 0176, 0211, 0114, 0207, 0062, 0130, 0105, 0145, 0260, 0030, 0112, 0055, 0056, 0204, 
+  0275, 0257, 0233, 0206, 0220, 0254, 0164, 0144, 0345, 0112, 0206, 0335, 0366, 0056, 0134, 0165, 
+  0062, 0206, 0051, 0104, 0030, 0026, 0335, 0134, 0272, 0142, 0343, 0077, 0336, 0304, 0002, 0324, 
+  0224, 0370, 0177, 0137, 0077, 0232, 0233, 0212, 0343, 0172, 0122, 0360, 0013, 0020, 0333, 0224, 
+  0110, 0130, 0011, 0166, 0132, 0244, 0153, 0267, 0312, 0352, 0332, 0323, 0066, 0276, 0265, 0257, 
+  0260, 0155, 0305, 0354, 0052, 0244, 0325, 0117, 0331, 0223, 0260, 0345, 0342, 0163, 0066, 0033, 
+  0342, 0142, 0016, 0247, 0154, 0222, 0247, 0154, 0042, 0247, 0264, 0350, 0214, 0315, 0337, 0301, 
+  0200, 0341, 0204, 0115, 0167, 0117, 0330, 0204, 0210, 0205, 0363, 0065, 0371, 0365, 0124, 0242, 
+  0363, 0232, 0340, 0030, 0250, 0354, 0244, 0270, 0370, 0305, 0172, 0250, 0052, 0125, 0045, 0057, 
+  0176, 0161, 0051, 0034, 0267, 0051, 0301, 0307, 0215, 0303, 0135, 0354, 0164, 0063, 0107, 0326, 
+  0206, 0003, 0015, 0053, 0242, 0141, 0204, 0043, 0070, 0155, 0123, 0202, 0202, 0163, 0241, 0007, 
+  0023, 0174, 0133, 0241, 0213, 0054, 0174, 0014, 0214, 0067, 0002, 0353, 0201, 0212, 0025, 0121, 
+  0361, 0005, 0117, 0040, 0071, 0056, 0263, 0040, 0332, 0104, 0165, 0225, 0214, 0237, 0211, 0002, 
+  0052, 0126, 0272, 0052, 0206, 0065, 0214, 0030, 0121, 0160, 0004, 0347, 0252, 0174, 0261, 0351, 
+  0012, 0234, 0235, 0061, 0200, 0075, 0314, 0204, 0372, 0046, 0235, 0352, 0203, 0246, 0277, 0154, 
+  0176, 0326, 0154, 0354, 0377, 0331, 0177, 0000, 0344, 0037, 0043, 0077, 0221, 0124, 0203, 0062, 
+  0377, 0212, 0224, 0250, 0351, 0101, 0077, 0034, 0250, 0064, 0364, 0157, 0261, 0002, 0023, 0210, 
+  0160, 0114, 0204, 0164, 0152, 0013, 0272, 0373, 0022, 0053, 0100, 0342, 0035, 0262, 0341, 0174, 
+  0130, 0331, 0036, 0150, 0220, 0223, 0153, 0101, 0062, 0237, 0354, 0270, 0006, 0037, 0004, 0014, 
+  0265, 0012, 0030, 0254, 0037, 0044, 0140, 0100, 0276, 0113, 0100, 0300, 0220, 0022, 0060, 0104, 
+  0116, 0151, 0221, 0200, 0341, 0041, 0030, 0060, 0010, 0030, 0272, 0053, 0140, 0010, 0021, 0013, 
+  0002, 0206, 0134, 0152, 0113, 0264, 0366, 0150, 0147, 0267, 0153, 0376, 0012, 0255, 0207, 0042, 
+  0161, 0225, 0105, 0342, 0127, 0104, 0301, 0206, 0315, 0125, 0204, 0154, 0172, 0162, 0364, 0373, 
+  0267, 0006, 0351, 0242, 0053, 0113, 0160, 0336, 0004, 0104, 0110, 0362, 0113, 0174, 0212, 0002, 
+  0166, 0035, 0141, 0101, 0251, 0152, 0101, 0211, 0022, 0017, 0330, 0165, 0274, 0202, 0216, 0011, 
+  0017, 0102, 0315, 0255, 0155, 0237, 0172, 0201, 0232, 0333, 0325, 0014, 0000, 0135, 0050, 0254, 
+  0105, 0125, 0254, 0105, 0155, 0327, 0205, 0016, 0152, 0246, 0040, 0154, 0375, 0267, 0153, 0351, 
+  0271, 0215, 0255, 0377, 0372, 0120, 0357, 0054, 0021, 0143, 0230, 0166, 0362, 0170, 0320, 0227, 
+  0330, 0166, 0130, 0175, 0252, 0372, 0344, 0114, 0354, 0120, 0070, 0227, 0160, 0005, 0023, 0233, 
+  0236, 0377, 0034, 0130, 0163, 0213, 0305, 0265, 0124, 0064, 0354, 0270, 0226, 0014, 0324, 0003, 
+  0265, 0252, 0007, 0206, 0105, 0324, 0003, 0257, 0166, 0214, 0373, 0107, 0377, 0033, 0366, 0073, 
+  0007, 0021, 0153, 0222, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0157, 0162, 0147, 0057, 0000, 
+  0001, 0000, 0000, 0000, 0164, 0157, 0164, 0145, 0155, 0160, 0162, 0157, 0160, 0145, 0162, 0164, 
+  0151, 0145, 0163, 0057, 0000, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0145, 0170, 0164, 0145, 0156, 0163, 0151, 0157, 0156, 0163, 0057, 0000, 0004, 0000, 0000, 0000, 
+  0143, 0141, 0152, 0141, 0057, 0000, 0000, 0000, 0006, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { totemproperties_resource_data.data, sizeof (totemproperties_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *totemproperties_get_resource (void);
+GResource *totemproperties_get_resource (void)
+{
+  return g_static_resource_get_resource (&static_resource);
+}
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CONSTRUCTOR_H__
+#define __G_CONSTRUCTOR_H__
+
+/*
+  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
+  destructors, in a usable way, including e.g. on library unload. If not you're on
+  your own.
+
+  Some compilers need #pragma to handle this, which does not work with macros,
+  so the way you need to use this is (for constructors):
+
+  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
+  #endif
+  G_DEFINE_CONSTRUCTOR(my_constructor)
+  static void my_constructor(void) {
+   ...
+  }
+
+*/
+
+#ifndef __GTK_DOC_IGNORE__
+
+#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
+#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
+
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
+/* Visual studio 2008 and later has _Pragma */
+
+/*
+ * Only try to include gslist.h if not already included via glib.h,
+ * so that items using gconstructor.h outside of GLib (such as
+ * GResources) continue to build properly.
+ */
+#ifndef __G_LIB_H__
+#include "gslist.h"
+#endif
+
+#include <stdlib.h>
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* We do some weird things to avoid the constructors being optimized
+ * away on VS2015 if WholeProgramOptimization is enabled. First we
+ * make a reference to the array from the wrapper to make sure its
+ * references. Then we use a pragma to make sure the wrapper function
+ * symbol is always included at the link stage. Also, the symbols
+ * need to be extern (but not dllexport), even though they are not
+ * really used from another object file.
+ */
+
+/* We need to account for differences between the mangling of symbols
+ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
+ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+#ifdef _M_IX86
+#define G_MSVC_SYMBOL_PREFIX "_"
+#else
+#define G_MSVC_SYMBOL_PREFIX ""
+#endif
+
+#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
+#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
+
+#define G_MSVC_CTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
+  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
+
+#define G_MSVC_DTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
+   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined (_MSC_VER)
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* Pre Visual studio 2008 must use #pragma section */
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _wrapper(void) { _func(); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _constructor(void) { atexit (_func); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined(__SUNPRO_C)
+
+/* This is not tested, but i believe it should work, based on:
+ * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
+ */
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  init(_func)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void);
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  fini(_func)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void);
+
+#else
+
+/* constructors not supported for this compiler */
+
+#endif
+
+#endif /* __GTK_DOC_IGNORE__ */
+#endif /* __G_CONSTRUCTOR_H__ */
+
+#ifdef G_HAS_CONSTRUCTORS
+
+#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(totempropertiesresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(totempropertiesresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(totempropertiesresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(totempropertiesresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void totempropertiesresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void totempropertiesresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/20.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/20.html new file mode 100644 index 0000000..3357704 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/20.html @@ -0,0 +1,339 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
/*
+ *  Caja SendTo extension
+ *
+ *  Copyright (C) 2005 Roberto Majadas
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Roberto Majadas <roberto.majadas@openshine.com>
+ *
+ */
+
+#ifndef CAJA_NSTE_H
+#define CAJA_NSTE_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define CAJA_TYPE_NSTE  (caja_nste_get_type ())
+#define CAJA_NSTE(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_NSTE, CajaNste))
+#define CAJA_IS_NSTE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_NSTE))
+
+typedef struct _CajaNste      CajaNste;
+typedef struct _CajaNsteClass CajaNsteClass;
+
+struct _CajaNste {
+	GObject __parent;
+};
+
+struct _CajaNsteClass {
+	GObjectClass __parent;
+};
+
+GType caja_nste_get_type      (void);
+void  caja_nste_register_type (GTypeModule *module);
+
+G_END_DECLS
+
+#endif /* CAJA_NSTE_H */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/21.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/21.html new file mode 100644 index 0000000..2d24665 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/21.html @@ -0,0 +1,1961 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Copyright (C) 2004 Roberto Majadas
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Author:  Roberto Majadas <roberto.majadas@openshine.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gstdio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-sendto-plugin.h"
+
+#define CAJA_SENDTO_LAST_MEDIUM	"last-medium"
+#define CAJA_SENDTO_LAST_COMPRESS	"last-compress"
+#define CAJA_SENDTO_STATUS_LABEL_TIMEOUT_SECONDS 10
+
+#define UNINSTALLED_PLUGINDIR "plugins/removable-devices"
+
+#define SOEXT           ("." G_MODULE_SUFFIX)
+
+enum {
+	COLUMN_ICON,
+	COLUMN_DESCRIPTION,
+	NUM_COLUMNS,
+};
+
+/* Options */
+static char **filenames = NULL;
+
+GList *file_list = NULL;
+gboolean has_dirs = FALSE;
+GList *plugin_list = NULL;
+GHashTable *hash ;
+guint option = 0;
+
+static GSettings *settings = NULL;
+
+typedef struct _NS_ui NS_ui;
+
+struct _NS_ui {
+	GtkWidget *dialog;
+	GtkWidget *options_combobox;
+	GtkWidget *send_to_label;
+	GtkWidget *hbox_contacts_ws;
+	GtkWidget *cancel_button;
+	GtkWidget *send_button;
+	GtkWidget *pack_combobox;
+	GtkWidget *pack_checkbutton;
+	GtkWidget *pack_entry;
+	GList *contact_widgets;
+
+	GtkWidget *status_box;
+	GtkWidget *status_image;
+	GtkWidget *status_label;
+	guint status_timeoutid;
+};
+
+static const GOptionEntry entries[] = {
+	{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, "Files to send", "[FILES...]" },
+	{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
+};
+
+static void
+destroy_dialog (GtkWidget *widget, gpointer data )
+{
+        gtk_main_quit ();
+}
+
+static char *
+get_filename_from_list (void)
+{
+	GList *l;
+	GString *common_part = NULL;
+	gboolean matches = TRUE;
+	guint offset = 0;
+	const char *encoding;
+	gboolean use_utf8 = TRUE;
+
+	encoding = g_getenv ("G_FILENAME_ENCODING");
+
+	if (encoding != NULL && strcasecmp(encoding, "UTF-8") != 0)
+		use_utf8 = FALSE;
+
+	if (file_list == NULL)
+		return NULL;
+
+	common_part = g_string_new("");
+
+	while (TRUE) {
+		gunichar cur_char = '\0';
+		for (l = file_list; l ; l = l->next) {
+			char *path = NULL, *name = NULL;
+			char *offset_name = NULL;
+
+			path = g_filename_from_uri ((char *) l->data,
+					NULL, NULL);
+			if (!path)
+				break;
+
+			name = g_path_get_basename (path);
+
+			if (!use_utf8) {
+				char *tmp;
+
+				tmp = g_filename_to_utf8 (name, -1,
+						NULL, NULL, NULL);
+				g_free (name);
+				name = tmp;
+			}
+
+			if (!name) {
+				g_free (path);
+				break;
+			}
+
+			if (offset >= g_utf8_strlen (name, -1)) {
+				g_free(name);
+				g_free(path);
+				matches = FALSE;
+				break;
+			}
+
+			offset_name = g_utf8_offset_to_pointer (name, offset);
+
+			if (offset_name == g_utf8_strrchr (name, -1, '.')) {
+				g_free (name);
+				g_free (path);
+				matches = FALSE;
+				break;
+			}
+			if (cur_char == '\0') {
+				cur_char = g_utf8_get_char (offset_name);
+			} else if (cur_char != g_utf8_get_char (offset_name)) {
+				g_free (name);
+				g_free (path);
+				matches = FALSE;
+				break;
+			}
+			g_free (name);
+			g_free (path);
+		}
+		if (matches == TRUE && cur_char != '\0') {
+			offset++;
+			common_part = g_string_append_unichar (common_part,
+					cur_char);
+		} else {
+			break;
+		}
+	}
+
+	if (g_utf8_strlen (common_part->str, -1) < 4) {
+		g_string_free (common_part, TRUE);
+		return NULL;
+	}
+
+	return g_string_free (common_part, FALSE);
+}
+
+static char *
+pack_files (NS_ui *ui)
+{
+	char *engrampa_cmd;
+	const char *filename;
+	GList *l;
+	GString *cmd, *tmp;
+	char *pack_type, *tmp_dir, *tmp_work_dir, *packed_file;
+
+	engrampa_cmd = g_find_program_in_path ("engrampa");
+	filename = gtk_entry_get_text(GTK_ENTRY(ui->pack_entry));
+
+	g_assert (filename != NULL && *filename != '\0');
+
+	tmp_dir = g_strdup_printf ("%s/caja-sendto-%s",
+				   g_get_tmp_dir(), g_get_user_name());
+	g_mkdir (tmp_dir, 0700);
+	tmp_work_dir = g_strdup_printf ("%s/caja-sendto-%s/%li",
+					g_get_tmp_dir(), g_get_user_name(),
+					time(NULL));
+	g_mkdir (tmp_work_dir, 0700);
+	g_free (tmp_dir);
+
+	if (gtk_combo_box_get_active (GTK_COMBO_BOX(ui->pack_combobox)) != 0) {
+		pack_type = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(ui->pack_combobox));
+	} else {
+		pack_type = NULL;
+		g_assert_not_reached ();
+	}
+
+	g_settings_set_int (settings,
+			    CAJA_SENDTO_LAST_COMPRESS,
+			    gtk_combo_box_get_active(GTK_COMBO_BOX(ui->pack_combobox)));
+
+	cmd = g_string_new ("");
+	g_string_printf (cmd, "%s --add-to=\"%s/%s%s\"",
+			 engrampa_cmd, tmp_work_dir,
+			 filename,
+			 pack_type);
+	g_free (engrampa_cmd);
+
+	/* engrampa doesn't understand URIs */
+	for (l = file_list ; l; l=l->next){
+		char *file;
+
+		file = g_filename_from_uri (l->data, NULL, NULL);
+		g_string_append_printf (cmd," \"%s\"", file);
+		g_free (file);
+	}
+
+	g_spawn_command_line_sync (cmd->str, NULL, NULL, NULL, NULL);
+	g_string_free (cmd, TRUE);
+	tmp = g_string_new("");
+	g_string_printf (tmp,"%s/%s%s", tmp_work_dir,
+			 filename,
+			 pack_type);
+	g_free (pack_type);
+	g_free (tmp_work_dir);
+	packed_file = g_filename_to_uri (tmp->str, NULL, NULL);
+	g_string_free(tmp, TRUE);
+	return packed_file;
+}
+
+static gboolean
+status_label_clear (gpointer data)
+{
+	NS_ui *ui = (NS_ui *) data;
+	gtk_label_set_label (GTK_LABEL (ui->status_label), "");
+	gtk_widget_hide (ui->status_image);
+
+	ui->status_timeoutid = 0;
+
+	return FALSE;
+}
+
+static void
+send_button_cb (GtkWidget *widget, NS_ui *ui)
+{
+	char *error;
+	NstPlugin *p;
+	GtkWidget *w;
+
+	gtk_widget_set_sensitive (ui->dialog, FALSE);
+
+	p = (NstPlugin *) g_list_nth_data (plugin_list, option);
+	w = (GtkWidget *) g_list_nth_data (ui->contact_widgets, option);
+
+	if (ui->status_timeoutid != 0) {
+		g_source_remove (ui->status_timeoutid);
+		status_label_clear (ui);
+	}
+
+	if (p == NULL)
+		return;
+
+	if (p->info->validate_destination != NULL) {
+		error = NULL;
+		if (p->info->validate_destination (p, w, &error) == FALSE) {
+			char *message;
+
+			message = g_strdup_printf ("<b>%s</b>", error);
+			g_free (error);
+			gtk_label_set_markup (GTK_LABEL (ui->status_label), message);
+			g_free (message);
+			ui->status_timeoutid = g_timeout_add_seconds (CAJA_SENDTO_STATUS_LABEL_TIMEOUT_SECONDS,
+								      status_label_clear,
+								      ui);
+			gtk_widget_show (ui->status_image);
+			gtk_widget_show (ui->status_box);
+			gtk_widget_set_sensitive (ui->dialog, TRUE);
+			return;
+		}
+	}
+
+	g_settings_set_string (settings,
+			       CAJA_SENDTO_LAST_MEDIUM,
+			       p->info->id);
+
+	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ui->pack_checkbutton))){
+		char *f;
+
+		f = pack_files (ui);
+		if (f != NULL) {
+			GList *packed_file = NULL;
+			packed_file = g_list_append (packed_file, f);
+			if (!p->info->send_files (p, w, packed_file)) {
+				g_free (f);
+				g_list_free (packed_file);
+				return;
+			}
+			g_list_free (packed_file);
+		} else {
+			gtk_widget_set_sensitive (ui->dialog, TRUE);
+			return;
+		}
+		g_free (f);
+	} else {
+		if (!p->info->send_files (p, w, file_list)) {
+			g_list_free_full (file_list, g_free);
+			file_list = NULL;
+			return;
+		}
+		g_list_free (file_list);
+		file_list = NULL;
+	}
+	destroy_dialog (NULL,NULL);
+}
+
+static void
+send_if_no_pack_cb (GtkWidget *widget, NS_ui *ui)
+{
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton))) {
+		if (gtk_widget_is_sensitive (ui->pack_entry)) {
+			gtk_widget_grab_focus (ui->pack_entry);
+		} else {
+			gtk_widget_grab_focus (ui->pack_checkbutton);
+		}
+	} else {
+		send_button_cb (widget, ui);
+	}
+}
+
+static void
+toggle_pack_check (GtkWidget *widget, NS_ui *ui)
+{
+	GtkToggleButton *t = GTK_TOGGLE_BUTTON (widget);
+	gboolean enabled, send_enabled;
+
+	enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (t));
+	gtk_widget_set_sensitive (ui->pack_combobox, enabled);
+	gtk_widget_set_sensitive (ui->pack_entry, enabled);
+
+	send_enabled = TRUE;
+
+	if (enabled) {
+		const char *filename;
+
+		filename = gtk_entry_get_text(GTK_ENTRY(ui->pack_entry));
+		if (filename == NULL || *filename == '\0')
+			send_enabled = FALSE;
+	}
+
+	gtk_widget_set_sensitive (ui->send_button, send_enabled);
+}
+
+static void
+option_changed (GtkComboBox *cb, NS_ui *ui)
+{
+	GtkWidget *w;
+	NstPlugin *p;
+	gboolean supports_dirs = FALSE;
+
+	w = g_list_nth_data (ui->contact_widgets, option);
+	option = gtk_combo_box_get_active (GTK_COMBO_BOX(cb));
+	gtk_widget_hide (w);
+	w = g_list_nth_data (ui->contact_widgets, option);
+	gtk_widget_show (w);
+
+	gtk_label_set_mnemonic_widget (GTK_LABEL (ui->send_to_label), w);
+
+	p = (NstPlugin *) g_list_nth_data (plugin_list, option);
+	supports_dirs = (p->info->capabilities & CAJA_CAPS_SEND_DIRECTORIES);
+
+	if (has_dirs == FALSE || supports_dirs != FALSE) {
+		gboolean toggle;
+
+		toggle = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton));
+		gtk_widget_set_sensitive (ui->pack_combobox, toggle);
+		gtk_widget_set_sensitive (ui->pack_entry, toggle);
+		gtk_widget_set_sensitive (ui->pack_checkbutton, TRUE);
+	} else {
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton), TRUE);
+		gtk_widget_set_sensitive (ui->pack_checkbutton, FALSE);
+	}
+}
+
+static void
+set_contact_widgets (NS_ui *ui)
+{
+	GList *aux ;
+	GtkWidget *w;
+	NstPlugin *p;
+
+	ui->contact_widgets = NULL;
+
+	for (aux = plugin_list; aux; aux = aux->next){
+		p = (NstPlugin *) aux->data;
+		w = p->info->get_contacts_widget(p);
+		gtk_box_pack_end (GTK_BOX(ui->hbox_contacts_ws),w, TRUE, TRUE, 0);
+		gtk_widget_hide (GTK_WIDGET(w));
+		ui->contact_widgets = g_list_append (ui->contact_widgets, w);
+		if (GTK_IS_ENTRY (w)) {
+			g_signal_connect_after (G_OBJECT (w), "activate",
+						G_CALLBACK (send_if_no_pack_cb), ui);
+		}
+	}
+}
+
+static gboolean
+set_model_for_options_combobox (NS_ui *ui)
+{
+	GdkPixbuf *pixbuf;
+        GtkTreeIter iter;
+        GtkListStore *model;
+	GtkIconTheme *it;
+	GtkCellRenderer *renderer;
+	GtkWidget *widget;
+	GList *aux;
+	NstPlugin *p;
+	char *last_used = NULL;
+	int i = 0;
+	gboolean last_used_support_dirs = FALSE;
+
+	it = gtk_icon_theme_get_default ();
+
+	model = gtk_list_store_new (NUM_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
+
+	last_used = g_settings_get_string (settings,
+					   CAJA_SENDTO_LAST_MEDIUM);
+
+	for (aux = plugin_list; aux; aux = aux->next) {
+		p = (NstPlugin *) aux->data;
+		pixbuf = gtk_icon_theme_load_icon (it, p->info->icon, 16,
+						   GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+		gtk_list_store_append (model, &iter);
+		gtk_list_store_set (model, &iter,
+		                    COLUMN_ICON, pixbuf,
+#ifdef ENABLE_NLS
+		                    COLUMN_DESCRIPTION, g_dgettext (p->info->gettext_package, p->info->description),
+#else
+		                    COLUMN_DESCRIPTION, p->info->description,
+#endif /* ENABLE_NLS */
+		                    -1);
+		if (last_used != NULL && !strcmp(last_used, p->info->id)) {
+			option = i;
+			last_used_support_dirs = (p->info->capabilities & CAJA_CAPS_SEND_DIRECTORIES);
+		}
+		i++;
+	}
+	g_free(last_used);
+
+	gtk_combo_box_set_model (GTK_COMBO_BOX(ui->options_combobox),
+				GTK_TREE_MODEL (model));
+	renderer = gtk_cell_renderer_pixbuf_new ();
+        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (ui->options_combobox),
+                                    renderer,
+                                    FALSE);
+        gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (ui->options_combobox),
+					renderer,
+                                        "pixbuf", COLUMN_ICON,
+                                        NULL);
+        renderer = gtk_cell_renderer_text_new ();
+        g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (ui->options_combobox),
+                                    renderer,
+                                    TRUE);
+        gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (ui->options_combobox),
+					renderer,
+                                        "text", COLUMN_DESCRIPTION,
+                                        NULL);
+
+	g_signal_connect (G_OBJECT (ui->options_combobox), "changed",
+			  G_CALLBACK (option_changed), ui);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (ui->options_combobox), option);
+
+	/* Grab the focus for the most recently used widget */
+	widget = g_list_nth_data (ui->contact_widgets, option);
+	gtk_widget_grab_focus (widget);
+
+	return last_used_support_dirs;
+}
+
+static void
+pack_entry_changed_cb (GObject *object, GParamSpec *spec, NS_ui *ui)
+{
+	gboolean send_enabled;
+
+	send_enabled = TRUE;
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton))) {
+		const char *filename;
+
+		filename = gtk_entry_get_text(GTK_ENTRY(ui->pack_entry));
+		if (filename == NULL || *filename == '\0')
+			send_enabled = FALSE;
+	}
+
+	gtk_widget_set_sensitive (ui->send_button, send_enabled);
+}
+
+static void
+update_button_image (GtkSettings *gtk_settings,
+                     GParamSpec  *spec,
+                     GtkWidget   *widget)
+{
+	gboolean show_images;
+
+	g_object_get (gtk_settings, "gtk-button-images", &show_images, NULL);
+	if (show_images == FALSE)
+		gtk_widget_hide (widget);
+	else
+		gtk_widget_show (widget);
+}
+
+static void
+caja_sendto_create_ui (void)
+{
+	GtkBuilder *builder;
+	GError* error = NULL;
+	NS_ui *ui;
+	gboolean one_file = FALSE;
+	gboolean supports_dirs;
+	GtkSettings *gtk_settings;
+	GtkWidget *button_image;
+
+	builder = gtk_builder_new ();
+	if (gtk_builder_add_from_resource (builder, "/org/mate/caja/extensions/sendto/caja-sendto.ui", &error) == 0) {
+		g_warning ("Could not parse UI definition: %s", error->message);
+		g_error_free (error);
+	}
+
+	ui = g_new0 (NS_ui, 1);
+
+	ui->hbox_contacts_ws = GTK_WIDGET (gtk_builder_get_object (builder, "hbox_contacts_widgets"));
+	ui->send_to_label = GTK_WIDGET (gtk_builder_get_object (builder, "send_to_label"));
+	ui->options_combobox = GTK_WIDGET (gtk_builder_get_object (builder, "options_combobox"));
+	ui->dialog = GTK_WIDGET (gtk_builder_get_object (builder, "caja_sendto_dialog"));
+	ui->cancel_button = GTK_WIDGET (gtk_builder_get_object (builder, "cancel_button"));
+	ui->send_button = GTK_WIDGET (gtk_builder_get_object (builder, "send_button"));
+	ui->pack_combobox = GTK_WIDGET (gtk_builder_get_object (builder, "pack_combobox"));
+	ui->pack_entry = GTK_WIDGET (gtk_builder_get_object (builder, "pack_entry"));
+	ui->pack_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "pack_checkbutton"));
+	ui->status_box = GTK_WIDGET (gtk_builder_get_object (builder, "status_box"));
+	ui->status_label = GTK_WIDGET (gtk_builder_get_object (builder, "status_label"));
+	ui->status_image = GTK_WIDGET (gtk_builder_get_object (builder, "status_image"));
+
+	gtk_settings = gtk_settings_get_default ();
+	button_image = GTK_WIDGET (gtk_builder_get_object (builder, "image1"));
+	g_signal_connect (G_OBJECT (gtk_settings), "notify::gtk-button-images",
+			  G_CALLBACK (update_button_image), button_image);
+	update_button_image (gtk_settings, NULL, button_image);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX(ui->pack_combobox),
+				  g_settings_get_int (settings,
+						      CAJA_SENDTO_LAST_COMPRESS));
+
+	if (file_list != NULL && file_list->next != NULL)
+		one_file = FALSE;
+	else if (file_list != NULL)
+		one_file = TRUE;
+
+	gtk_entry_set_text (GTK_ENTRY (ui->pack_entry), _("Files"));
+
+	if (one_file) {
+		char *filepath = NULL, *filename = NULL;
+
+		filepath = g_filename_from_uri ((char *)file_list->data,
+				NULL, NULL);
+
+		if (filepath != NULL)
+			filename = g_path_get_basename (filepath);
+		if (filename != NULL && filename[0] != '\0')
+			gtk_entry_set_text (GTK_ENTRY (ui->pack_entry), filename);
+
+		g_free (filename);
+		g_free (filepath);
+	} else {
+		char *filename = get_filename_from_list ();
+		if (filename != NULL && filename[0] != '\0') {
+			gtk_entry_set_text (GTK_ENTRY (ui->pack_entry),
+					filename);
+		}
+		g_free (filename);
+	}
+
+	set_contact_widgets (ui);
+	supports_dirs = set_model_for_options_combobox (ui);
+	g_signal_connect (G_OBJECT (ui->dialog), "destroy",
+                          G_CALLBACK (destroy_dialog), NULL);
+	g_signal_connect (G_OBJECT (ui->cancel_button), "clicked",
+			  G_CALLBACK (destroy_dialog), NULL);
+	g_signal_connect (G_OBJECT (ui->send_button), "clicked",
+			  G_CALLBACK (send_button_cb), ui);
+	g_signal_connect (G_OBJECT (ui->pack_entry), "activate",
+			  G_CALLBACK (send_button_cb), ui);
+	g_signal_connect (G_OBJECT (ui->pack_entry), "notify::text",
+			  G_CALLBACK (pack_entry_changed_cb), ui);
+	g_signal_connect (G_OBJECT (ui->pack_checkbutton), "toggled",
+			  G_CALLBACK (toggle_pack_check), ui);
+
+	g_object_unref (builder);
+
+	if (has_dirs == FALSE || supports_dirs != FALSE) {
+		gboolean toggle;
+
+		toggle = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton));
+		gtk_widget_set_sensitive (ui->pack_combobox, toggle);
+		gtk_widget_set_sensitive (ui->pack_entry, toggle);
+	} else {
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ui->pack_checkbutton), TRUE);
+		gtk_widget_set_sensitive (ui->pack_checkbutton, FALSE);
+	}
+
+	gtk_widget_show (ui->dialog);
+
+}
+
+static void
+caja_sendto_plugin_dir_process (const char *plugindir)
+{
+	GDir *dir;
+	const char *item;
+	NstPlugin *p = NULL;
+	gboolean (*nst_init_plugin)(NstPlugin *p);
+	GError *err = NULL;
+
+	dir = g_dir_open (plugindir, 0, &err);
+
+	if (dir == NULL) {
+		g_warning ("Can't open the plugins dir: %s", err ? err->message : "No reason");
+		if (err)
+			g_error_free (err);
+	} else {
+		while ((item = g_dir_read_name(dir))) {
+			if (g_str_has_suffix (item, SOEXT)) {
+				g_autofree gchar *module_path = NULL;
+
+				p = g_new0(NstPlugin, 1);
+
+				module_path = g_module_build_path (plugindir, item);
+				if (!module_path) {
+					g_free (p);
+					continue;
+				}
+
+				p->module = g_module_open (module_path, 0);
+			        if (!p->module) {
+                			g_warning ("error opening %s: %s", module_path, g_module_error ());
+					g_free (p);
+					continue;
+				}
+
+				if (!g_module_symbol (p->module, "nst_init_plugin", (gpointer *) &nst_init_plugin)) {
+			                g_warning ("error: %s", g_module_error ());
+					g_module_close (p->module);
+					g_free (p);
+					continue;
+				}
+
+				nst_init_plugin (p);
+				if (p->info->init(p)) {
+					plugin_list = g_list_append (plugin_list, p);
+				} else {
+					g_free (p);
+				}
+			}
+		}
+		g_dir_close (dir);
+	}
+}
+
+static gboolean
+caja_sendto_plugin_init (void)
+{
+	if (g_file_test (UNINSTALLED_PLUGINDIR, G_FILE_TEST_IS_DIR) != FALSE) {
+		/* Try to load the local plugins */
+		GError *err = NULL;
+		GDir *dir;
+		const char *item;
+
+		dir = g_dir_open ("plugins/", 0, &err);
+		if (dir == NULL) {
+			g_warning ("Can't open the plugins dir: %s", err ? err->message : "No reason");
+			if (err)
+				g_error_free (err);
+			return FALSE;
+		}
+		while ((item = g_dir_read_name(dir))) {
+			char *plugindir;
+
+			plugindir = g_strdup_printf ("plugins/%s/.libs/", item);
+			if (g_file_test (plugindir, G_FILE_TEST_IS_DIR) != FALSE)
+				caja_sendto_plugin_dir_process (plugindir);
+			g_free (plugindir);
+		}
+		g_dir_close (dir);
+	}
+
+	if (g_list_length (plugin_list) == 0)
+		caja_sendto_plugin_dir_process (PLUGINDIR);
+
+	return g_list_length (plugin_list) != 0;
+}
+
+static char *
+escape_ampersands_and_commas (const char *url)
+{
+	int i;
+	char *str, *ptr;
+
+	/* Count the number of ampersands & commas */
+	i = 0;
+	ptr = (char *) url;
+	while ((ptr = strchr (ptr, '&')) != NULL) {
+		i++;
+		ptr++;
+	}
+	ptr = (char *) url;
+	while ((ptr = strchr (ptr, ',')) != NULL) {
+		i++;
+		ptr++;
+	}
+
+	/* No ampersands or commas ? */
+	if (i == 0)
+		return NULL;
+
+	/* Replace the '&' */
+	str = g_malloc0 (strlen (url) - i + 3 * i + 1);
+	ptr = str;
+	for (i = 0; url[i] != '\0'; i++) {
+		if (url[i] == '&') {
+			*ptr++ = '%';
+			*ptr++ = '2';
+			*ptr++ = '6';
+		} else if (url[i] == ',') {
+			*ptr++ = '%';
+			*ptr++ = '2';
+			*ptr++ = 'C';
+		} else {
+			*ptr++ = url[i];
+		}
+	}
+
+	return str;
+}
+
+static void
+caja_sendto_init (void)
+{
+	int i;
+
+	if (g_module_supported() == FALSE)
+		g_error ("Could not initialize gmodule support");
+
+	for (i = 0; filenames != NULL && filenames[i] != NULL; i++) {
+		GFile *file;
+		char *filename, *escaped, *uri;
+
+		file = g_file_new_for_commandline_arg (filenames[i]);
+		filename = g_file_get_path (file);
+		g_object_unref (file);
+		if (filename == NULL)
+			continue;
+
+		if (g_file_test (filename, G_FILE_TEST_IS_DIR) != FALSE)
+			has_dirs = TRUE;
+
+		uri = g_filename_to_uri (filename, NULL, NULL);
+		g_free (filename);
+		escaped = escape_ampersands_and_commas (uri);
+
+		if (escaped == NULL) {
+			file_list = g_list_prepend (file_list, uri);
+		} else {
+			file_list = g_list_prepend (file_list, escaped);
+			g_free (uri);
+		}
+	}
+
+	if (file_list == NULL) {
+		g_print (_("Expects URIs or filenames to be passed as options\n"));
+		exit (1);
+	}
+
+	file_list = g_list_reverse (file_list);
+}
+
+int main (int argc, char **argv)
+{
+	GOptionContext *context;
+	GError *error = NULL;
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
+	context = g_option_context_new ("");
+	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+	g_option_context_add_group (context, gtk_get_option_group (TRUE));
+	if (g_option_context_parse (context, &argc, &argv, &error) == FALSE) {
+		g_print (_("Could not parse command-line options: %s\n"), error->message);
+		g_error_free (error);
+		return 1;
+	}
+
+	settings = g_settings_new ("org.mate.Caja.Sendto");
+	caja_sendto_init ();
+	if (caja_sendto_plugin_init () == FALSE) {
+		GtkWidget *error_dialog;
+
+		error_dialog =
+			gtk_message_dialog_new (NULL,
+						GTK_DIALOG_MODAL,
+						GTK_MESSAGE_ERROR,
+						GTK_BUTTONS_OK,
+						_("Could not load any plugins."));
+		gtk_message_dialog_format_secondary_text
+			(GTK_MESSAGE_DIALOG (error_dialog),
+			 _("Please verify your installation"));
+
+		gtk_window_set_title (GTK_WINDOW (error_dialog), ""); /* as per HIG */
+		gtk_container_set_border_width (GTK_CONTAINER (error_dialog), 5);
+		gtk_dialog_set_default_response (GTK_DIALOG (error_dialog),
+						 GTK_RESPONSE_OK);
+		gtk_dialog_run (GTK_DIALOG (error_dialog));
+		return 1;
+	}
+	caja_sendto_create_ui ();
+
+	gtk_main ();
+	g_object_unref(settings);
+
+	return 0;
+}
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/22.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/22.html new file mode 100644 index 0000000..99e2872 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/22.html @@ -0,0 +1,469 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Copyright (C) 2004 Roberto Majadas
+ * Copyright (C) 2009 Bastien Nocera <hadess@hadess.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Authors:  Roberto Majadas <roberto.majadas@openshine.com>
+ *           Bastien Nocera <hadess@hadess.net>
+ */
+
+#ifndef _CAJA_SENDTO_PLUGIN_H_
+#define _CAJA_SENDTO_PLUGIN_H_
+
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/**
+ * SECTION:caja-sendto-plugin
+ * @short_description: caja-sento plug-in
+ * @stability: Stable
+ * @include: bluetooth-plugin.h
+ *
+ * Plug-ins can be used to extend caja-sendto.
+ **/
+
+typedef struct _NstPluginInfo NstPluginInfo;
+typedef struct _NstPlugin NstPlugin;
+
+/**
+ * NstPluginCapabilities:
+ * @CAJA_CAPS_NONE: No capabilities
+ * @CAJA_CAPS_SEND_DIRECTORIES: The plugin can send whole directories without compression
+ * @CAJA_CAPS_SEND_IMAGES: The plugin only sends images which could be resized
+ *
+ * Capabilities of the plugin.
+ **/
+typedef enum {
+	CAJA_CAPS_NONE = 0,
+	CAJA_CAPS_SEND_DIRECTORIES = 1 << 0,
+	CAJA_CAPS_SEND_IMAGES = 1 << 1,
+} NstPluginCapabilities;
+
+/**
+ * NstPluginInfo:
+ * @icon: The icon name for the plugin selection drop-down
+ * @id: A unique ID representing the plugin
+ * @description: The label used in the plugin selection drop-down
+ * @gettext_package: The domain to use to translate the description, %NULL if the plugin is part of caja-sendto
+ * @capabilities: a bitmask of #NstPluginCapabilities
+ * @init: Check for dependencies, and return %FALSE if dependencies such as programs are missing.
+ * @get_contacts_widget: Return the contact widget, the widget to select the destination of the files
+ * @validate_destination: Validate whether the destination can receive the file. This callback is optional.
+ * @send_files: Actually send the files to the selected destination. The file list is a #GList of URI strings.
+ * @destroy: Free all the resources used by the plugin.
+ *
+ * A structure representing a caja-sendto plugin. You should also call NST_INIT_PLUGIN() on the plugin structure to export it.
+ **/
+struct _NstPluginInfo
+{
+	gchar                             *icon;
+	gchar                             *id;
+	gchar                             *description;
+	gchar                             *gettext_package;
+	NstPluginCapabilities              capabilities;
+	gboolean (*init)                  (NstPlugin *plugin);
+	GtkWidget* (*get_contacts_widget) (NstPlugin *plugin);
+	gboolean (*validate_destination)  (NstPlugin *plugin, GtkWidget *contact_widget, char **error);
+	gboolean (*send_files)            (NstPlugin *plugin,
+					   GtkWidget *contact_widget,
+					   GList *file_list);
+	gboolean (*destroy)               (NstPlugin *plugin) ;
+};
+
+/**
+ * NstPlugin:
+ * @module: the #GModule for the opened shared library
+ * @info: a #NstPluginInfo structure
+ *
+ * A structure as used in caja-sendto.
+ **/
+struct _NstPlugin
+{
+	GModule *module;
+	NstPluginInfo *info;
+};
+
+/**
+ * NST_INIT_PLUGIN:
+ * @plugininfo: a #NstPluginInfo structure representing the plugin
+ *
+ * Call this on an #NstPluginInfo structure to make it available to caja-sendto.
+ **/
+# define NST_INIT_PLUGIN(plugininfo)					\
+	gboolean nst_init_plugin(NstPlugin *plugin);			\
+        G_MODULE_EXPORT gboolean nst_init_plugin(NstPlugin *plugin) {	\
+		plugin->info = &(plugininfo);				\
+                return TRUE;						\
+        }
+
+#endif /* _CAJA_SENDTO_PLUGIN_H_ */
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/23.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/23.html new file mode 100644 index 0000000..e9693fd --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/23.html @@ -0,0 +1,361 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
/*
+ *  Caja SendTo
+ *
+ *  Copyright (C) 2005 Roberto Majadas
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Roberto Majadas <roberto.majadas@openshine.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-nste.h"
+
+void
+caja_module_initialize (GTypeModule*module)
+{
+	g_print ("Initializing caja-sendto extension\n");
+	caja_nste_register_type (module);
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+	g_print ("Shutting down caja-sendto extension\n");
+}
+
+void
+caja_module_list_types (const GType **types,
+			    int          *num_types)
+{
+	static GType type_list[1];
+
+	type_list[0] = CAJA_TYPE_NSTE;
+	*types = type_list;
+
+	*num_types = 1;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/24.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/24.html new file mode 100644 index 0000000..281057e --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/24.html @@ -0,0 +1,863 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
+# define SECTION __attribute__ ((section (".gresource.sendto"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[1719]; const double alignment; void * const ptr;}  sendto_resource_data = { {<--- union member 'Anonymous0::alignment' is never used.<--- union member 'Anonymous0::ptr' is never used.
+  0107, 0126, 0141, 0162, 0151, 0141, 0156, 0164, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0030, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0000, 0000, 0000, 0050, 0007, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0004, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 
+  0001, 0000, 0000, 0000, 0344, 0000, 0000, 0000, 0004, 0000, 0114, 0000, 0350, 0000, 0000, 0000, 
+  0354, 0000, 0000, 0000, 0324, 0265, 0002, 0000, 0377, 0377, 0377, 0377, 0354, 0000, 0000, 0000, 
+  0001, 0000, 0114, 0000, 0360, 0000, 0000, 0000, 0364, 0000, 0000, 0000, 0072, 0001, 0040, 0252, 
+  0003, 0000, 0000, 0000, 0364, 0000, 0000, 0000, 0007, 0000, 0114, 0000, 0374, 0000, 0000, 0000, 
+  0000, 0001, 0000, 0000, 0176, 0157, 0252, 0021, 0005, 0000, 0000, 0000, 0000, 0001, 0000, 0000, 
+  0013, 0000, 0114, 0000, 0014, 0001, 0000, 0000, 0020, 0001, 0000, 0000, 0201, 0321, 0040, 0031, 
+  0000, 0000, 0000, 0000, 0020, 0001, 0000, 0000, 0005, 0000, 0114, 0000, 0030, 0001, 0000, 0000, 
+  0034, 0001, 0000, 0000, 0137, 0144, 0153, 0207, 0004, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0044, 0001, 0000, 0000, 0050, 0001, 0000, 0000, 0057, 0342, 0160, 0066, 
+  0002, 0000, 0000, 0000, 0050, 0001, 0000, 0000, 0016, 0000, 0166, 0000, 0070, 0001, 0000, 0000, 
+  0266, 0006, 0000, 0000, 0157, 0162, 0147, 0057, 0004, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0163, 0145, 0156, 0144, 0164, 0157, 0057, 0000, 0006, 0000, 0000, 0000, 
+  0145, 0170, 0164, 0145, 0156, 0163, 0151, 0157, 0156, 0163, 0057, 0000, 0002, 0000, 0000, 0000, 
+  0155, 0141, 0164, 0145, 0057, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0143, 0141, 0152, 0141, 
+  0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0143, 0141, 0152, 0141, 0055, 0163, 0145, 0156, 
+  0144, 0164, 0157, 0056, 0165, 0151, 0000, 0000, 0301, 0074, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0033, 0333, 0162, 0342, 0066, 0364, 0175, 0277, 0302, 0325, 0153, 0007, 0010, 
+  0244, 0323, 0146, 0072, 0300, 0316, 0136, 0232, 0114, 0147, 0372, 0266, 0351, 0263, 0106, 0226, 
+  0117, 0100, 0033, 0041, 0271, 0222, 0014, 0041, 0137, 0137, 0331, 0046, 0004, 0007, 0371, 0042, 
+  0343, 0315, 0102, 0302, 0233, 0021, 0072, 0107, 0072, 0367, 0213, 0244, 0361, 0307, 0207, 0005, 
+  0017, 0226, 0240, 0064, 0223, 0142, 0202, 0206, 0375, 0013, 0024, 0200, 0240, 0062, 0142, 0142, 
+  0066, 0101, 0377, 0336, 0136, 0367, 0256, 0320, 0307, 0351, 0207, 0361, 0057, 0275, 0136, 0160, 
+  0003, 0002, 0024, 0061, 0020, 0005, 0053, 0146, 0346, 0301, 0214, 0223, 0010, 0202, 0313, 0376, 
+  0150, 0324, 0037, 0005, 0275, 0236, 0235, 0304, 0204, 0001, 0165, 0107, 0050, 0114, 0077, 0004, 
+  0301, 0130, 0301, 0177, 0011, 0123, 0240, 0003, 0316, 0302, 0011, 0232, 0231, 0373, 0137, 0321, 
+  0363, 0102, 0051, 0030, 0032, 0144, 0363, 0144, 0370, 0035, 0250, 0011, 0050, 0047, 0132, 0117, 
+  0320, 0215, 0271, 0377, 0173, 0101, 0146, 0200, 0002, 0026, 0115, 0020, 0113, 0077, 0207, 0050, 
+  0235, 0147, 0147, 0306, 0112, 0306, 0240, 0314, 0072, 0020, 0144, 0001, 0023, 0264, 0144, 0232, 
+  0205, 0034, 0320, 0364, 0126, 0045, 0060, 0036, 0074, 0375, 0353, 0236, 0114, 0211, 0300, 0167, 
+  0222, 0046, 0032, 0115, 0257, 0011, 0327, 0265, 0363, 0031, 0225, 0002, 0247, 0237, 0150, 0032, 
+  0131, 0260, 0005, 0010, 0323, 0323, 0040, 0242, 0042, 0334, 0170, 0220, 0357, 0276, 0031, 0041, 
+  0243, 0237, 0114, 0210, 0225, 0101, 0317, 0202, 0123, 0340, 0076, 0124, 0174, 0145, 0204, 0313, 
+  0131, 0116, 0006, 0045, 0337, 0011, 0116, 0331, 0140, 0044, 0216, 0362, 0361, 0156, 0166, 0151, 
+  0230, 0261, 0014, 0010, 0214, 0042, 0102, 0163, 0142, 0210, 0145, 0307, 0004, 0255, 0301, 0202, 
+  0177, 0263, 0253, 0005, 0267, 0262, 0337, 0357, 0167, 0043, 0062, 0307, 0332, 0353, 0030, 0360, 
+  0334, 0052, 0257, 0205, 0313, 0150, 0332, 0003, 0240, 0163, 0306, 0243, 0374, 0073, 0005, 0347, 
+  0126, 0305, 0347, 0222, 0107, 0240, 0006, 0233, 0011, 0203, 0235, 0031, 0371, 0354, 0040, 0063, 
+  0006, 0101, 0170, 0057, 0373, 0151, 0205, 0034, 0312, 0007, 0264, 0305, 0261, 0307, 0345, 0317, 
+  0073, 0377, 0372, 0263, 0323, 0005, 0263, 0040, 0152, 0306, 0004, 0346, 0160, 0147, 0011, 0033, 
+  0216, 0074, 0100, 0024, 0233, 0315, 0175, 0141, 0214, 0214, 0075, 0041, 0102, 0151, 0214, 0134, 
+  0064, 0005, 0222, 0212, 0131, 0171, 0022, 0143, 0275, 0007, 0232, 0132, 0067, 0142, 0030, 0045, 
+  0274, 0011, 0240, 0216, 0011, 0265, 0316, 0254, 0164, 0035, 0267, 0264, 0010, 0115, 0127, 0302, 
+  0104, 0001, 0331, 0021, 0213, 0123, 0160, 0211, 0045, 0103, 0024, 0305, 0327, 0126, 0204, 0056, 
+  0070, 0116, 0326, 0062, 0061, 0130, 0233, 0165, 0352, 0041, 0034, 0352, 0134, 0244, 0244, 0070, 
+  0126, 0276, 0341, 0047, 0173, 0116, 0275, 0001, 0016, 0363, 0241, 0227, 0260, 0256, 0315, 0204, 
+  0300, 0235, 0146, 0212, 0277, 0070, 0034, 0113, 0065, 0262, 0112, 0267, 0327, 0220, 0225, 0276, 
+  0240, 0012, 0050, 0260, 0045, 0150, 0034, 0301, 0035, 0111, 0270, 0361, 0307, 0220, 0171, 0162, 
+  0064, 0315, 0035, 0272, 0017, 0140, 0242, 0001, 0047, 0302, 0072, 0015, 0316, 0104, 0013, 0242, 
+  0011, 0137, 0221, 0265, 0306, 0172, 0056, 0127, 0170, 0263, 0207, 0152, 0024, 0273, 0136, 0275, 
+  0210, 0230, 0320, 0173, 0153, 0021, 0365, 0113, 0302, 0103, 0114, 0104, 0344, 0277, 0325, 0073, 
+  0306, 0271, 0077, 0124, 0054, 0065, 0313, 0315, 0373, 0242, 0212, 0050, 0347, 0356, 0013, 0016, 
+  0370, 0020, 0203, 0110, 0343, 0105, 0027, 0346, 0360, 0255, 0302, 0120, 0337, 0246, 0055, 0014, 
+  0317, 0312, 0354, 0124, 0346, 0141, 0027, 0312, 0354, 0042, 0337, 0115, 0172, 0031, 0331, 0136, 
+  0061, 0047, 0247, 0331, 0013, 0044, 0046, 0121, 0224, 0205, 0331, 0253, 0346, 0020, 0364, 0036, 
+  0247, 0271, 0127, 0165, 0124, 0363, 0365, 0022, 0016, 0246, 0356, 0061, 0164, 0337, 0063, 0324, 
+  0045, 0144, 0255, 0155, 0266, 0253, 0064, 0240, 0161, 0376, 0323, 0042, 0007, 0362, 0161, 0226, 
+  0327, 0052, 0113, 0260, 0137, 0305, 0241, 0125, 0062, 0250, 0324, 0037, 0343, 0007, 0302, 0331, 
+  0254, 0072, 0214, 0070, 0130, 0064, 0047, 0221, 0165, 0106, 0271, 0076, 0012, 0051, 0252, 0327, 
+  0165, 0062, 0313, 0315, 0260, 0117, 0351, 0146, 0322, 0132, 0004, 0271, 0346, 0037, 0300, 0270, 
+  0103, 0231, 0347, 0144, 0240, 0055, 0026, 0360, 0326, 0224, 0207, 0243, 0132, 0370, 0122, 0106, 
+  0270, 0231, 0161, 0243, 0130, 0204, 0312, 0246, 0037, 0310, 0213, 0056, 0370, 0121, 0127, 0340, 
+  0134, 0265, 0101, 0240, 0254, 0136, 0155, 0055, 0260, 0025, 0006, 0052, 0171, 0262, 0020, 0276, 
+  0110, 0052, 0145, 0343, 0226, 0317, 0027, 0271, 0010, 0145, 0352, 0371, 0262, 0144, 0110, 0306, 
+  0251, 0273, 0321, 0230, 0246, 0243, 0341, 0236, 0077, 0354, 0134, 0172, 0135, 0111, 0320, 0205, 
+  0147, 0336, 0064, 0376, 0327, 0347, 0034, 0315, 0362, 0217, 0132, 0063, 0043, 0306, 0020, 0072, 
+  0257, 0114, 0020, 0252, 0261, 0130, 0215, 0334, 0042, 0271, 0150, 0112, 0122, 0355, 0176, 0235, 
+  0251, 0364, 0241, 0172, 0365, 0211, 0332, 0332, 0360, 0237, 0074, 0133, 0336, 0246, 0331, 0106, 
+  0342, 0074, 0201, 0076, 0145, 0265, 0332, 0304, 0032, 0155, 0210, 0062, 0155, 0221, 0124, 0227, 
+  0021, 0001, 0046, 0372, 0317, 0266, 0250, 0075, 0213, 0316, 0112, 0077, 0050, 0140, 0041, 0005, 
+  0243, 0170, 0305, 0242, 0031, 0330, 0160, 0366, 0322, 0075, 0034, 0225, 0125, 0135, 0274, 0057, 
+  0253, 0072, 0233, 0120, 0245, 0011, 0031, 0054, 0137, 0337, 0204, 0116, 0111, 0323, 0207, 0307, 
+  0255, 0351, 0333, 0224, 0144, 0156, 0375, 0214, 0165, 0070, 0266, 0022, 0242, 0106, 0157, 0074, 
+  0221, 0076, 0145, 0355, 0367, 0252, 0353, 0374, 0131, 0131, 0162, 0140, 0321, 0132, 0170, 0247, 
+  0225, 0025, 0275, 0232, 0126, 0127, 0063, 0245, 0002, 0270, 0034, 0260, 0024, 0150, 0163, 0142, 
+  0221, 0126, 0252, 0117, 0176, 0257, 0131, 0045, 0132, 0025, 0051, 0216, 0253, 0012, 0055, 0165, 
+  0346, 0137, 0101, 0033, 0046, 0062, 0153, 0251, 0105, 0152, 0225, 0100, 0261, 0060, 0061, 0240, 
+  0113, 0245, 0266, 0235, 0262, 0131, 0170, 0005, 0331, 0311, 0127, 0260, 0044, 0074, 0261, 0077, 
+  0103, 0153, 0062, 0150, 0120, 0046, 0323, 0152, 0374, 0336, 0202, 0355, 0256, 0303, 0351, 0335, 
+  0066, 0071, 0261, 0176, 0375, 0271, 0005, 0165, 0156, 0101, 0265, 0157, 0101, 0175, 0256, 0354, 
+  0143, 0274, 0315, 0016, 0124, 0353, 0044, 0243, 0264, 0221, 0374, 0343, 0072, 0120, 0163, 0240, 
+  0205, 0023, 0271, 0354, 0230, 0200, 0246, 0243, 0245, 0307, 0162, 0207, 0324, 0326, 0051, 0172, 
+  0110, 0317, 0377, 0133, 0327, 0007, 0135, 0247, 0223, 0207, 0240, 0331, 0077, 0322, 0373, 0371, 
+  0245, 0131, 0207, 0055, 0210, 0110, 0221, 0025, 0146, 0042, 0262, 0352, 0153, 0244, 0072, 0216, 
+  0132, 0254, 0161, 0324, 0075, 0074, 0002, 0037, 0034, 0215, 0217, 0245, 0224, 0073, 0341, 0172, 
+  0315, 0317, 0003, 0172, 0024, 0151, 0173, 0214, 0372, 0113, 0030, 0265, 0336, 0361, 0201, 0220, 
+  0375, 0256, 0303, 0323, 0021, 0373, 0072, 0364, 0121, 0035, 0165, 0343, 0233, 0132, 0161, 0163, 
+  0113, 0356, 0314, 0232, 0273, 0261, 0350, 0116, 0254, 0272, 0241, 0145, 0067, 0254, 0365, 0333, 
+  0053, 0357, 0323, 0101, 0322, 0055, 0074, 0230, 0335, 0070, 0336, 0354, 0044, 0351, 0265, 0324, 
+  0370, 0140, 0051, 0247, 0327, 0004, 0227, 0200, 0323, 0103, 0315, 0337, 0274, 0360, 0060, 0003, 
+  0013, 0135, 0077, 0157, 0063, 0163, 0332, 0377, 0343, 0161, 0074, 0310, 0276, 0232, 0203, 0330, 
+  0230, 0335, 0017, 0037, 0107, 0255, 0340, 0146, 0355, 0226, 0173, 0360, 0007, 0173, 0144, 0161, 
+  0123, 0230, 0174, 0236, 0076, 0073, 0211, 0066, 0167, 0215, 0176, 0234, 0223, 0170, 0107, 0251, 
+  0325, 0271, 0237, 0370, 0306, 0372, 0211, 0066, 0114, 0305, 0012, 0264, 0076, 0367, 0023, 0217, 
+  0251, 0237, 0170, 0272, 0127, 0046, 0175, 0156, 0002, 0326, 0322, 0333, 0345, 0115, 0306, 0374, 
+  0326, 0205, 0041, 0046, 0321, 0070, 0254, 0275, 0331, 0250, 0101, 0244, 0173, 0133, 0202, 0047, 
+  0023, 0032, 0137, 0156, 0154, 0330, 0351, 0335, 0171, 0100, 0265, 0331, 0373, 0346, 0262, 0360, 
+  0161, 0366, 0176, 0033, 0267, 0113, 0252, 0136, 0056, 0145, 0057, 0220, 0172, 0240, 0224, 0124, 
+  0257, 0161, 0035, 0372, 0255, 0037, 0026, 0354, 0136, 0072, 0312, 0125, 0250, 0054, 0304, 0235, 
+  0266, 0012, 0225, 0307, 0270, 0354, 0237, 0067, 0251, 0112, 0357, 0055, 0116, 0134, 0266, 0215, 
+  0023, 0105, 0032, 0213, 0257, 0025, 0363, 0227, 0156, 0275, 0315, 0125, 0212, 0055, 0104, 0141, 
+  0070, 0260, 0071, 0122, 0054, 0205, 0266, 0273, 0351, 0375, 0216, 0246, 0205, 0127, 0143, 0066, 
+  0161, 0331, 0235, 0132, 0217, 0340, 0322, 0152, 0367, 0363, 0053, 0033, 0047, 0370, 0213, 0101, 
+  0135, 0174, 0244, 0152, 0353, 0300, 0347, 0207, 0306, 0377, 0003, 0111, 0326, 0104, 0031, 0000, 
+  0050, 0165, 0165, 0141, 0171, 0051
+} };
+
+static GStaticResource static_resource = { sendto_resource_data.data, sizeof (sendto_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *sendto_get_resource (void);
+GResource *sendto_get_resource (void)
+{
+  return g_static_resource_get_resource (&static_resource);
+}
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CONSTRUCTOR_H__
+#define __G_CONSTRUCTOR_H__
+
+/*
+  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
+  destructors, in a usable way, including e.g. on library unload. If not you're on
+  your own.
+
+  Some compilers need #pragma to handle this, which does not work with macros,
+  so the way you need to use this is (for constructors):
+
+  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
+  #endif
+  G_DEFINE_CONSTRUCTOR(my_constructor)
+  static void my_constructor(void) {
+   ...
+  }
+
+*/
+
+#ifndef __GTK_DOC_IGNORE__
+
+#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
+#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
+
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
+/* Visual studio 2008 and later has _Pragma */
+
+/*
+ * Only try to include gslist.h if not already included via glib.h,
+ * so that items using gconstructor.h outside of GLib (such as
+ * GResources) continue to build properly.
+ */
+#ifndef __G_LIB_H__
+#include "gslist.h"
+#endif
+
+#include <stdlib.h>
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* We do some weird things to avoid the constructors being optimized
+ * away on VS2015 if WholeProgramOptimization is enabled. First we
+ * make a reference to the array from the wrapper to make sure its
+ * references. Then we use a pragma to make sure the wrapper function
+ * symbol is always included at the link stage. Also, the symbols
+ * need to be extern (but not dllexport), even though they are not
+ * really used from another object file.
+ */
+
+/* We need to account for differences between the mangling of symbols
+ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
+ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+#ifdef _M_IX86
+#define G_MSVC_SYMBOL_PREFIX "_"
+#else
+#define G_MSVC_SYMBOL_PREFIX ""
+#endif
+
+#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
+#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
+
+#define G_MSVC_CTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
+  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
+
+#define G_MSVC_DTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
+   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined (_MSC_VER)
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* Pre Visual studio 2008 must use #pragma section */
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _wrapper(void) { _func(); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _constructor(void) { atexit (_func); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined(__SUNPRO_C)
+
+/* This is not tested, but i believe it should work, based on:
+ * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
+ */
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  init(_func)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void);
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  fini(_func)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void);
+
+#else
+
+/* constructors not supported for this compiler */
+
+#endif
+
+#endif /* __GTK_DOC_IGNORE__ */
+#endif /* __G_CONSTRUCTOR_H__ */
+
+#ifdef G_HAS_CONSTRUCTORS
+
+#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(sendtoresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(sendtoresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(sendtoresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(sendtoresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void sendtoresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void sendtoresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/25.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/25.html new file mode 100644 index 0000000..f7084c2 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/25.html @@ -0,0 +1,289 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26

+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#include <caja-sendto-plugin.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "nst-enum-types.h"
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* enumerations from "caja-sendto-plugin.h" */
+GType
+nst_plugin_capabilities_get_type (void)
+{
+  static GType etype = 0;
+  if (etype == 0) {
+    static const GFlagsValue values[] = {
+      { CAJA_CAPS_NONE, "CAJA_CAPS_NONE", "none" },
+      { CAJA_CAPS_SEND_DIRECTORIES, "CAJA_CAPS_SEND_DIRECTORIES", "send-directories" },
+      { CAJA_CAPS_SEND_IMAGES, "CAJA_CAPS_SEND_IMAGES", "send-images" },
+      { 0, NULL, NULL }
+    };
+    etype = g_flags_register_static ("NstPluginCapabilities", values);
+  }
+  return etype;
+}
+
+/* Generated data ends here */
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/26.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/26.html new file mode 100644 index 0000000..305f197 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/26.html @@ -0,0 +1,273 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18

+/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
+
+#ifndef __NST_ENUM_TYPES_H__
+#define __NST_ENUM_TYPES_H__
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+/* enumerations from "caja-sendto-plugin.h" */
+GType nst_plugin_capabilities_get_type (void);
+#define NST_TYPE_PLUGIN_CAPABILITIES (nst_plugin_capabilities_get_type())
+G_END_DECLS
+
+#endif /* __NST_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/27.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/27.html new file mode 100644 index 0000000..d28abad --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/27.html @@ -0,0 +1,659 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Copyright (C) 2008 Jader Henrique da Silva
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Author:  Jader Henrique da Silva <vovozito@gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "nst-common.h"<--- Include file: "nst-common.h" not found.
+#include "caja-sendto-plugin.h"<--- Include file: "caja-sendto-plugin.h" not found.
+
+enum {
+	COL_PIXBUF,
+	COL_LABEL,
+	NUM_COLS,
+};
+
+#define COMBOBOX_OPTION_NEW_DVD 0
+#define COMBOBOX_OPTION_EXISTING_DVD 1
+
+static GFile *burn = NULL;
+
+static
+gboolean init (NstPlugin *plugin)
+{
+	GtkIconTheme *it;
+	char *cmd;
+
+	g_print ("Init caja burn plugin\n");
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+	it = gtk_icon_theme_get_default ();
+	gtk_icon_theme_append_search_path (it, DATADIR "/brasero/icons");
+
+	cmd = g_find_program_in_path ("brasero");
+	if (cmd == NULL)
+		return FALSE;
+	g_free (cmd);
+
+	burn = g_file_new_for_uri ("burn:/");
+
+	return TRUE;
+}
+
+static
+GtkWidget* get_contacts_widget (NstPlugin *plugin)
+{
+	GtkWidget *widget;
+	GtkCellRenderer *renderer;
+	GtkListStore *store;
+	GtkTreeModel *model;
+	GFileEnumerator *fenum;
+	GFileInfo *file_info = NULL;
+	int selection = COMBOBOX_OPTION_NEW_DVD;
+
+	fenum = g_file_enumerate_children (burn,
+					   G_FILE_ATTRIBUTE_STANDARD_NAME,
+					   G_FILE_QUERY_INFO_NONE,
+					   NULL,
+					   NULL);
+
+	if (fenum != NULL) {
+		file_info = g_file_enumerator_next_file (fenum, NULL, NULL);
+		g_object_unref (fenum);
+	}
+
+	store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
+
+	gtk_list_store_insert_with_values (store, NULL,
+					   INT_MAX,
+					   COL_PIXBUF, "media-optical-blank",
+					   COL_LABEL, _("New CD/DVD"),
+					   -1);
+
+	if (file_info != NULL) {
+		gtk_list_store_insert_with_values (store, NULL,
+						   INT_MAX,
+						   COL_PIXBUF, "media-optical-data-new",
+						   COL_LABEL, _("Existing CD/DVD"),
+						   -1);
+		g_object_unref (file_info);
+		selection = COMBOBOX_OPTION_EXISTING_DVD;
+	}
+
+	model = GTK_TREE_MODEL (store);
+	widget = gtk_combo_box_new_with_model (model);
+	renderer = gtk_cell_renderer_pixbuf_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget),
+				    renderer,
+				    FALSE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget),
+					renderer,
+					"icon-name", COL_PIXBUF,
+					NULL);
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget),
+				    renderer,
+				    TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget),
+					renderer,
+					"text", COL_LABEL,
+					NULL);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (widget), selection);
+
+	return widget;
+}
+
+static
+gboolean send_files (NstPlugin *plugin,
+		     GtkWidget *burntype_widget,
+		     GList *file_list)
+{
+	GFileEnumerator *fenum;
+	GFileInfo *file_info;
+	GFile *child;
+
+	if (gtk_combo_box_get_active (GTK_COMBO_BOX (burntype_widget)) == COMBOBOX_OPTION_NEW_DVD) {
+		fenum = g_file_enumerate_children (burn,
+						   G_FILE_ATTRIBUTE_STANDARD_NAME,
+						   G_FILE_QUERY_INFO_NONE,
+						   NULL,
+						   NULL);
+
+		if (fenum != NULL) {
+			while ((file_info = g_file_enumerator_next_file (fenum, NULL, NULL)) != NULL) {
+				child = g_file_get_child (burn,
+							  g_file_info_get_name(file_info));
+
+				g_object_unref (file_info);
+				g_file_delete (child, NULL, NULL);
+				g_object_unref (child);
+			}
+			g_object_unref (fenum);
+		}
+	}
+
+	copy_files_to (file_list, burn);
+
+	gtk_show_uri_on_window (NULL, "burn:///", GDK_CURRENT_TIME, NULL);
+
+	return TRUE;
+}
+
+static
+gboolean destroy (NstPlugin *plugin)
+{
+	g_object_unref (burn);
+	burn = NULL;
+	return TRUE;
+}
+
+static
+NstPluginInfo plugin_info = {
+	"brasero",
+	"caja-burn",
+	N_("CD/DVD Creator"),
+	NULL,
+	CAJA_CAPS_SEND_DIRECTORIES,
+	init,
+	get_contacts_widget,
+	NULL,
+	send_files,
+	destroy
+};
+
+NST_INIT_PLUGIN (plugin_info)
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/28.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/28.html new file mode 100644 index 0000000..d83f901 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/28.html @@ -0,0 +1,801 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Copyright (C) 2004 Roberto Majadas <roberto.majadas@openshine.com>
+ * Copyright (C) 2012 Stefano Karapetsas <stefano@karapetsas.com>
+ * Copyright (C) 2012-2021 MATE developers.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Authors:  Roberto Majadas <roberto.majadas@openshine.com>
+ *           Stefano Karapetsas <stefano@karapetsas.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-sendto-plugin.h"<--- Include file: "caja-sendto-plugin.h" not found.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef enum {
+	MAILER_UNKNOWN,
+	MAILER_EVO,
+	MAILER_BALSA,
+	MAILER_SYLPHEED,
+	MAILER_THUNDERBIRD,
+} MailerType;
+
+static char *mail_cmd = NULL;
+static MailerType type = MAILER_UNKNOWN;
+
+static char *
+get_evo_cmd (void)
+{
+	char *tmp = NULL;
+	char *retval;
+	char *cmds[] = {"evolution",
+		"evolution-2.0",
+		"evolution-2.2",
+		"evolution-2.4",
+		"evolution-2.6",
+		"evolution-2.8", /* for the future */
+		"evolution-3.0", /* but how far to go ? */
+		NULL};
+	guint i;
+
+	for (i = 0; cmds[i] != NULL; i++) {
+		tmp = g_find_program_in_path (cmds[i]);
+		if (tmp != NULL)
+			break;
+	}
+
+	if (tmp == NULL)
+		return NULL;
+
+	retval = g_strdup_printf ("%s --component=mail %%s", tmp);
+	g_free (tmp);
+	return retval;
+}
+
+static gboolean
+init (NstPlugin *plugin)
+{
+	GAppInfo *app_info = NULL;
+
+	g_print ("Init email client plugin\n");
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+	app_info = g_app_info_get_default_for_uri_scheme ("mailto");
+	if (app_info) {
+		mail_cmd = g_strdup(g_app_info_get_executable (app_info));
+		g_object_unref (app_info);
+	}
+
+	if (mail_cmd == NULL || *mail_cmd == '\0') {
+		g_free (mail_cmd);
+		mail_cmd = get_evo_cmd ();
+		type = MAILER_EVO;
+	} else {
+		/* Find what the default mailer is */
+		if (strstr (mail_cmd, "balsa"))
+			type = MAILER_BALSA;
+		else if (strstr (mail_cmd, "thunder") || strstr (mail_cmd, "seamonkey")) {
+			char **strv;
+
+			type = MAILER_THUNDERBIRD;
+
+			/* Thunderbird sucks, see
+			 * https://bugzilla.gnome.org/show_bug.cgi?id=614222 */
+			strv = g_strsplit (mail_cmd, " ", -1);
+			g_free (mail_cmd);
+			mail_cmd = g_strdup_printf ("%s %%s", strv[0]);
+			g_strfreev (strv);
+		} else if (strstr (mail_cmd, "sylpheed") || strstr (mail_cmd, "claws"))
+			type = MAILER_SYLPHEED;
+		else if (strstr (mail_cmd, "anjal") || strstr (mail_cmd, "evolution")) {
+			char *mail_cmd_aux = mail_cmd;
+			mail_cmd = g_strdup_printf ("%s %%s", mail_cmd_aux);
+			g_free (mail_cmd_aux);
+			type = MAILER_EVO;
+		}
+	}
+
+	if (mail_cmd == NULL)
+		return FALSE;
+
+	return TRUE;
+}
+
+static
+GtkWidget* get_contacts_widget (NstPlugin *plugin)
+{
+	GtkWidget *entry;
+
+	// TODO: add an email address format check
+	entry = gtk_entry_new();
+
+	return entry;
+}
+
+static void
+get_evo_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list)
+{
+	GList *l;
+
+	g_string_append (mailto, "mailto:");
+
+		const char *text;
+
+	text = gtk_entry_get_text (GTK_ENTRY (contact_widget));
+	if (text != NULL && *text != '\0')
+		g_string_append_printf (mailto, "\"%s\"", text);
+	else
+		g_string_append (mailto, "\"\"");
+
+	g_string_append_printf (mailto,"?attach=\"%s\"", (char *)file_list->data);
+	for (l = file_list->next ; l; l=l->next){
+		g_string_append_printf (mailto,"&attach=\"%s\"", (char *)l->data);
+	}
+}
+
+static void
+get_balsa_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list)
+{
+	GList *l;
+
+	if (strstr (mail_cmd, " -m ") == NULL && strstr (mail_cmd, " --compose=") == NULL)
+		g_string_append (mailto, " --compose=");
+
+	const char *text;
+
+	text = gtk_entry_get_text (GTK_ENTRY (contact_widget));
+	if (text != NULL && *text != '\0')
+		g_string_append_printf (mailto, "\"%s\"", text);
+	else
+		g_string_append (mailto, "\"\"");
+
+	g_string_append_printf (mailto," --attach=\"%s\"", (char *)file_list->data);
+	for (l = file_list->next ; l; l=l->next){
+		g_string_append_printf (mailto," --attach=\"%s\"", (char *)l->data);
+	}
+}
+
+static void
+get_thunderbird_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list)
+{
+	GList *l;
+
+	g_string_append (mailto, "-compose \"");
+
+	const char *text;
+
+	text = gtk_entry_get_text (GTK_ENTRY (contact_widget));
+	if (text != NULL && *text != '\0')
+		g_string_append_printf (mailto, "to='%s',", text);
+
+	g_string_append_printf (mailto,"attachment='%s", (char *)file_list->data);
+	for (l = file_list->next ; l; l=l->next){
+		g_string_append_printf (mailto,",%s", (char *)l->data);
+	}
+	g_string_append (mailto, "'\"");
+}
+
+static void
+get_sylpheed_mailto (GtkWidget *contact_widget, GString *mailto, GList *file_list)
+{
+	GList *l;
+
+	g_string_append (mailto, "--compose ");
+
+	const char *text;
+
+	text = gtk_entry_get_text (GTK_ENTRY (contact_widget));
+	if (text != NULL && *text != '\0')
+		g_string_append_printf (mailto, "\"%s\" ", text);
+	else
+		g_string_append (mailto, "\"\"");
+
+	g_string_append_printf (mailto,"--attach \"%s\"", (char *)file_list->data);
+	for (l = file_list->next ; l; l=l->next){
+		g_string_append_printf (mailto," \"%s\"", (char *)l->data);
+	}
+}
+
+static gboolean
+send_files (NstPlugin *plugin,
+	    GtkWidget *contact_widget,
+	    GList *file_list)
+{
+	gchar *cmd;
+	GString *mailto;
+
+	mailto = g_string_new ("");
+	switch (type) {
+	case MAILER_BALSA:
+		get_balsa_mailto (contact_widget, mailto, file_list);
+		break;
+	case MAILER_SYLPHEED:
+		get_sylpheed_mailto (contact_widget, mailto, file_list);
+		break;
+	case MAILER_THUNDERBIRD:
+		get_thunderbird_mailto (contact_widget, mailto, file_list);
+		break;
+	case MAILER_EVO:
+	default:
+		get_evo_mailto (contact_widget, mailto, file_list);
+	}
+
+	cmd = g_strdup_printf (mail_cmd, mailto->str);
+	g_string_free (mailto, TRUE);
+
+	g_message ("Mailer type: %d", type);
+	g_message ("Command: %s", cmd);
+
+	g_spawn_command_line_async (cmd, NULL);
+	g_free (cmd);
+
+	return TRUE;
+}
+
+static
+gboolean destroy (NstPlugin *plugin){
+	g_free (mail_cmd);
+	mail_cmd = NULL;
+	return TRUE;
+}
+
+static
+NstPluginInfo plugin_info = {
+	"emblem-mail",
+	"emailclient",
+	N_("Email"),
+	NULL,
+	CAJA_CAPS_NONE,
+	init,
+	get_contacts_widget,
+	NULL,
+	send_files,
+	destroy
+};
+
+NST_INIT_PLUGIN (plugin_info)
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/29.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/29.html new file mode 100644 index 0000000..d87de62 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/29.html @@ -0,0 +1,433 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Author:  Maxim Ermilov <ermilov.maxim@gmail.com>
+ */
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static gboolean
+copy_fobject (GFile* source, GFile* dst)
+{
+	GFileEnumerator* en;
+	GFileInfo* info;
+	GError *err = NULL;
+	char *file_name;
+	GFile *dest;
+
+	file_name = g_file_get_basename (source);
+	dest = g_file_get_child (dst, file_name);
+	g_free (file_name);
+
+	if (g_file_query_file_type (source, G_FILE_QUERY_INFO_NONE, NULL) != G_FILE_TYPE_DIRECTORY) {
+		gboolean ret;
+		ret = g_file_copy (source, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, NULL);
+
+		g_object_unref (dest);
+
+		return ret;
+	}
+
+	en = g_file_enumerate_children (source, "*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (!g_file_make_directory (dest, NULL, NULL)) {
+		g_object_unref (en);
+		g_object_unref (dest);
+		return FALSE;
+	}
+
+	while ((info = g_file_enumerator_next_file (en, NULL, &err)) != NULL) {
+		const char *name;
+
+		name = g_file_info_get_name (G_FILE_INFO (info));
+
+		if (name != NULL) {
+			GFile *child;
+
+			child = g_file_get_child (source, name);
+
+			if (!copy_fobject (child, dest)) {
+				g_object_unref (en);
+				g_object_unref (dest);
+				g_object_unref (child);
+
+				return FALSE;
+			}
+			g_object_unref (child);
+		}
+
+		g_object_unref (info);
+	}
+	g_object_unref (en);
+	g_object_unref (dest);
+
+	if (err != NULL)
+		return FALSE;
+	return TRUE;
+}
+
+gboolean
+copy_files_to (GList *file_list, GFile *dest)
+{
+	GList *l;
+	gboolean retval = TRUE;
+
+	for (l = file_list; l != NULL; l = l->next) {
+		GFile *source;
+
+		source = g_file_new_for_commandline_arg (l->data);
+		if (copy_fobject (source, dest) == FALSE)
+			retval = FALSE;
+		g_object_unref (source);
+	}
+
+	return retval;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/3.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/3.html new file mode 100644 index 0000000..ac88d6a --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/3.html @@ -0,0 +1,353 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
/*
+ * Copyright (C) 2003-2007 the GStreamer project
+ *      Julien Moutte <julien@moutte.net>
+ *      Ronald Bultje <rbultje@ronald.bitfreak.net>
+ * Copyright (C) 2005-2008 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright © 2009 Christian Persch
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ *
+ */
+
+#include "totem-gst-helpers.h"
+#include <gst/gstprotection.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Disable decoders that require a display environment to work,
+ * and that might cause crashes */
+void
+totem_gst_disable_display_decoders (void)
+{
+	GstRegistry *registry;
+	const char *blacklisted_plugins[] = {
+	  "bmcdec",
+	  "vaapi",
+	  "video4linux2"
+	};
+	guint i;
+
+	/* Disable the vaapi plugin as it will not work with the
+	 * fakesink we use:
+	 * See: https://bugzilla.gnome.org/show_bug.cgi?id=700186 and
+	 * https://bugzilla.gnome.org/show_bug.cgi?id=749605 */
+	registry = gst_registry_get ();
+
+	for (i = 0; i < G_N_ELEMENTS (blacklisted_plugins); i++) {
+		GstPlugin *plugin =
+			gst_registry_find_plugin (registry,
+						  blacklisted_plugins[i]);
+		if (plugin)
+			gst_registry_remove_plugin (registry, plugin);
+	}
+}
+
+/*
+ * vim: sw=2 ts=8 cindent noai bs=2
+ */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/30.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/30.html new file mode 100644 index 0000000..e6c3b0d --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/30.html @@ -0,0 +1,1215 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * pidgin.c
+ *       pidgin plugin for caja-sendto
+ *
+ * Copyright (C) 2004 Roberto Majadas
+ * Copyright (C) 2009 Pascal Terjan
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Author:  Roberto Majadas <roberto.majadas@openshine.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <dbus/dbus.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <dbus/dbus-glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-sendto-plugin.h"<--- Include file: "caja-sendto-plugin.h" not found.
+
+#define OBJ_PATH "/im/pidgin/purple/PurpleObject"
+#define INTERFACE "im.pidgin.purple.PurpleInterface"
+#define SERVICE "im.pidgin.purple.PurpleService"
+
+static DBusGProxy *proxy = NULL;
+static GHashTable *contact_hash = NULL;
+
+typedef struct _ContactData {
+	int  account;
+	int  id;
+	char *name;
+	char *alias;
+} ContactData;
+
+enum {
+	COL_ICON,
+	COL_ALIAS,
+	NUM_COLS
+};
+
+/*
+ * Print appropriate warnings when dbus raised error
+ * on queries
+ */
+static void
+handle_dbus_exception(GError *error)
+{
+	if (error == NULL) {
+		g_warning("[Pidgin] unable to parse result");
+		return;
+	}
+	else if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) {
+		g_warning ("[Pidgin] caught remote method exception %s: %s",
+			   dbus_g_error_get_name (error),
+			   error->message);
+	}
+	g_error_free (error);
+}
+
+static gboolean
+init (NstPlugin *plugin)
+{
+	DBusGConnection *connection;
+	GError *error;
+	GArray *accounts;
+
+	g_print ("Init pidgin plugin\n");
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+	error = NULL;
+	connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+	if(error != NULL) {
+		g_warning("[Pidgin] unable to get session bus, error was:\n %s", error->message);
+		g_error_free(error);
+		return FALSE;
+	}
+
+	proxy = dbus_g_proxy_new_for_name(connection,
+					  SERVICE,
+					  OBJ_PATH,
+					  INTERFACE);
+	dbus_g_connection_unref(connection);
+	if (proxy == NULL)
+		return FALSE;
+
+	error = NULL;
+	if (!dbus_g_proxy_call (proxy, "PurpleAccountsGetAllActive", &error, G_TYPE_INVALID,
+				DBUS_TYPE_G_INT_ARRAY, &accounts, G_TYPE_INVALID)) {
+		g_object_unref(proxy);
+		g_error_free(error);
+		return FALSE;
+	}
+	g_array_free(accounts, TRUE);
+
+	return TRUE;
+}
+
+static GdkPixbuf *
+get_buddy_icon(int id)
+{
+	GError *error;
+	GdkPixbuf *pixbuf = NULL;
+	gchar *path = NULL;
+	int icon;
+
+	error=NULL;
+	if (!dbus_g_proxy_call (proxy, "PurpleBuddyGetIcon", &error,
+				G_TYPE_INT, id,
+				G_TYPE_INVALID,
+				G_TYPE_INT, &icon, G_TYPE_INVALID)) {
+		handle_dbus_exception(error);
+	}
+	if (icon) {
+		if (!dbus_g_proxy_call (proxy, "PurpleBuddyIconGetFullPath", &error,
+					G_TYPE_INT, icon,
+					G_TYPE_INVALID,
+					G_TYPE_STRING, &path, G_TYPE_INVALID)) {
+			handle_dbus_exception(error);
+		}
+		//FIXME Get the size from somewhere
+		pixbuf = gdk_pixbuf_new_from_file_at_scale(path, 24, 24, TRUE, NULL);
+	}
+
+	return pixbuf;
+}
+
+static void
+add_pidgin_contacts_to_model (GtkTreeStore *store,
+			      GtkTreeIter *iter,
+			      GtkTreeIter *parent)
+{
+	GError *error;
+	GArray *contacts_list;
+	GArray *accounts;
+	int i, j;
+
+	GdkPixbuf *icon;
+	GHashTableIter hiter;
+	GPtrArray *contacts_group;
+	ContactData *dat;
+	GValue val = {0,};
+
+	if(proxy == NULL)
+		return;
+
+	error = NULL;
+	if (!dbus_g_proxy_call (proxy, "PurpleAccountsGetAllActive", &error, G_TYPE_INVALID,
+				DBUS_TYPE_G_INT_ARRAY,
+				&accounts, G_TYPE_INVALID)) {
+		handle_dbus_exception(error);
+		return;
+	}
+
+	contact_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+	for(i = 0; i < accounts->len; i++) {
+		int account = g_array_index(accounts, int, i);
+		error = NULL;
+		if (!dbus_g_proxy_call (proxy, "PurpleFindBuddies", &error,
+					G_TYPE_INT, account,
+					G_TYPE_STRING, NULL,
+					G_TYPE_INVALID,
+					DBUS_TYPE_G_INT_ARRAY, &contacts_list, G_TYPE_INVALID))	{
+			handle_dbus_exception(error);
+			continue;
+		}
+		for(j = 0; j < contacts_list->len ; j++) {
+			int id = g_array_index(contacts_list, int, j);
+			int online;
+
+			error = NULL;
+			if (!dbus_g_proxy_call (proxy, "PurpleBuddyIsOnline", &error,
+						G_TYPE_INT, id,
+						G_TYPE_INVALID,
+						G_TYPE_INT, &online, G_TYPE_INVALID)) {
+				handle_dbus_exception(error);
+				continue;
+			}
+			if (!online)
+				continue;
+
+			dat = g_new0 (ContactData, 1);
+
+			dat->account = account;
+			dat->id = id;
+
+			error = NULL;
+			if (!dbus_g_proxy_call (proxy, "PurpleBuddyGetName", &error,
+						G_TYPE_INT, id,
+						G_TYPE_INVALID,
+						G_TYPE_STRING, &dat->name, G_TYPE_INVALID)) {
+				handle_dbus_exception(error);
+				g_free(dat);
+				continue;
+			}
+			if (!dbus_g_proxy_call (proxy, "PurpleBuddyGetAlias", &error,
+						G_TYPE_INT, id,
+						G_TYPE_INVALID,
+						G_TYPE_STRING, &dat->alias, G_TYPE_INVALID)) {
+				handle_dbus_exception(error);
+			}
+
+			contacts_group = g_hash_table_lookup (contact_hash, dat->alias);
+			if (contacts_group == NULL){
+				GPtrArray *new_group = g_ptr_array_new ();
+				g_ptr_array_add (new_group, dat);
+				g_hash_table_insert (contact_hash, dat->alias, new_group);
+			} else {
+				g_ptr_array_add (contacts_group, dat);
+			}
+		}
+		g_array_free(contacts_list, TRUE);
+	}
+	g_array_free (accounts, TRUE);
+
+	g_hash_table_iter_init (&hiter, contact_hash);
+	while (g_hash_table_iter_next (&hiter, NULL, (gpointer)&contacts_group)) {
+		gint num_accounts;
+
+		dat = g_ptr_array_index (contacts_group, 0);
+
+		num_accounts = contacts_group->len;
+
+		gtk_tree_store_append (store, parent, NULL);
+		gtk_tree_store_set (store, parent, COL_ICON, NULL, COL_ALIAS, dat->alias, -1);
+
+		for (i = 0; i < num_accounts; ++i) {
+			dat = g_ptr_array_index (contacts_group, i);
+
+			icon = get_buddy_icon(dat->id);
+
+			if (num_accounts == 1) {
+				g_value_init(&val, GDK_TYPE_PIXBUF);
+				g_value_set_object (&val, (gpointer)icon);
+				gtk_tree_store_set_value (store, parent, COL_ICON, &val);
+				g_value_unset (&val);
+				break;
+			}
+			gtk_tree_store_append (store, iter, parent);
+			gtk_tree_store_set (store, iter,
+					    COL_ICON, icon,
+					    COL_ALIAS, dat->alias,
+					    -1);
+		}
+	}
+}
+
+static void
+customize (GtkCellLayout *cell_layout,
+	   GtkCellRenderer *cell,
+	   GtkTreeModel *tree_model,
+	   GtkTreeIter *iter,
+	   gpointer text)
+{
+	gboolean has_child;
+	has_child = gtk_tree_model_iter_has_child (tree_model, iter);
+	if (text) {
+		if (has_child)
+			g_object_set (G_OBJECT(cell), "xpad", 18, NULL);
+		else
+			g_object_set (G_OBJECT(cell), "xpad", 2, NULL);
+	}
+	g_object_set (G_OBJECT(cell), "sensitive", !has_child, NULL);
+}
+
+static GtkWidget *
+get_contacts_widget (NstPlugin *plugin)
+{
+	GtkWidget *cb;
+	GtkCellRenderer *renderer;
+	GtkTreeStore *store;
+	GtkTreeModel *model;
+	GtkTreeIter *iter, *iter2;
+
+	iter = g_malloc (sizeof(GtkTreeIter));
+	iter2 = g_malloc (sizeof(GtkTreeIter));
+	store = gtk_tree_store_new (NUM_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
+	add_pidgin_contacts_to_model (store, iter, iter2);
+	model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
+	gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), COL_ALIAS,
+					      GTK_SORT_ASCENDING);
+	cb = gtk_combo_box_new_with_model (model);
+
+	renderer = gtk_cell_renderer_pixbuf_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb),
+				    renderer,
+				    FALSE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb),
+					renderer,
+					"pixbuf", COL_ICON,
+					NULL);
+	gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (cb), renderer,
+					    customize,
+					    (gboolean *)FALSE, NULL);
+	renderer = gtk_cell_renderer_text_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb),
+				    renderer,
+				    TRUE);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb),
+					renderer,
+					"text", COL_ALIAS,
+					NULL);
+	g_object_set(renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+	gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (cb), renderer,
+					    customize,
+					    (gboolean *)TRUE, NULL);
+
+	gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0);
+	gtk_combo_box_get_active_iter (GTK_COMBO_BOX(cb), iter);
+	if (gtk_tree_model_iter_has_child (model, iter)) {
+		GtkTreePath *path = gtk_tree_path_new_from_indices (0, 0, -1);
+		gtk_tree_model_get_iter (model, iter2, path);
+		gtk_tree_path_free (path);
+		gtk_combo_box_set_active_iter (GTK_COMBO_BOX (cb), iter2);
+	}
+
+	g_free (iter);
+	g_free (iter2);
+	return cb;
+}
+
+static
+gboolean send_file(int account, const char *who, const char *filename)
+{
+	GError *error;
+	int connection;
+
+	error = NULL;
+	if (!dbus_g_proxy_call(proxy, "PurpleAccountGetConnection", &error,
+			       G_TYPE_INT, account,
+			       G_TYPE_INVALID,
+			       G_TYPE_INT, &connection, G_TYPE_INVALID)) {
+		handle_dbus_exception(error);
+		return FALSE;
+	}
+
+	if (!connection) {
+		g_warning("[Pidgin] account is not connected");
+		return FALSE;
+	}
+
+	error = NULL;
+	if (!dbus_g_proxy_call(proxy, "ServSendFile", &error,
+			       G_TYPE_INT, connection,
+			       G_TYPE_STRING, who,
+			       G_TYPE_STRING, filename,
+			       G_TYPE_INVALID, G_TYPE_INVALID)) {
+		handle_dbus_exception(error);
+		return FALSE;
+	}
+	return TRUE;
+}
+
+static
+gboolean send_files (NstPlugin *plugin, GtkWidget *contact_widget,
+		     GList *file_list)
+{
+	GList *file_iter;
+
+	GFile *file;
+	gchar *file_path;
+
+	gint depth;
+	GtkTreeIter iter;
+	GtkTreePath *path;
+	gint *indices;
+	const gchar *alias;
+	GPtrArray *contacts_group;
+	ContactData *dat;
+	GValue val = {0,};
+
+	if (proxy == NULL)
+		return FALSE;
+
+	gtk_combo_box_get_active_iter (GTK_COMBO_BOX (contact_widget), &iter);
+	path = gtk_tree_model_get_path (GTK_TREE_MODEL (
+		gtk_combo_box_get_model (GTK_COMBO_BOX(
+			contact_widget))), &iter);
+	depth = gtk_tree_path_get_depth(path);
+	indices = gtk_tree_path_get_indices(path);
+	gtk_tree_path_free (path);
+	gtk_tree_model_get_value (GTK_TREE_MODEL (gtk_combo_box_get_model (
+		    GTK_COMBO_BOX(contact_widget))),
+	    &iter, COL_ALIAS, &val);
+	alias = g_value_get_string (&val);
+	contacts_group = g_hash_table_lookup (contact_hash, alias);
+	g_value_unset (&val);
+	dat = g_ptr_array_index (contacts_group, (depth == 2) ? indices[1] : 0);
+
+	for (file_iter = file_list; file_iter != NULL;
+	    file_iter = g_list_next(file_iter)) {
+		file = g_file_new_for_uri ((gchar *)file_iter->data);
+		file_path = g_file_get_path (file);
+		g_object_unref (file);
+
+		if (file_path == NULL) {
+			g_warning("[Pidgin] Unable to convert URI `%s' to absolute file path",
+				  (gchar *)file_iter->data);
+			continue;
+		}
+
+		if (!send_file(dat->account, dat->name, file_path))
+			g_warning("[Pidgin] Failed to send %s file to %s", file_path, dat->name);
+
+		g_free (file_path);
+	}
+	return TRUE;
+}
+
+static void
+free_contact (ContactData *dat)
+{
+	g_free(dat->name);
+	g_free(dat->alias);
+	g_free(dat);
+}
+
+static gboolean
+destroy (NstPlugin *plugin)
+{
+	GHashTableIter iter;
+	GPtrArray *contacts_group;
+	ContactData *dat;
+
+	g_hash_table_iter_init (&iter, contact_hash);
+	while (g_hash_table_iter_next (&iter, NULL, (gpointer)&contacts_group)) {<--- Uninitialized variable: contacts_group
+		gint accounts;
+		accounts = contacts_group->len;
+
+		gint i;
+		for (i = 0; i < accounts; ++i) {
+			dat = g_ptr_array_index (contacts_group, i);
+			free_contact (dat);
+		}
+		g_ptr_array_free (contacts_group, TRUE);
+	}
+	g_hash_table_destroy (contact_hash);
+	return TRUE;
+}
+
+static
+NstPluginInfo plugin_info = {
+	"im",
+	"pidgin",
+	N_("Instant Message (Pidgin)"),
+	NULL,
+	CAJA_CAPS_NONE,
+	init,
+	get_contacts_widget,
+	NULL,
+	send_files,
+	destroy
+};
+
+NST_INIT_PLUGIN (plugin_info)
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/31.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/31.html new file mode 100644 index 0000000..2a549d0 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/31.html @@ -0,0 +1,765 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Authors:  Maxim Ermilov <ermilov.maxim@gmail.com>
+ *           Bastien Nocera <hadess@hadess.net>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "nst-common.h"<--- Include file: "nst-common.h" not found.
+#include "caja-sendto-plugin.h"<--- Include file: "caja-sendto-plugin.h" not found.
+
+enum {
+	NAME_COL,
+	ICON_COL,
+	MOUNT_COL,
+	NUM_COLS,
+};
+
+GVolumeMonitor* vol_monitor = NULL;
+GtkWidget *cb;
+
+static void
+cb_mount_removed (GVolumeMonitor *volume_monitor,
+		  GMount         *mount,
+		  NstPlugin      *plugin)
+{
+	GtkTreeIter iter;
+	GtkListStore *store;
+	gboolean b, found;
+
+	store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb)));
+	b = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
+	found = FALSE;
+
+	while (b) {
+		GMount *m;
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &m, -1);
+		if (m == mount) {
+			gtk_list_store_remove (store, &iter);
+			g_object_unref (m);
+			found = TRUE;
+			break;
+		}
+		g_object_unref (m);
+		b = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter);
+	}
+
+	/* If a mount was removed */
+	if (found != FALSE) {
+		/* And it was the selected one */
+		if (gtk_combo_box_get_active (GTK_COMBO_BOX (cb)) == -1) {
+			/* Select the first item in the list */
+			gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0);
+		}
+	}
+}
+
+static void
+cb_mount_changed (GVolumeMonitor *volume_monitor,
+		  GMount         *mount,
+		  NstPlugin      *plugin)
+{
+	GtkTreeIter iter;
+	gboolean b;
+	GtkListStore *store;
+
+	if (g_mount_is_shadowed (mount) != FALSE) {
+		cb_mount_removed (volume_monitor, mount, plugin);
+		return;
+	}
+
+	store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb)));
+	b = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
+
+	while (b) {
+		GMount *m;
+		gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &m, -1);
+
+		if (m == mount) {
+			char *name;
+
+			name = g_mount_get_name (mount);
+			gtk_list_store_set (store, &iter,
+					    NAME_COL, name,
+					    ICON_COL, g_mount_get_icon (mount),
+					    -1);
+			g_free (name);
+			g_object_unref (m);
+			break;
+		}
+		g_object_unref (m);
+		b = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter);
+	}
+}
+
+static void
+cb_mount_added (GVolumeMonitor *volume_monitor,
+		GMount         *mount,
+		NstPlugin      *plugin)
+{
+	char *name;
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+	gboolean select_added;
+
+	if (g_mount_is_shadowed (mount) != FALSE)
+		return;
+
+	name = g_mount_get_name (mount);
+	model = gtk_combo_box_get_model (GTK_COMBO_BOX (cb));
+
+	select_added = gtk_tree_model_iter_n_children (model, NULL) == 0;
+
+	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+	gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+			    NAME_COL, name,
+			    ICON_COL, g_mount_get_icon (mount),
+			    MOUNT_COL, mount,
+			    -1);
+
+	g_free (name);
+
+	if (select_added != FALSE)
+		gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0);
+
+}
+
+static gboolean
+init (NstPlugin *plugin)
+{
+	g_print ("Init removable-devices plugin\n");
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+	vol_monitor = g_volume_monitor_get ();
+	cb = gtk_combo_box_new ();
+
+	return TRUE;
+}
+
+static GtkWidget*
+get_contacts_widget (NstPlugin *plugin)
+{
+	GtkListStore *store;
+	GList *l, *mounts;
+	GtkTreeIter iter;
+	GtkCellRenderer *text_renderer, *icon_renderer;
+
+	mounts = g_volume_monitor_get_mounts (vol_monitor);
+
+	store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_ICON, G_TYPE_OBJECT);
+
+	for (l = mounts; l != NULL; l = l->next) {
+		char *name;
+
+		if (g_mount_is_shadowed (l->data) != FALSE) {
+			g_object_unref (l->data);
+			continue;
+		}
+
+		name = g_mount_get_name (l->data);
+
+		gtk_list_store_append (store, &iter);
+		gtk_list_store_set (store, &iter,
+				    NAME_COL, name,
+				    ICON_COL, g_mount_get_icon (l->data),
+				    MOUNT_COL, l->data,
+				    -1);
+		g_free (name);
+
+		g_object_unref (l->data);
+	}
+	g_list_free (mounts);
+
+	gtk_cell_layout_clear (GTK_CELL_LAYOUT (cb));
+	gtk_combo_box_set_model (GTK_COMBO_BOX (cb), GTK_TREE_MODEL (store));
+
+	text_renderer = gtk_cell_renderer_text_new ();
+	icon_renderer = gtk_cell_renderer_pixbuf_new ();
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb), icon_renderer, FALSE);
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (cb), text_renderer, TRUE);
+
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb), text_renderer, "text", 0,  NULL);
+	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (cb), icon_renderer, "gicon", 1,  NULL);
+	gtk_combo_box_set_active (GTK_COMBO_BOX (cb), 0);
+
+	g_signal_connect (G_OBJECT (vol_monitor), "mount-removed", G_CALLBACK (cb_mount_removed), plugin);
+	g_signal_connect (G_OBJECT (vol_monitor), "mount-added", G_CALLBACK (cb_mount_added), plugin);
+	g_signal_connect (G_OBJECT (vol_monitor), "mount-changed", G_CALLBACK (cb_mount_changed), plugin);
+
+	return cb;
+}
+
+static gboolean
+send_files (NstPlugin *plugin, GtkWidget *contact_widget,
+	    GList *file_list)
+{
+	GtkListStore *store;
+	GtkTreeIter iter;
+	GMount *dest_mount;
+	GFile *mount_root;
+
+	if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (contact_widget), &iter) == FALSE)
+		return TRUE;
+
+	store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (cb)));
+	gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, MOUNT_COL, &dest_mount, -1);
+	mount_root = g_mount_get_root (dest_mount);
+
+	copy_files_to (file_list, mount_root);
+
+	g_object_unref (mount_root);
+
+	return TRUE;
+}
+
+static gboolean
+destroy (NstPlugin *plugin)
+{
+	gtk_widget_destroy (cb);
+
+	g_object_unref (vol_monitor);
+	return TRUE;
+}
+
+static
+NstPluginInfo plugin_info = {
+	"folder-remote",
+	"folder-remote",
+	N_("Removable disks and shares"),
+	NULL,
+	CAJA_CAPS_SEND_DIRECTORIES,
+	init,
+	get_contacts_widget,
+	NULL,
+	send_files,
+	destroy
+};
+
+NST_INIT_PLUGIN (plugin_info)
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/32.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/32.html new file mode 100644 index 0000000..12a20d3 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/32.html @@ -0,0 +1,895 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Copyright (C) 2008 Zeeshan Ali (Khattak)
+ * Copyright (C) 2006 Peter Enseleit
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more av.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301  USA.
+ *
+ * Author:  Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
+ *          Peter Enseleit <penseleit@gmail.com>
+ *          Roberto Majadas <telemaco@openshine.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libgupnp/gupnp.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-sendto-plugin.h"<--- Include file: "caja-sendto-plugin.h" not found.
+
+#define MEDIA_SERVER "urn:schemas-upnp-org:device:MediaServer:1"
+#define CDS "urn:schemas-upnp-org:service:ContentDirectory"
+
+enum {
+	UDN_COL,
+	NAME_COL,
+	INTERFACE_COL,
+	NUM_COLS
+};
+
+static GtkWidget *combobox;
+static GtkTreeModel *model;
+static GUPnPContextManager *context_manager;
+
+static gboolean
+find_device (const gchar *udn,
+	     GtkTreeIter *iter)
+{
+	gboolean found = FALSE;
+
+	if (!gtk_tree_model_get_iter_first (model, iter))
+		return FALSE;
+
+	do {
+		gchar *tmp;
+
+		gtk_tree_model_get (model,
+				    iter,
+				    UDN_COL, &tmp,
+				    -1);
+
+		if (tmp != NULL && strcmp (tmp, udn) == 0)
+			found = TRUE;
+
+		g_free (tmp);
+	} while (!found && gtk_tree_model_iter_next (model, iter));
+
+	return found;
+}
+
+static gboolean
+check_required_actions (GUPnPServiceIntrospection *introspection)
+{
+	if (gupnp_service_introspection_get_action (introspection,
+						    "CreateObject") == NULL)
+		return FALSE;
+	if (gupnp_service_introspection_get_action (introspection,
+						    "ImportResource") == NULL)
+		return FALSE;
+	return TRUE;
+}
+
+static void
+get_introspection_cb (GUPnPServiceInfo *service_info,
+		      GUPnPServiceIntrospection *introspection, const GError *error,
+		      gpointer user_data)
+{
+	GUPnPDeviceInfo *device_info;
+	gchar *name;
+	const gchar *udn, *interface;
+	GtkTreeIter iter;
+	GUPnPContext *context;
+
+	device_info = GUPNP_DEVICE_INFO (user_data);
+
+	if (introspection != NULL) {
+		/* If introspection is available, make sure required actions
+		 * are implemented.
+		 */
+		if (!check_required_actions (introspection))
+			goto error;
+	}
+
+	udn = gupnp_device_info_get_udn (device_info);
+	if (G_UNLIKELY (udn == NULL))
+		goto error;
+
+	/* First check if the device is already added */
+	if (find_device (udn, &iter))
+		goto error;
+
+	name = gupnp_device_info_get_friendly_name (device_info);
+	if (name == NULL)
+		name = g_strdup (udn);
+
+	context = gupnp_device_info_get_context (device_info);
+	interface = gssdp_client_get_interface (GSSDP_CLIENT (context));
+
+	gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, -1,
+					   UDN_COL, udn,
+					   NAME_COL, name,
+					   INTERFACE_COL, interface,
+					   -1);
+
+	g_free (name);
+
+error:
+	/* We don't need the proxy objects anymore */
+	g_object_unref (service_info);
+	g_object_ref (device_info);
+}
+
+static void
+device_proxy_available_cb (GUPnPControlPoint *cp,
+			   GUPnPDeviceProxy  *proxy)
+{
+	GUPnPServiceInfo *info;
+
+	info = gupnp_device_info_get_service (GUPNP_DEVICE_INFO (proxy), CDS);
+	if (G_UNLIKELY (info == NULL)) {
+		/* No ContentDirectory implemented? Not interesting. */
+		return;
+	}
+
+	gupnp_service_info_get_introspection_async (info,
+						    get_introspection_cb,
+						    g_object_ref (proxy));
+}
+
+static void
+device_proxy_unavailable_cb (GUPnPControlPoint *cp,
+			     GUPnPDeviceProxy  *proxy)
+{
+	GtkTreeIter iter;
+	const gchar *udn;
+
+	udn = gupnp_device_info_get_udn (GUPNP_DEVICE_INFO (proxy));
+	if (udn == NULL)
+		return;
+
+	/* First check if the device is already added */
+	if (find_device (udn, &iter))
+		gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+}
+
+static void
+on_context_available (GUPnPContextManager *manager,
+                      GUPnPContext        *context,
+                      gpointer             user_data)
+{
+	GUPnPControlPoint *cp;
+
+	cp = gupnp_control_point_new (context, MEDIA_SERVER);
+
+	g_signal_connect (cp,
+			  "device-proxy-available",
+			  G_CALLBACK (device_proxy_available_cb),
+			  NULL);
+	g_signal_connect (cp,
+			  "device-proxy-unavailable",
+			  G_CALLBACK (device_proxy_unavailable_cb),
+			  NULL);
+
+	gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
+
+	/* Let context manager take care of the control point life cycle */
+	gupnp_context_manager_manage_control_point (manager, cp);
+	g_object_unref (cp);
+}
+
+static gboolean
+init (NstPlugin *plugin)
+{
+	GtkListStore *store;
+	GtkCellRenderer *renderer;
+	char *upload_cmd;
+
+#ifdef ENABLE_NLS
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+
+	upload_cmd = g_find_program_in_path ("gupnp-upload");
+	if (upload_cmd == NULL)
+		return FALSE;
+	g_free (upload_cmd);
+
+#ifdef HAS_GUPNP_VERSION_1_2
+	context_manager = gupnp_context_manager_create (0);
+#else
+	context_manager = gupnp_context_manager_new (NULL, 0);
+#endif
+	g_assert (context_manager != NULL);
+	g_signal_connect (context_manager, "context-available",
+			  G_CALLBACK (on_context_available), NULL);
+
+	combobox = gtk_combo_box_new ();
+
+	store = gtk_list_store_new (NUM_COLS,
+				    G_TYPE_STRING,   /* UDN  */
+				    G_TYPE_STRING,   /* Name */
+				    G_TYPE_STRING);  /* Network Interface */
+	model = GTK_TREE_MODEL (store);
+	gtk_combo_box_set_model (GTK_COMBO_BOX (combobox), model);
+
+	renderer = gtk_cell_renderer_text_new ();
+
+	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox),
+				    renderer,
+				    TRUE);
+	gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combobox),
+				       renderer,
+				       "text", NAME_COL);
+
+	return TRUE;
+}
+
+static GtkWidget*
+get_contacts_widget (NstPlugin *plugin)
+{
+	return combobox;
+}
+
+static gboolean
+send_files (NstPlugin *plugin,
+	    GtkWidget *contact_widget,
+	    GList *file_list)
+{
+	gchar *upload_cmd, *udn, *interface;
+	GPtrArray *argv;
+	gboolean ret;
+	GList *l;
+	GtkTreeIter iter;
+	GError *err = NULL;
+
+	if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combobox), &iter))
+		return FALSE;
+
+	gtk_tree_model_get (model, &iter, UDN_COL, &udn, INTERFACE_COL,
+			    &interface, -1);
+
+	upload_cmd = g_find_program_in_path ("gupnp-upload");
+	if (upload_cmd == NULL)
+		return FALSE;
+
+	argv = g_ptr_array_new ();
+	g_ptr_array_add (argv, upload_cmd);
+	g_ptr_array_add (argv, "-t");
+	g_ptr_array_add (argv, "15"); /* discovery timeout (seconds) */
+	g_ptr_array_add (argv, "-e");
+	g_ptr_array_add (argv, interface);
+	g_ptr_array_add (argv, udn);
+	for (l = file_list ; l; l=l->next) {
+		gchar *file_path;
+
+		file_path = g_filename_from_uri (l->data, NULL, NULL);
+		g_ptr_array_add (argv, file_path);
+	}
+	g_ptr_array_add (argv, NULL);
+
+	ret = g_spawn_async (NULL, (gchar **) argv->pdata,
+			     NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err);
+
+	if (ret == FALSE) {
+		g_warning ("Could not send files to MediaServer: %s",
+			   err->message);
+		g_error_free (err);
+	}
+
+	g_ptr_array_free (argv, TRUE);
+	g_free (upload_cmd);
+	g_free (udn);
+
+	return ret;
+}
+
+static gboolean
+destroy (NstPlugin *plugin)
+{
+	gtk_widget_destroy (combobox);
+	g_object_unref (model);
+
+	g_object_unref (context_manager);
+
+	return TRUE;
+}
+
+static
+NstPluginInfo plugin_info = {
+	"folder-remote",
+	"upnp",
+	N_("UPnP Media Server"),
+	NULL,
+	CAJA_CAPS_NONE,
+	init,
+	get_contacts_widget,
+	NULL,
+	send_files,
+	destroy
+};
+
+NST_INIT_PLUGIN (plugin_info)
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/33.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/33.html new file mode 100644 index 0000000..b6a6bd5 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/33.html @@ -0,0 +1,2809 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
/* caja-share -- Caja File Sharing Extension
+ *
+ * Sebastien Estienne <sebastien.estienne@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * (C) Copyright 2005 Ethium, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-info-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-property-page-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-share.h"
+
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/stat.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "shares.h"
+
+#define NEED_IF_GUESTOK_MASK (S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) /* need go+rx for guest enabled usershares */
+#define NEED_IF_WRITABLE_MASK (S_IWGRP | S_IWOTH)			/* writable usershares need go+w additionally*/
+#define NEED_ALL_MASK         (NEED_IF_GUESTOK_MASK | NEED_IF_WRITABLE_MASK)
+
+static GObjectClass *parent_class;
+
+/* Structure to hold all the information for a share's property page.  If
+ * you add stuff to this, add it to free_property_page_cb() as well.
+ */
+typedef struct {
+  char *path; /* Full path which is being shared */
+  CajaFileInfo *fileinfo; /* Caja file to which this page refers */
+
+  GtkBuilder *ui;
+
+  GtkWidget *main; /* Widget that holds all the rest.  Its "PropertyPage" GObject-data points to this PropertyPage structure */
+
+  GtkWidget *checkbutton_share_folder;
+  GtkWidget *box_share_content;
+  GtkWidget *entry_share_name;
+  GtkWidget *checkbutton_share_rw_ro;
+  GtkWidget *checkbutton_share_guest_ok;
+  GtkWidget *entry_share_comment;
+  GtkWidget *label_status;
+  GtkWidget *button_cancel;
+  GtkWidget *button_apply;
+
+  GtkWidget *standalone_window;
+
+  gboolean was_initially_shared;
+  gboolean was_writable;
+  gboolean is_dirty;
+} PropertyPage;
+
+static void property_page_set_warning (PropertyPage *page);
+static void property_page_set_error (PropertyPage *page, const char *message);
+static void property_page_set_normal (PropertyPage *page);
+
+static void
+property_page_validate_fields (PropertyPage *page)
+{
+  const char *name;
+
+  name = gtk_entry_get_text (GTK_ENTRY (page->entry_share_name));
+
+  if (g_utf8_strlen (name, -1) <= 12)
+    property_page_set_normal (page);
+  else
+    property_page_set_warning (page);
+}
+
+static gboolean
+message_confirm_missing_permissions (GtkWidget *widget, const char *path, mode_t need_mask)
+{
+  GtkWidget *toplevel;
+  GtkWidget *dialog;
+  char *display_name;
+  gboolean result;
+
+  toplevel = gtk_widget_get_toplevel (widget);
+  if (!GTK_IS_WINDOW (toplevel))
+    toplevel = NULL;
+
+  display_name = g_filename_display_basename (path);
+
+  dialog = gtk_message_dialog_new (toplevel ? GTK_WINDOW (toplevel) : NULL,
+				   0,
+				   GTK_MESSAGE_QUESTION,
+				   GTK_BUTTONS_NONE,
+				   _("Caja needs to add some permissions to your folder \"%s\" in order to share it"),
+				   display_name);
+
+  /* FIXME: the following message only mentions "permission by others".  We
+   * should probably be more explicit and mention group/other permissions.
+   * We'll be able to do that after the period of string freeze.
+   */
+  gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+					    _("The folder \"%s\" needs the following extra permissions for sharing to work:\n"
+					      "%s%s%s"
+					      "Do you want Caja to add these permissions to the folder automatically?"),
+					    display_name,
+					    (need_mask & (S_IRGRP | S_IROTH)) ? _("  - read permission by others\n") : "",
+					    (need_mask & (S_IWGRP | S_IWOTH)) ? _("  - write permission by others\n") : "",
+					    (need_mask & (S_IXGRP | S_IXOTH)) ? _("  - execute permission by others\n") : "");
+  g_free (display_name);
+
+  gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+  gtk_dialog_add_button (GTK_DIALOG (dialog), _("Add the permissions automatically"), GTK_RESPONSE_ACCEPT);
+  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
+
+  result = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT;
+  gtk_widget_destroy (dialog);
+
+  return result;
+}
+
+static void
+error_when_changing_permissions (GtkWidget *widget, const char *path)
+{
+  GtkWidget *toplevel;
+  GtkWidget *dialog;
+  char *display_name;
+
+  toplevel = gtk_widget_get_toplevel (widget);
+  if (!GTK_IS_WINDOW (toplevel))
+    toplevel = NULL;
+
+  display_name = g_filename_display_basename (path);
+
+  dialog = gtk_message_dialog_new (toplevel ? GTK_WINDOW (toplevel) : NULL,
+				   0,
+				   GTK_MESSAGE_ERROR,
+				   GTK_BUTTONS_OK,
+				   _("Could not change the permissions of folder \"%s\""),
+				   display_name);
+  g_free (display_name);
+
+  gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_destroy (dialog);
+}
+
+static char *
+get_key_file_path (void)
+{
+  return g_build_filename (g_get_home_dir (), ".mate2", "mate-file-manager-share-modified-permissions", NULL);
+}
+
+static void
+save_key_file (const char *filename, GKeyFile *key_file)
+{
+  char *contents;
+  gsize length;
+
+  /* NULL GError */
+  contents = g_key_file_to_data (key_file, &length, NULL);
+  if (!contents)
+    return;
+
+  /* NULL GError */
+  g_file_set_contents (filename, contents, length, NULL);
+
+  g_free (contents);
+}
+
+static void
+save_changed_permissions (const char *path, mode_t need_mask)
+{
+  GKeyFile *key_file;
+  char *key_file_path;
+  char str[50];
+
+  key_file = g_key_file_new ();
+  key_file_path = get_key_file_path ();
+
+  /* NULL GError
+   *
+   * We don't check the return value of this.  If the file doesn't exist, we'll
+   * simply want to create it.
+   */
+  g_key_file_load_from_file (key_file, key_file_path, 0, NULL);
+
+  g_snprintf (str, sizeof (str), "%o", (guint) need_mask); /* octal, baby */
+  g_key_file_set_string (key_file, path, "need_mask", str);
+
+  save_key_file (key_file_path, key_file);
+
+  g_key_file_free (key_file);
+  g_free (key_file_path);
+}
+
+static void
+remove_permissions (const char *path, mode_t need_mask)
+{
+  struct stat st;
+  mode_t new_mode;
+
+  if (need_mask == 0)
+    return;
+
+  if (stat (path, &st) != 0)
+    return;
+
+  new_mode = st.st_mode & ~need_mask;
+
+  /* Bleah, no error checking */
+  chmod (path, new_mode);
+}
+
+static void
+remove_from_saved_permissions (const char *path, mode_t remove_mask)
+{
+  GKeyFile *key_file;
+  char *key_file_path;
+
+  if (remove_mask == 0)
+    return;
+
+  key_file = g_key_file_new ();
+  key_file_path = get_key_file_path ();
+
+  if (g_key_file_load_from_file (key_file, key_file_path, 0, NULL))
+    {
+      mode_t need_mask;
+      mode_t remove_from_current_mask;
+      char *str;
+
+      need_mask = 0;
+
+      /* NULL GError */
+      str = g_key_file_get_string (key_file, path, "need_mask", NULL);
+
+      if (str)
+        {
+          guint i;
+
+          if (sscanf (str, "%o", &i) == 1) /* octal */
+            need_mask = i;
+
+          g_free (str);
+        }
+
+      remove_from_current_mask = need_mask & remove_mask;
+      remove_permissions (path, remove_from_current_mask);
+
+      need_mask &= ~remove_mask;
+
+      if (need_mask == 0)
+        {
+          /* NULL GError */
+          g_key_file_remove_group (key_file, path, NULL);
+        }
+      else
+        {
+          char buf[50];
+
+          g_snprintf (buf, sizeof (buf), "%o", (guint) need_mask); /* octal */
+          g_key_file_set_string (key_file, path, "need_mask", buf);
+        }
+
+      save_key_file (key_file_path, key_file);
+    }
+
+  g_key_file_free (key_file);
+  g_free (key_file_path);
+}
+
+static void
+restore_saved_permissions (const char *path)
+{
+  remove_from_saved_permissions (path, NEED_ALL_MASK);
+}
+
+static void
+restore_write_permissions (const char *path)
+{
+  remove_from_saved_permissions (path, NEED_IF_WRITABLE_MASK);
+}
+
+typedef enum {
+  CONFIRM_CANCEL_OR_ERROR,
+  CONFIRM_NO_MODIFICATIONS,
+  CONFIRM_MODIFIED
+} ConfirmPermissionsStatus;
+
+static ConfirmPermissionsStatus
+confirm_sharing_permissions (GtkWidget *widget, const char *path, gboolean is_shared, gboolean guest_ok, gboolean is_writable)
+{
+  struct stat st;
+  mode_t mode, new_mode, need_mask;
+
+  if (!is_shared)
+    return CONFIRM_NO_MODIFICATIONS;
+
+  if (stat (path, &st) != 0)
+    return CONFIRM_NO_MODIFICATIONS; /* We'll just let "net usershare" give back an error if the file disappears */
+
+  new_mode = mode = st.st_mode;
+
+  if (guest_ok)
+    new_mode |= NEED_IF_GUESTOK_MASK;
+  if (is_writable)
+    new_mode |= NEED_IF_WRITABLE_MASK;
+
+  need_mask = new_mode & ~mode;
+
+  if (need_mask != 0)
+    {
+      g_assert (mode != new_mode);
+
+      if (!message_confirm_missing_permissions (widget, path, need_mask))
+        return CONFIRM_CANCEL_OR_ERROR;
+
+      if (chmod (path, new_mode) != 0)
+        {
+          error_when_changing_permissions (widget, path);
+          return CONFIRM_CANCEL_OR_ERROR;
+        }
+
+      save_changed_permissions (path, need_mask);
+
+      return CONFIRM_MODIFIED;
+    }
+  else
+    {
+      g_assert (mode == new_mode);
+      return CONFIRM_NO_MODIFICATIONS;
+    }
+
+  g_assert_not_reached ();
+  return CONFIRM_CANCEL_OR_ERROR;
+}
+
+static gboolean
+property_page_commit (PropertyPage *page)
+{
+  gboolean is_shared;
+  ShareInfo share_info;
+  ConfirmPermissionsStatus status;
+  GError *error;
+  gboolean retval;
+
+  is_shared = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_folder));
+
+  share_info.path = page->path;
+  share_info.share_name = (char *) gtk_entry_get_text (GTK_ENTRY (page->entry_share_name));
+  share_info.comment = (char *) gtk_entry_get_text (GTK_ENTRY (page->entry_share_comment));
+  share_info.is_writable = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_rw_ro));
+  share_info.guest_ok = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_guest_ok));
+
+  /* Do we need to unset the write permissions that we added in the past? */
+  if (is_shared && page->was_writable && !share_info.is_writable)
+    restore_write_permissions (page->path);
+
+  status = confirm_sharing_permissions (page->main, page->path, is_shared, share_info.guest_ok, share_info.is_writable);
+  if (status == CONFIRM_CANCEL_OR_ERROR)
+    return FALSE; /* the user didn't want us to change his folder's permissions */
+
+  error = NULL;
+  retval = shares_modify_share (share_info.path, is_shared ? &share_info : NULL, &error);
+
+  if (!retval)
+    {
+      property_page_set_error (page, error->message);
+      g_error_free (error);
+
+      /* Since the operation failed, we restore things to the way they were */
+      if (status == CONFIRM_MODIFIED)
+        restore_saved_permissions (page->path);
+    }
+  else
+    {
+      property_page_validate_fields (page);
+      caja_file_info_invalidate_extension_info (page->fileinfo);
+    }
+
+  if (!is_shared)
+    restore_saved_permissions (page->path);
+
+  /* update initially shared state, so that we may undo later on */
+  if (retval)
+    {
+      page->was_initially_shared = is_shared;
+      page->is_dirty = FALSE;
+    }
+
+  return retval;
+}
+
+/*--------------------------------------------------------------------------*/
+static gchar *
+get_fullpath_from_fileinfo(CajaFileInfo *fileinfo)
+{
+  GFile *file;
+  gchar *fullpath;
+
+  g_assert (fileinfo != NULL);
+
+  file = caja_file_info_get_location(fileinfo);
+  fullpath = g_file_get_path(file);
+  g_assert (fullpath != NULL && g_file_is_native(file)); /* In the beginning we checked that this was a local URI */
+  g_object_unref(file);
+
+  return(fullpath);
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+property_page_set_warning (PropertyPage *page)
+{
+  GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (page->entry_share_name));
+  if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_ERROR))
+    {
+      gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ERROR);
+    }
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_WARNING);
+
+  gtk_label_set_text (GTK_LABEL (page->label_status), _("Share name is too long"));
+}
+
+static void
+property_page_set_error (PropertyPage *page, const char *message)
+{
+  GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (page->entry_share_name));
+  if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_WARNING))
+    {
+      gtk_style_context_remove_class (context, GTK_STYLE_CLASS_WARNING);
+    }
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_ERROR);
+
+  gtk_label_set_text (GTK_LABEL (page->label_status), message);
+}
+
+static void
+property_page_set_normal (PropertyPage *page)
+{
+  GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (page->entry_share_name));
+  if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_WARNING))
+    {
+      gtk_style_context_remove_class (context, GTK_STYLE_CLASS_WARNING);
+    }
+
+  if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_ERROR))
+    {
+      gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ERROR);
+    }
+
+  gtk_label_set_text (GTK_LABEL (page->label_status), "");
+}
+
+static gboolean
+property_page_share_name_is_valid (PropertyPage *page)
+{
+  const char *newname;
+
+  newname = gtk_entry_get_text (GTK_ENTRY (page->entry_share_name));
+
+  if (strlen (newname) == 0)
+    {
+      property_page_set_error (page, _("The share name cannot be empty"));
+      return FALSE;
+    }
+  else
+    {
+      GError *error;
+      gboolean exists;
+
+      error = NULL;
+      if (!shares_get_share_name_exists (newname, &exists, &error))
+        {
+          char *str;
+
+          str = g_strdup_printf (_("Error while getting share information: %s"), error->message);
+          property_page_set_error (page, str);
+          g_free (str);
+          g_error_free (error);
+
+          return FALSE;
+        }
+
+      if (exists)
+        {
+          property_page_set_error (page, _("Another share has the same name"));
+          return FALSE;
+        }
+      else
+        {
+          property_page_set_normal (page);
+          return TRUE;
+        }
+    }
+}
+
+static void
+property_page_set_controls_sensitivity (PropertyPage *page,
+					gboolean      sensitive)
+{
+  gtk_widget_set_sensitive (page->box_share_content, sensitive);
+
+  if (sensitive)
+    {
+      gboolean guest_ok_allowed;
+      shares_supports_guest_ok (&guest_ok_allowed, NULL);
+      gtk_widget_set_sensitive (page->checkbutton_share_guest_ok, guest_ok_allowed);
+    }
+  else
+    gtk_widget_set_sensitive (page->checkbutton_share_guest_ok, FALSE);
+}
+
+static void
+property_page_check_sensitivity (PropertyPage *page)
+{
+  gboolean enabled;
+  gboolean apply_is_sensitive;
+
+  enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_folder));
+  property_page_set_controls_sensitivity (page, enabled);
+
+  if (enabled)
+    apply_is_sensitive = page->is_dirty || !page->was_initially_shared;
+  else
+    apply_is_sensitive = page->was_initially_shared;
+
+  gtk_widget_set_sensitive (page->button_apply, apply_is_sensitive);
+  gtk_button_set_label (GTK_BUTTON(page->button_apply),
+			page->was_initially_shared ? _("Modify _Share") : _("Create _Share"));
+}
+
+static void
+modify_share_name_text_entry  (GtkEditable *editable,
+			       gpointer user_data)
+{
+  PropertyPage *page;
+
+  page = user_data;
+
+  page->is_dirty = TRUE;
+
+  /* This function does simple validation on the share name and sets the error
+   * label; just let it run and ignore the result value.
+   */
+  property_page_share_name_is_valid (page);
+
+  property_page_check_sensitivity (page);
+}
+
+static void
+modify_share_comment_text_entry  (GtkEditable *editable,
+				  gpointer user_data)
+{
+  PropertyPage *page;
+
+  page = user_data;
+
+  page->is_dirty = TRUE;
+  property_page_check_sensitivity (page);
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+on_checkbutton_share_folder_toggled    (GtkToggleButton *togglebutton,
+                                        gpointer         user_data)
+{
+  PropertyPage *page;
+
+  page = user_data;
+
+  property_page_check_sensitivity (page);
+}
+
+static void
+on_checkbutton_rw_ro_toggled    (GtkToggleButton *togglebutton,
+				 gpointer         user_data)
+{
+  PropertyPage *page;
+
+  page = user_data;
+
+  page->is_dirty = TRUE;
+
+  property_page_check_sensitivity (page);
+}
+
+static void
+on_checkbutton_guest_ok_toggled    (GtkToggleButton *togglebutton,
+				    gpointer         user_data)
+{
+  PropertyPage *page;
+
+  page = user_data;
+
+  page->is_dirty = TRUE;
+
+  property_page_check_sensitivity (page);
+}
+
+static void
+free_property_page_cb (gpointer data)
+{
+  PropertyPage *page;
+
+  page = data;
+
+  g_free (page->path);
+  g_object_unref (page->fileinfo);
+  g_object_unref (page->ui);
+
+  g_free (page);
+}
+
+static void
+button_apply_clicked_cb (GtkButton *button,
+			 gpointer   data)
+{
+  PropertyPage *page;
+
+  page = data;
+
+  if (property_page_commit (page))
+    {
+      if (page->standalone_window)
+	gtk_widget_destroy (page->standalone_window);
+      else
+        property_page_check_sensitivity (page);
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+static PropertyPage *
+create_property_page (CajaFileInfo *fileinfo)
+{
+  PropertyPage *page;
+  GError *error;
+  ShareInfo *share_info;
+  char *share_name;
+  gboolean free_share_name;
+  const char *comment;
+  char *apply_button_label;
+
+  page = g_new0 (PropertyPage, 1);
+
+  page->path = get_fullpath_from_fileinfo(fileinfo);
+  page->fileinfo = g_object_ref (fileinfo);
+
+  error = NULL;
+  if (!shares_get_share_info_for_path (page->path, &share_info, &error))
+    {
+      /* We'll assume that there is no share for that path, but we'll still
+       * bring up an error dialog.
+       */
+      GtkWidget *message;
+
+      message = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+					_("There was an error while getting the sharing information"));
+      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s", error->message);
+      gtk_widget_show (message);
+
+      share_info = NULL;
+      g_error_free (error);
+      error = NULL;
+    }
+
+  page->ui = gtk_builder_new ();
+#ifdef ENABLE_NLS
+  gtk_builder_set_translation_domain (page->ui, GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+  g_assert (gtk_builder_add_from_file (page->ui,
+              INTERFACES_DIR"/share-dialog.ui", &error));
+
+  page->main = GTK_WIDGET (gtk_builder_get_object (page->ui, "vbox1"));
+  g_assert (page->main != NULL);
+
+  g_object_set_data_full (G_OBJECT (page->main),
+			  "PropertyPage",
+			  page,
+			  free_property_page_cb);
+
+  page->checkbutton_share_folder = GTK_WIDGET (gtk_builder_get_object (page->ui,"checkbutton_share_folder"));
+  page->box_share_content = GTK_WIDGET (gtk_builder_get_object (page->ui,"box_share_content"));
+  page->checkbutton_share_rw_ro = GTK_WIDGET (gtk_builder_get_object (page->ui,"checkbutton_share_rw_ro"));
+  page->checkbutton_share_guest_ok = GTK_WIDGET (gtk_builder_get_object (page->ui,"checkbutton_share_guest_ok"));
+  page->entry_share_name = GTK_WIDGET (gtk_builder_get_object (page->ui,"entry_share_name"));
+  page->entry_share_comment = GTK_WIDGET (gtk_builder_get_object (page->ui,"entry_share_comment"));
+  page->label_status = GTK_WIDGET (gtk_builder_get_object (page->ui,"label_status"));
+  page->button_cancel = GTK_WIDGET (gtk_builder_get_object (page->ui,"button_cancel"));
+  page->button_apply = GTK_WIDGET (gtk_builder_get_object (page->ui,"button_apply"));
+
+  /* Sanity check so that we don't screw up the Glade file */
+  g_assert (page->checkbutton_share_folder != NULL
+	    && page->box_share_content != NULL
+	    && page->checkbutton_share_rw_ro != NULL
+	    && page->checkbutton_share_guest_ok != NULL
+	    && page->entry_share_name != NULL
+	    && page->entry_share_comment != NULL
+	    && page->label_status != NULL
+	    && page->button_cancel != NULL
+	    && page->button_apply != NULL);
+
+  if (share_info)<--- First condition
+    {
+      page->was_initially_shared = TRUE;
+      page->was_writable = share_info->is_writable;
+    }
+
+  /* Share name */
+
+  if (share_info)<--- Second condition
+    {
+      share_name = share_info->share_name;
+      free_share_name = FALSE;
+    }
+  else
+    {
+      share_name = g_filename_display_basename (page->path);
+      free_share_name = TRUE;
+    }
+
+  gtk_entry_set_text (GTK_ENTRY (page->entry_share_name), share_name);
+
+  if (free_share_name)
+    g_free (share_name);
+
+  /* Comment */
+
+  if (share_info == NULL || share_info->comment == NULL)
+    comment = "";
+  else
+    comment = share_info->comment;
+
+  gtk_entry_set_text (GTK_ENTRY (page->entry_share_comment), comment);
+
+  /* Share toggle */
+
+  if (share_info)
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_folder), TRUE);
+  else
+    {
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_folder), FALSE);
+    }
+
+  /* Share name */
+
+  if (g_utf8_strlen(gtk_entry_get_text (GTK_ENTRY (page->entry_share_name)), -1) > 12)
+    property_page_set_warning (page);
+
+  /* Permissions */
+  if (share_info != NULL && share_info->is_writable)
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_rw_ro), TRUE);
+  else
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_rw_ro), FALSE);
+
+  /* Guest access */
+  if (share_info != NULL && share_info->guest_ok)
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_guest_ok), TRUE);
+  else
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->checkbutton_share_guest_ok), FALSE);
+
+  /* Apply button */
+
+  if (share_info)
+    apply_button_label = _("Modify _Share");
+  else
+    apply_button_label = _("Create _Share");
+
+  gtk_button_set_label (GTK_BUTTON (page->button_apply), apply_button_label);
+  gtk_button_set_use_underline (GTK_BUTTON (page->button_apply), TRUE);
+  gtk_button_set_image (GTK_BUTTON (page->button_apply), gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_BUTTON));
+
+  gtk_widget_set_sensitive (page->button_apply, FALSE);
+
+  /* Sensitivity */
+
+  property_page_check_sensitivity (page);
+
+  /* Signal handlers */
+
+  g_signal_connect (page->checkbutton_share_folder, "toggled",
+                    G_CALLBACK (on_checkbutton_share_folder_toggled),
+                    page);
+
+  g_signal_connect (page->checkbutton_share_rw_ro, "toggled",
+                    G_CALLBACK (on_checkbutton_rw_ro_toggled),
+                    page);
+
+  g_signal_connect (page->checkbutton_share_guest_ok, "toggled",
+                    G_CALLBACK (on_checkbutton_guest_ok_toggled),
+                    page);
+
+  g_signal_connect (page->entry_share_name, "changed",
+                    G_CALLBACK (modify_share_name_text_entry),
+                    page);
+
+  g_signal_connect (page->entry_share_comment, "changed",
+		    G_CALLBACK (modify_share_comment_text_entry),
+		    page);
+
+  g_signal_connect (page->button_apply, "clicked",
+		    G_CALLBACK (button_apply_clicked_cb), page);
+
+  if (share_info != NULL)
+    shares_free_share_info (share_info);
+
+  return page;
+}
+
+/* Implementation of the CajaInfoProvider interface */
+
+/* caja_info_provider_update_file_info
+ * This function is called by Caja when it wants the extension to
+ * fill in data about the file.  It passes a CajaFileInfo object,
+ * which the extension can use to read data from the file, and which
+ * the extension should add data to.
+ *
+ * If the data can be added immediately (without doing blocking IO),
+ * the extension can do so, and return CAJA_OPERATION_COMPLETE.
+ * In this case the 'update_complete' and 'handle' parameters can be
+ * ignored.
+ *
+ * If waiting for the deata would block the UI, the extension should
+ * perform the task asynchronously, and return
+ * CAJA_OPERATION_IN_PROGRESS.  The function must also set the
+ * 'handle' pointer to a value unique to the object, and invoke the
+ * 'update_complete' closure when the update is done.
+ *
+ * If the extension encounters an error, it should return
+ * CAJA_OPERATION_FAILED.
+ */
+typedef struct {
+  gboolean cancelled;
+  CajaInfoProvider *provider;
+  CajaFileInfo *file;
+  GClosure *update_complete;
+} CajaShareHandle;
+
+static CajaShareStatus
+get_share_status_and_free_share_info (ShareInfo *share_info)
+{
+  CajaShareStatus result;
+
+  if (!share_info)
+    result = CAJA_SHARE_NOT_SHARED;
+  else
+    {
+      if (share_info->is_writable)
+	result = CAJA_SHARE_SHARED_RW;
+      else
+	result = CAJA_SHARE_SHARED_RO;
+
+      shares_free_share_info (share_info);
+    }
+
+  return result;
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+get_share_info_for_file_info (CajaFileInfo *file, ShareInfo **share_info, gboolean *is_shareable)
+{
+  char		*uri;
+  char		*local_path = NULL;
+  GFile         *f;
+
+  *share_info = NULL;
+  *is_shareable = FALSE;
+
+  uri = caja_file_info_get_uri (file);
+  f = caja_file_info_get_location(file);
+  if (!uri)
+    goto out;
+
+#define NETWORK_SHARE_PREFIX "network:///share-"
+
+  if (g_str_has_prefix (uri, NETWORK_SHARE_PREFIX))
+    {
+      const char *share_name;
+
+      share_name = uri + strlen (NETWORK_SHARE_PREFIX);
+
+      /* FIXME: NULL GError */
+      if (!shares_get_share_info_for_share_name (share_name, share_info, NULL))
+        {
+          *share_info = NULL;
+          *is_shareable = TRUE; /* it *has* the prefix, anyway... we are just unsynchronized with what mate-vfs thinks */
+        }
+      else
+        {
+          *is_shareable = TRUE;
+        }
+
+      goto out;
+    }
+
+  if (!caja_file_info_is_directory(file))
+    goto out;
+
+  local_path = g_file_get_path(f);
+  if (!local_path || !g_file_is_native(f))
+    goto out;
+
+  /* FIXME: NULL GError */
+  if (!shares_get_share_info_for_path (local_path, share_info, NULL))
+    goto out;
+
+  *is_shareable = TRUE;
+
+ out:
+
+  g_object_unref(f);
+  g_free (uri);
+  g_free (local_path);
+}
+
+/*--------------------------------------------------------------------------*/
+static CajaShareStatus
+file_get_share_status_file(CajaFileInfo *file)
+{
+  ShareInfo *share_info;
+  gboolean is_shareable;
+
+  get_share_info_for_file_info (file, &share_info, &is_shareable);
+
+  if (!is_shareable)
+    return CAJA_SHARE_NOT_SHARED;
+
+  return get_share_status_and_free_share_info (share_info);
+}
+
+static CajaOperationResult
+caja_share_update_file_info (CajaInfoProvider *provider,
+				 CajaFileInfo *file,
+				 GClosure *update_complete,
+				 CajaOperationHandle **handle)
+{
+/*   gchar *share_status = NULL; */
+
+  switch (file_get_share_status_file (file)) {
+
+  case CAJA_SHARE_SHARED_RO:
+    caja_file_info_add_emblem (file, "shared");
+/*     share_status = _("shared (read only)"); */
+    break;
+
+  case CAJA_SHARE_SHARED_RW:
+    caja_file_info_add_emblem (file, "shared");
+/*     share_status = _("shared (read and write)"); */
+    break;
+
+  case CAJA_SHARE_NOT_SHARED:
+/*     share_status = _("not shared"); */
+    break;
+
+  default:
+    g_assert_not_reached ();
+    break;
+  }
+
+/*   caja_file_info_add_string_attribute (file, */
+/* 					   "CajaShare::share_status", */
+/* 					   share_status); */
+  return CAJA_OPERATION_COMPLETE;
+}
+
+static void
+caja_share_cancel_update (CajaInfoProvider *provider,
+			      CajaOperationHandle *handle)
+{
+  CajaShareHandle *share_handle;
+
+  share_handle = (CajaShareHandle*)handle;
+  share_handle->cancelled = TRUE;
+}
+
+static void
+caja_share_info_provider_iface_init (CajaInfoProviderIface *iface)
+{
+  iface->update_file_info = caja_share_update_file_info;
+  iface->cancel_update = caja_share_cancel_update;
+}
+
+/*--------------------------------------------------------------------------*/
+/* caja_property_page_provider_get_pages
+ *
+ * This function is called by Caja when it wants property page
+ * items from the extension.
+ *
+ * This function is called in the main thread before a property page
+ * is shown, so it should return quickly.
+ *
+ * The function should return a GList of allocated CajaPropertyPage
+ * items.
+ */
+static GList *
+caja_share_get_property_pages (CajaPropertyPageProvider *provider,
+				   GList *files)
+{
+  PropertyPage *page;
+  GList *pages;
+  CajaPropertyPage *np_page;
+  CajaFileInfo *fileinfo;
+  ShareInfo *share_info;
+  gboolean is_shareable;
+
+  /* Only show the property page if 1 file is selected */
+  if (!files || files->next != NULL) {
+    return NULL;
+  }
+
+  fileinfo = CAJA_FILE_INFO (files->data);
+
+  get_share_info_for_file_info (fileinfo, &share_info, &is_shareable);
+  if (!is_shareable)
+    return NULL;
+
+  page = create_property_page (fileinfo);
+  gtk_widget_hide (page->button_cancel);
+
+  if (share_info)
+    shares_free_share_info (share_info);
+
+  pages = NULL;
+  np_page = caja_property_page_new
+    ("CajaShare::property_page",
+     gtk_label_new (_("Share")),
+     page->main);
+  pages = g_list_append (pages, np_page);
+
+  return pages;
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+caja_share_property_page_provider_iface_init (CajaPropertyPageProviderIface *iface)
+{
+  iface->get_pages = caja_share_get_property_pages;
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+caja_share_instance_init (CajaShare *share)
+{
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+caja_share_class_init (CajaShareClass *class)
+{
+  parent_class = g_type_class_peek_parent (class);
+}
+
+/* caja_menu_provider_get_file_items
+ *
+ * This function is called by Caja when it wants context menu
+ * items from the extension.
+ *
+ * This function is called in the main thread before a context menu
+ * is shown, so it should return quickly.
+ *
+ * The function should return a GList of allocated CajaMenuItem
+ * items.
+ */
+
+static void
+button_cancel_clicked_cb (GtkButton *button, gpointer data)
+{
+  GtkWidget *window;
+
+  window = GTK_WIDGET (data);
+  gtk_widget_destroy (window);
+}
+
+static void
+share_this_folder_callback (CajaMenuItem *item,
+			    gpointer user_data)
+{
+  CajaFileInfo *fileinfo;
+  PropertyPage *page;
+  GtkWidget * window;
+
+  fileinfo = CAJA_FILE_INFO (user_data);
+  g_assert (fileinfo != NULL);
+
+  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_title (GTK_WINDOW (window), _("Folder Sharing"));
+  page = create_property_page (fileinfo);
+  page->standalone_window = window;
+  g_signal_connect (page->button_cancel, "clicked",
+		    G_CALLBACK (button_cancel_clicked_cb), window);
+
+  gtk_container_add (GTK_CONTAINER (window), page->main);
+  gtk_widget_show (window);
+}
+
+static GList *
+caja_share_get_file_items (CajaMenuProvider *provider,
+			     GtkWidget *window,
+			     GList *files)
+{
+  GList *items;
+  CajaMenuItem *item;
+  CajaFileInfo *fileinfo;
+  ShareInfo *share_info;
+  gboolean is_shareable;
+
+  /* Only show the property page if 1 file is selected */
+  if (!files || files->next != NULL) {
+    return NULL;
+  }
+
+  fileinfo = CAJA_FILE_INFO (files->data);
+
+  get_share_info_for_file_info (fileinfo, &share_info, &is_shareable);
+
+  if (!is_shareable)
+    return NULL;
+
+  if (share_info)
+    shares_free_share_info (share_info);
+
+  /* We don't own a reference to the file info to keep it around, so acquire one */
+  g_object_ref (fileinfo);
+
+  /* FMQ: change the label to "Share with Windows users"? */
+  item = caja_menu_item_new ("CajaShare::share",
+				 _("Sharing Options"),
+				 _("Share this Folder"),
+				 "folder-remote");
+  g_signal_connect (item, "activate",
+		    G_CALLBACK (share_this_folder_callback),
+		    fileinfo);
+  g_object_set_data_full (G_OBJECT (item),
+			  "files",
+			  fileinfo,
+			  g_object_unref); /* Release our reference when the menu item goes away */
+
+  items = g_list_append (NULL, item);
+  return items;
+}
+
+/*--------------------------------------------------------------------------*/
+static void
+caja_share_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_file_items = caja_share_get_file_items;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Type registration.  Because this type is implemented in a module
+ * that can be unloaded, we separate type registration from get_type().
+ * the type_register() function will be called by the module's
+ * initialization function. */
+static GType share_type = 0;
+
+#define CAJA_TYPE_SHARE  (caja_share_get_type ())
+
+static GType
+caja_share_get_type (void)
+{
+  return share_type;
+}
+
+static void
+caja_share_register_type (GTypeModule *module)
+{
+  static const GTypeInfo info = {
+    sizeof (CajaShareClass),
+    (GBaseInitFunc) NULL,
+    (GBaseFinalizeFunc) NULL,
+    (GClassInitFunc) caja_share_class_init,
+    NULL,
+    NULL,
+    sizeof (CajaShare),
+    0,
+    (GInstanceInitFunc) caja_share_instance_init,
+    NULL
+  };
+
+  share_type = g_type_module_register_type (module,
+					    G_TYPE_OBJECT,
+					    "CajaShare",
+					    &info, 0);
+
+  static const GInterfaceInfo property_page_provider_iface_info = {
+    (GInterfaceInitFunc) caja_share_property_page_provider_iface_init,
+    NULL,
+    NULL
+  };
+
+  g_type_module_add_interface (module,
+			       share_type,
+			       CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
+			       &property_page_provider_iface_info);
+
+  static const GInterfaceInfo info_provider_iface_info = {
+    (GInterfaceInitFunc) caja_share_info_provider_iface_init,
+    NULL,
+    NULL
+  };
+
+  g_type_module_add_interface (module,
+			       share_type,
+			       CAJA_TYPE_INFO_PROVIDER,
+			       &info_provider_iface_info);
+
+  /* Menu right clik */
+  static const GInterfaceInfo menu_provider_iface_info = {
+    (GInterfaceInitFunc) caja_share_menu_provider_iface_init,
+    NULL,
+    NULL
+  };
+
+  g_type_module_add_interface (module,
+			       share_type,
+			       CAJA_TYPE_MENU_PROVIDER,
+			       &menu_provider_iface_info);
+
+}
+
+/* Extension module functions.  These functions are defined in
+ * caja-extensions-types.h, and must be implemented by all
+ * extensions. */
+
+/* Initialization function.  In addition to any module-specific
+ * initialization, any types implemented by the module should
+ * be registered here. */
+void
+caja_module_initialize (GTypeModule  *module)
+{
+  g_print ("Initializing caja-share extension\n");
+
+  caja_share_register_type (module);
+#ifdef ENABLE_NLS
+  bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+/* Perform module-specific shutdown. */
+void
+caja_module_shutdown   (void)
+{
+  g_print ("Shutting down caja-share extension\n");
+  /* FIXME freeing */
+}
+
+/* List all the extension types.  */
+void
+caja_module_list_types (const GType **types,
+			    int          *num_types)
+{
+  static GType type_list[1];
+
+  type_list[0] = CAJA_TYPE_SHARE;
+
+  *types = type_list;
+  *num_types = 1;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/34.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/34.html new file mode 100644 index 0000000..5b57166 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/34.html @@ -0,0 +1,363 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
/* caja-share -- Caja File Sharing Extension
+ *
+ * Sebastien Estienne <sebastien.estienne@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * (C) Copyright 2005 Ethium, Inc.
+ */
+
+#ifndef CAJA_SHARE_H
+#define CAJA_SHARE_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+/* Declarations for the Share extension object.  This object will be
+ * instantiated by caja.  It implements the GInterfaces
+ * exported by libcaja. */
+
+typedef struct _CajaShare      CajaShare;
+typedef struct _CajaShareClass CajaShareClass;
+
+struct _CajaShare {
+	GObject parent_slot;
+};
+
+struct _CajaShareClass {
+	GObjectClass parent_slot;
+
+	/* No extra class members */
+};
+
+typedef struct _CajaShareData      CajaShareData;
+
+struct _CajaShareData {
+  gchar		*fullpath;
+  gchar		*section;
+  CajaFileInfo *fileinfo;
+};
+
+G_END_DECLS
+
+typedef enum {
+  CAJA_SHARE_NOT_SHARED,
+  CAJA_SHARE_SHARED_RO,
+  CAJA_SHARE_SHARED_RW
+} CajaShareStatus;
+
+#endif
+
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/35.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/35.html new file mode 100644 index 0000000..c36791d --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/35.html @@ -0,0 +1,331 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
#ifndef SHARES_H
+#define SHARES_H
+
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+typedef struct {
+	char *path;
+	char *share_name;
+	char *comment;
+	gboolean is_writable;
+	gboolean guest_ok;
+} ShareInfo;
+
+#define SHARES_ERROR (shares_error_quark ())
+
+typedef enum {
+	SHARES_ERROR_FAILED,
+	SHARES_ERROR_NONEXISTENT
+} SharesError;
+
+GQuark shares_error_quark (void);
+
+void shares_free_share_info (ShareInfo *info);
+
+gboolean shares_get_path_is_shared (const char *path, gboolean *ret_is_shared, GError **error);
+
+gboolean shares_get_share_info_for_path (const char *path, ShareInfo **ret_share_info, GError **error);
+
+gboolean shares_get_share_name_exists (const char *share_name, gboolean *ret_exists, GError **error);
+
+gboolean shares_get_share_info_for_share_name (const char *share_name, ShareInfo **ret_share_info, GError **error);
+
+gboolean shares_modify_share (const char *old_path, ShareInfo *info, GError **error);
+
+gboolean shares_get_share_info_list (GSList **ret_info_list, GError **error);
+
+void shares_free_share_info_list (GSList *list);
+
+gboolean shares_supports_guest_ok (gboolean *supports_guest_ok_ret,
+				   GError **error);
+
+void shares_set_debug (gboolean error_on_refresh,
+		       gboolean error_on_add,
+		       gboolean error_on_modify,
+		       gboolean error_on_remove);
+
+#endif
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/36.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/36.html new file mode 100644 index 0000000..7719b32 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/36.html @@ -0,0 +1,2271 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <time.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <sys/wait.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "shares.h"
+
+#undef DEBUG_SHARES
+#ifdef DEBUG_SHARES
+#  define NET_USERSHARE_ARGV0 "debug-net-usershare"
+#else
+#  define NET_USERSHARE_ARGV0 "net"
+#endif
+
+static GHashTable *path_share_info_hash;
+static GHashTable *share_name_share_info_hash;
+
+#define NUM_CALLS_BETWEEN_TIMESTAMP_UPDATES 100
+#define TIMESTAMP_THRESHOLD 10	/* seconds */
+static int refresh_timestamp_update_counter;
+static time_t refresh_timestamp;
+
+#define KEY_PATH "path"
+#define KEY_COMMENT "comment"
+#define KEY_ACL "usershare_acl"
+#define KEY_GUEST_OK "guest_ok"
+
+/* Debugging flags */
+static gboolean throw_error_on_refresh;
+static gboolean throw_error_on_add;
+static gboolean throw_error_on_modify;
+static gboolean throw_error_on_remove;
+
+/* Interface to "net usershare" */
+
+static gboolean
+net_usershare_run (int argc, char **argv, GKeyFile **ret_key_file, GError **error)
+{
+	int real_argc;
+	int i;
+	char **real_argv;
+	gboolean retval;
+	char *stdout_contents;
+	char *stderr_contents;
+	int exit_status;
+	int exit_code;
+	GKeyFile *key_file;
+	GError *real_error;
+
+	g_assert (argc > 0);
+	g_assert (argv != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (ret_key_file)
+		*ret_key_file = NULL;
+
+	/* Build command line */
+
+	real_argc = 2 + argc + 1; /* "net" "usershare" [argv] NULL */
+	real_argv = g_new (char *, real_argc);
+
+	real_argv[0] = NET_USERSHARE_ARGV0;
+	real_argv[1] = "usershare";
+
+	for (i = 0; i < argc; i++) {
+		g_assert (argv[i] != NULL);
+		real_argv[i + 2] = argv[i];
+	}
+
+	real_argv[real_argc - 1] = NULL;
+
+	/* Launch */
+
+	stdout_contents = NULL;
+	stderr_contents = NULL;
+	/*
+	{
+		char **p;
+
+		g_message ("------------------------------------------");
+
+		for (p = real_argv; *p; p++)
+			g_message ("spawn arg \"%s\"", *p);
+
+		g_message ("end of spawn args; SPAWNING\n");
+	}
+	*/
+	real_error = NULL;
+	retval = g_spawn_sync (NULL,			/* cwd */
+			       real_argv,
+			       NULL, 			/* envp */
+			       G_SPAWN_SEARCH_PATH,
+			       NULL, 			/* GSpawnChildSetupFunc */
+			       NULL,			/* user_data */
+			       &stdout_contents,
+			       &stderr_contents,
+			       &exit_status,
+			       &real_error);
+
+	/* g_message ("returned from spawn: %s: %s", retval ? "SUCCESS" : "FAIL", retval ? "" : real_error->message); */
+
+	if (!retval) {
+		g_propagate_error (error, real_error);
+		goto out;
+	}
+
+	if (!WIFEXITED (exit_status)) {
+		g_message ("WIFEXITED(%d) was false!", exit_status);
+		retval = FALSE;
+
+		if (WIFSIGNALED (exit_status)) {
+			int signal_num;
+
+			signal_num = WTERMSIG (exit_status);
+			g_message ("Child got signal %d", signal_num);
+
+			g_set_error (error,
+				     SHARES_ERROR,
+				     SHARES_ERROR_FAILED,
+				     _("%s %s %s returned with signal %d"),
+				     real_argv[0],
+				     real_argv[1],
+				     real_argv[2],
+				     signal_num);
+		} else
+			g_set_error (error,
+				     SHARES_ERROR,
+				     SHARES_ERROR_FAILED,
+				     _("%s %s %s failed for an unknown reason"),
+				     real_argv[0],
+				     real_argv[1],
+				     real_argv[2]);
+
+		goto out;
+	}
+
+	exit_code = WEXITSTATUS (exit_status);
+
+	/* g_message ("exit code %d", exit_code); */
+	if (exit_code != 0) {
+		char *str;
+		char *message;
+
+		/* stderr_contents is in the system locale encoding, not UTF-8 */
+
+		str = g_locale_to_utf8 (stderr_contents, -1, NULL, NULL, NULL);
+
+		if (str && str[0])
+			message = g_strdup_printf (_("'net usershare' returned error %d: %s"), exit_code, str);
+		else
+			message = g_strdup_printf (_("'net usershare' returned error %d"), exit_code);
+
+		g_free (str);
+
+		g_set_error (error,
+			     G_SPAWN_ERROR,
+			     G_SPAWN_ERROR_FAILED,
+			     "%s",
+			     message);
+
+		g_free (message);
+
+		retval = FALSE;
+		goto out;
+	}
+
+	if (ret_key_file) {
+	  /* g_message ("caller wants GKeyFile"); */
+
+		*ret_key_file = NULL;
+
+		/* FIXME: jeallison@novell.com says the output of "net usershare" is nearly always
+		 * in UTF-8, but that it can be configured in the master smb.conf.  We assume
+		 * UTF-8 for now.
+		 */
+
+		if (!g_utf8_validate (stdout_contents, -1, NULL)) {
+			g_message ("stdout of net usershare was not in valid UTF-8");
+			g_set_error (error,
+				     G_SPAWN_ERROR,
+				     G_SPAWN_ERROR_FAILED,
+				     _("the output of 'net usershare' is not in valid UTF-8 encoding"));
+			retval = FALSE;
+			goto out;
+		}
+
+		key_file = g_key_file_new ();
+
+		real_error = NULL;
+		if (!g_key_file_load_from_data (key_file, stdout_contents, -1, 0, &real_error)) {
+			g_message ("Error when parsing key file {\n%s\n}: %s", stdout_contents, real_error->message);
+			g_propagate_error (error, real_error);
+			g_key_file_free (key_file);
+			retval = FALSE;
+			goto out;
+		}
+
+		retval = TRUE;
+		*ret_key_file = key_file;
+	} else
+		retval = TRUE;
+
+	/* g_message ("success from calling net usershare and parsing its output"); */
+
+ out:
+	g_free (real_argv);
+	g_free (stdout_contents);
+	g_free (stderr_contents);
+
+	/* g_message ("------------------------------------------"); */
+
+	return retval;
+}
+
+/* Internals */
+
+static void
+ensure_hashes (void)
+{
+	if (path_share_info_hash == NULL) {
+		g_assert (share_name_share_info_hash == NULL);
+
+		path_share_info_hash = g_hash_table_new (g_str_hash, g_str_equal);
+		share_name_share_info_hash = g_hash_table_new (g_str_hash, g_str_equal);
+	} else
+		g_assert (share_name_share_info_hash != NULL);
+}
+
+static ShareInfo *
+lookup_share_by_path (const char *path)
+{
+	ensure_hashes ();
+	return g_hash_table_lookup (path_share_info_hash, path);
+}
+
+static ShareInfo *
+lookup_share_by_share_name (const char *share_name)
+{
+	ensure_hashes ();
+	return g_hash_table_lookup (share_name_share_info_hash, share_name);
+}
+
+static void
+add_share_info_to_hashes (ShareInfo *info)
+{
+	ensure_hashes ();
+	g_hash_table_insert (path_share_info_hash, info->path, info);
+	g_hash_table_insert (share_name_share_info_hash, info->share_name, info);
+}
+
+static void
+remove_share_info_from_hashes (ShareInfo *info)
+{
+	ensure_hashes ();
+	g_hash_table_remove (path_share_info_hash, info->path);
+	g_hash_table_remove (share_name_share_info_hash, info->share_name);
+}
+
+static gboolean
+remove_from_path_hash_cb (gpointer key,
+			  gpointer value,
+			  gpointer data)
+{
+	ShareInfo *info;
+
+	info = value;
+	shares_free_share_info (info);
+
+	return TRUE;
+}
+
+static gboolean
+remove_from_share_name_hash_cb (gpointer key,
+				gpointer value,
+				gpointer data)
+{
+	/* The ShareInfo was already freed in remove_from_path_hash_cb() */
+	return TRUE;
+}
+
+static void
+free_all_shares (void)
+{
+	ensure_hashes ();
+	g_hash_table_foreach_remove (path_share_info_hash, remove_from_path_hash_cb, NULL);
+	g_hash_table_foreach_remove (share_name_share_info_hash, remove_from_share_name_hash_cb, NULL);
+}
+
+static char *
+get_string_from_key_file (GKeyFile *key_file, const char *group, const char *key)
+{
+	GError *error;
+	char *str;
+
+	error = NULL;
+	str = NULL;
+
+	if (g_key_file_has_key (key_file, group, key, &error)) {
+		str = g_key_file_get_string (key_file, group, key, &error);
+		if (!str) {
+			g_assert (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND)
+				  && !g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND));
+
+			g_error_free (error);
+		}
+	} else {
+		g_assert (!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND));
+		g_error_free (error);
+	}
+
+	return str;
+}
+
+static void
+add_key_group_to_hashes (GKeyFile *key_file, const char *group)
+{
+	char *path;
+	char *comment;
+	char *acl;
+	gboolean is_writable;
+	char *guest_ok_str;
+	gboolean guest_ok;
+	ShareInfo *info;
+	ShareInfo *old_info;
+
+	/* Remove the old share based on the name */
+
+	old_info = lookup_share_by_share_name (group);
+	if (old_info) {
+		remove_share_info_from_hashes (old_info);
+		shares_free_share_info (old_info);
+	}
+
+	/* Start parsing, and remove the old share based on the path */
+
+	path = get_string_from_key_file (key_file, group, KEY_PATH);
+	if (!path) {
+		g_message ("group '%s' doesn't have a '%s' key!  Ignoring group.", group, KEY_PATH);
+		return;
+	}
+
+	old_info = lookup_share_by_path (path);
+	if (old_info) {
+		remove_share_info_from_hashes (old_info);
+		shares_free_share_info (old_info);
+	}
+
+	/* Finish parsing */
+
+	comment = get_string_from_key_file (key_file, group, KEY_COMMENT);
+
+	acl = get_string_from_key_file (key_file, group, KEY_ACL);
+	if (acl) {
+		if (strstr (acl, "Everyone:R"))
+			is_writable = FALSE;
+		else if (strstr (acl, "Everyone:F"))
+			is_writable = TRUE;
+		else {
+			g_message ("unknown format for key '%s/%s' as it contains '%s'.  Assuming that the share is read-only",
+				   group, KEY_ACL, acl);
+			is_writable = FALSE;
+		}
+
+		g_free (acl);
+	} else {
+		g_message ("group '%s' doesn't have a '%s' key!  Assuming that the share is read-only.", group, KEY_ACL);
+		is_writable = FALSE;
+	}
+
+	guest_ok_str = get_string_from_key_file (key_file, group, KEY_GUEST_OK);
+	if (guest_ok_str) {
+		if (strcmp (guest_ok_str, "n") == 0)
+			guest_ok = FALSE;
+		else if (strcmp (guest_ok_str, "y") == 0)
+			guest_ok = TRUE;
+		else {
+			g_message ("unknown format for key '%s/%s' as it contains '%s'.  Assuming that the share is not guest accessible.",
+				   group, KEY_GUEST_OK, guest_ok_str);
+			guest_ok = FALSE;
+		}
+
+		g_free (guest_ok_str);
+	} else {
+		g_message ("group '%s' doesn't have a '%s' key!  Assuming that the share is not guest accessible.", group, KEY_GUEST_OK);
+		guest_ok = FALSE;
+	}
+
+	g_assert (path != NULL);<--- Condition 'path!=NULL' is always true
+	g_assert (group != NULL);
+
+	info = g_new (ShareInfo, 1);
+	info->path = path;
+	info->share_name = g_strdup (group);
+	info->comment = comment;
+	info->is_writable = is_writable;
+	info->guest_ok = guest_ok;
+
+	add_share_info_to_hashes (info);
+}
+
+static void
+replace_shares_from_key_file (GKeyFile *key_file)
+{
+	gsize num_groups;
+	char **group_names;
+	gsize i;
+
+	group_names = g_key_file_get_groups (key_file, &num_groups);
+
+	/* FIXME: In add_key_group_to_hashes(), we simply ignore key groups
+	 * which have invalid data (i.e. no path).  We could probably accumulate a
+	 * GError with the list of invalid groups and propagate it upwards.
+	 */
+	for (i = 0; i < num_groups; i++) {
+		g_assert (group_names[i] != NULL);
+		add_key_group_to_hashes (key_file, group_names[i]);
+	}
+
+	g_strfreev (group_names);
+}
+
+static gboolean
+refresh_shares (GError **error)
+{
+	GKeyFile *key_file;
+	char *argv[1];
+	GError *real_error;
+
+	free_all_shares ();
+
+	if (throw_error_on_refresh) {
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_FAILED,
+			     _("Failed"));
+		return FALSE;
+	}
+
+	argv[0] = "info";
+
+	real_error = NULL;
+	if (!net_usershare_run (G_N_ELEMENTS (argv), argv, &key_file, &real_error)) {
+		g_message ("Called \"net usershare info\" but it failed: %s", real_error->message);
+		g_propagate_error (error, real_error);
+		return FALSE;
+	}
+
+	g_assert (key_file != NULL);
+
+	replace_shares_from_key_file (key_file);
+	g_key_file_free (key_file);
+
+	return TRUE;
+}
+
+static gboolean
+refresh_if_needed (GError **error)
+{
+	gboolean retval;
+
+	if (refresh_timestamp_update_counter == 0) {
+		time_t new_timestamp;
+
+		refresh_timestamp_update_counter = NUM_CALLS_BETWEEN_TIMESTAMP_UPDATES;
+
+		new_timestamp = time (NULL);
+		if (new_timestamp - refresh_timestamp > TIMESTAMP_THRESHOLD) {
+		  /* g_message ("REFRESHING SHARES"); */
+			retval = refresh_shares (error);
+		} else
+			retval = TRUE;
+
+		refresh_timestamp = new_timestamp;
+	} else {
+		refresh_timestamp_update_counter--;
+		retval = TRUE;
+	}
+
+	return retval;
+}
+
+static ShareInfo *
+copy_share_info (ShareInfo *info)
+{
+	ShareInfo *copy;
+
+	if (!info)
+		return NULL;
+
+	copy = g_new (ShareInfo, 1);
+	copy->path = g_strdup (info->path);
+	copy->share_name = g_strdup (info->share_name);
+	copy->comment = g_strdup (info->comment);
+	copy->is_writable = info->is_writable;
+	copy->guest_ok = info->guest_ok;
+
+	return copy;
+}
+
+/**
+ * shares_supports_guest_ok:
+ * @supports_guest_ok_ret: Location to store whether "usershare allow guests"
+ * is enabled.
+ * @error: Location to store error, or #NULL.
+ *
+ * Determines whether the option "usershare allow guests" is enabled in samba
+ * config as shown by testparm.
+ *
+ * Return value: #TRUE if if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned
+ * in the @error argument, and *@ret_info_list will be set to #FALSE.
+ **/
+gboolean
+shares_supports_guest_ok (gboolean *supports_guest_ok_ret, GError **error)
+{
+	gboolean retval;
+	gboolean result;
+	char *stdout_contents;
+	char *stderr_contents;
+	int exit_status;
+	int exit_code;
+
+	*supports_guest_ok_ret = FALSE;
+
+	result = g_spawn_command_line_sync ("testparm -s --parameter-name='usershare allow guests'",
+					    &stdout_contents,
+					    &stderr_contents,
+					    &exit_status,
+					    error);
+	if (!result)
+		return FALSE;
+
+	retval = FALSE;
+
+	if (!WIFEXITED (exit_status)) {
+		if (WIFSIGNALED (exit_status)) {
+			int signal_num;
+
+			signal_num = WTERMSIG (exit_status);
+			g_set_error (error,
+				     SHARES_ERROR,
+				     SHARES_ERROR_FAILED,
+				     _("Samba's testparm returned with signal %d"),
+				     signal_num);
+		} else
+			g_set_error (error,
+				     SHARES_ERROR,
+				     SHARES_ERROR_FAILED,
+				     _("Samba's testparm failed for an unknown reason"));
+
+		goto out;
+	}
+
+	exit_code = WEXITSTATUS (exit_status);
+	if (exit_code != 0) {
+		char *str;
+		char *message;
+
+		/* stderr_contents is in the system locale encoding, not UTF-8 */
+
+		str = g_locale_to_utf8 (stderr_contents, -1, NULL, NULL, NULL);
+
+		if (str && str[0])
+			message = g_strdup_printf (_("Samba's testparm returned error %d: %s"), exit_code, str);
+		else
+			message = g_strdup_printf (_("Samba's testparm returned error %d"), exit_code);
+
+		g_free (str);
+
+		g_set_error (error,
+			     G_SPAWN_ERROR,
+			     G_SPAWN_ERROR_FAILED,
+			     "%s",
+			     message);
+
+		g_free (message);
+
+		goto out;
+	}
+
+	retval = TRUE;
+	*supports_guest_ok_ret = (g_ascii_strncasecmp (stdout_contents, "Yes", 3) == 0);
+
+ out:
+	g_free (stdout_contents);
+	g_free (stderr_contents);
+
+	return retval;
+}
+
+static gboolean
+add_share (ShareInfo *info, GError **error)
+{
+	char *argv[7];
+	int argc;
+	ShareInfo *copy;
+	GKeyFile *key_file;
+	GError *real_error;
+	gboolean supports_success;
+	gboolean supports_guest_ok;
+	gboolean net_usershare_success;
+
+	/*	g_message ("add_share() start"); */
+
+	if (throw_error_on_add) {
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_FAILED,
+			     _("Failed"));
+		g_message ("add_share() end FAIL");
+		return FALSE;
+	}
+
+	supports_success = shares_supports_guest_ok (&supports_guest_ok, error);
+	if (!supports_success)
+		return FALSE;
+
+	argv[0] = "add";
+	argv[1] = "--long";
+	argv[2] = info->share_name;
+	argv[3] = info->path;
+	argv[4] = info->comment;
+	argv[5] = info->is_writable ? "Everyone:F" : g_strdup_printf ("Everyone:R,%s:F", g_get_user_name ());
+
+	if (supports_guest_ok) {
+		argv[6] = info->guest_ok ? "guest_ok=y" : "guest_ok=n";
+		argc = 7;
+	} else
+		argc = 6;
+
+	real_error = NULL;
+	net_usershare_success = net_usershare_run (argc, argv, &key_file, &real_error);
+	if (!info->is_writable) g_free (argv[5]);
+
+	if (!net_usershare_success) {
+		g_message ("Called \"net usershare add\" but it failed: %s", real_error->message);
+		g_propagate_error (error, real_error);
+		return FALSE;
+	}
+
+	replace_shares_from_key_file (key_file);
+
+	copy = copy_share_info (info);
+	add_share_info_to_hashes (copy);
+
+	/* g_message ("add_share() end SUCCESS"); */
+
+	return TRUE;
+}
+
+static gboolean
+remove_share (const char *path, GError **error)
+{
+	ShareInfo *old_info;
+	char *argv[2];
+	GError *real_error;
+
+	/* g_message ("remove_share() start"); */
+
+	if (throw_error_on_remove) {
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_FAILED,
+			     "Failed");
+		g_message ("remove_share() end FAIL");
+		return FALSE;
+	}
+
+	old_info = lookup_share_by_path (path);
+	if (!old_info) {
+		char *display_name;
+
+		display_name = g_filename_display_name (path);
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_NONEXISTENT,
+			     _("Cannot remove the share for path %s: that path is not shared"),
+			     display_name);
+		g_free (display_name);
+
+		g_message ("remove_share() end FAIL: path %s was not in our hashes", path);
+		return FALSE;
+	}
+
+	argv[0] = "delete";
+	argv[1] = old_info->share_name;
+
+	real_error = NULL;
+	if (!net_usershare_run (G_N_ELEMENTS (argv), argv, NULL, &real_error)) {
+		g_message ("Called \"net usershare delete\" but it failed: %s", real_error->message);
+		g_propagate_error (error, real_error);
+		g_message ("remove_share() end FAIL");
+		return FALSE;
+	}
+
+	remove_share_info_from_hashes (old_info);
+	shares_free_share_info (old_info);
+
+	/* g_message ("remove_share() end SUCCESS"); */
+
+	return TRUE;
+}
+
+static gboolean
+modify_share (const char *old_path, ShareInfo *info, GError **error)
+{
+	ShareInfo *old_info;
+
+ 	/* g_message ("modify_share() start"); */
+
+	old_info = lookup_share_by_path (old_path);
+	if (old_info == NULL) {
+	  /*g_message ("modify_share() end; calling add_share() instead");*/
+		return add_share (info, error);
+	}
+
+	g_assert (old_info != NULL);<--- Condition 'old_info!=NULL' is always true
+
+	if (strcmp (info->path, old_info->path) != 0) {
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_FAILED,
+			     _("Cannot change the path of an existing share; please remove the old share first and add a new one"));
+		g_message ("modify_share() end FAIL: tried to change the path in a share!");
+		return FALSE;
+	}
+
+	if (throw_error_on_modify) {
+		g_set_error (error,
+			     SHARES_ERROR,
+			     SHARES_ERROR_FAILED,
+			     "Failed");
+		g_message ("modify_share() end FAIL");
+		return FALSE;
+	}
+
+	/* Although "net usershare add" will modify an existing share if it has the same share name
+	 * as the one that gets passed in, our semantics are different.  We have a one-to-one mapping
+	 * between paths and share names; "net usershare" supports a one-to-many mapping from paths
+	 * to share names.  So, we must first remove the old share and then add the new/modified one.
+	 */
+
+	if (!remove_share (old_path, error)) {
+		g_message ("modify_share() end FAIL: error when removing old share");
+		return FALSE;
+	}
+
+	/* g_message ("modify_share() end: will call add_share() with the new share info"); */
+	return add_share (info, error);
+}
+
+/* Public API */
+
+GQuark
+shares_error_quark (void)
+{
+	static GQuark quark;
+
+	if (quark == 0)
+		quark = g_quark_from_string ("caja-share-error-quark"); /* not from_static_string since we are a module */
+
+	return quark;
+}
+
+/**
+ * shares_free_share_info:
+ * @info: A #ShareInfo structure.
+ *
+ * Frees a #ShareInfo structure.
+ **/
+void
+shares_free_share_info (ShareInfo *info)
+{
+	g_assert (info != NULL);
+
+	g_free (info->path);
+	g_free (info->share_name);
+	g_free (info->comment);
+	g_free (info);
+}
+
+/**
+ * shares_get_path_is_shared:
+ * @path: A full path name ("/foo/bar/baz") in file system encoding.
+ * @ret_is_shared: Location to store result value (#TRUE if the path is shared, #FALSE otherwise)
+ * @error: Location to store error, or #NULL.
+ *
+ * Checks whether a path is shared through Samba.
+ *
+ * Return value: #TRUE if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned in the
+ * @error argument, and *@ret_is_shared will be set to #FALSE.
+ **/
+gboolean
+shares_get_path_is_shared (const char *path, gboolean *ret_is_shared, GError **error)
+{
+	g_assert (ret_is_shared != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error)) {
+		*ret_is_shared = FALSE;
+		return FALSE;
+	}
+
+	*ret_is_shared = (lookup_share_by_path (path) != NULL);
+
+	return TRUE;
+}
+
+/**
+ * shares_get_share_info_for_path:
+ * @path: A full path name ("/foo/bar/baz") in file system encoding.
+ * @ret_share_info: Location to store result with the share's info - on return,
+ * will be non-NULL if the path is indeed shared, or #NULL if the path is not
+ * shared.  You must free the non-NULL value with shares_free_share_info().
+ * @error: Location to store error, or #NULL.
+ *
+ * Queries the information for a shared path:  its share name, its read-only status, etc.
+ *
+ * Return value: #TRUE if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned in the
+ * @error argument, and *@ret_share_info will be set to #NULL.
+ **/
+gboolean
+shares_get_share_info_for_path (const char *path, ShareInfo **ret_share_info, GError **error)
+{
+	ShareInfo *info;
+
+	g_assert (path != NULL);
+	g_assert (ret_share_info != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error)) {
+		*ret_share_info = NULL;
+		return FALSE;
+	}
+
+	info = lookup_share_by_path (path);
+	*ret_share_info = copy_share_info (info);
+
+	return TRUE;
+}
+
+/**
+ * shares_get_share_name_exists:
+ * @share_name: Name of a share.
+ * @ret_exists: Location to store return value; #TRUE if the share name exists, #FALSE otherwise.
+ *
+ * Queries whether a share name already exists in the user's list of shares.
+ *
+ * Return value: #TRUE if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned in the
+ * @error argument, and *@ret_exists will be set to #FALSE.
+ **/
+gboolean
+shares_get_share_name_exists (const char *share_name, gboolean *ret_exists, GError **error)
+{
+	g_assert (share_name != NULL);
+	g_assert (ret_exists != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error)) {
+		*ret_exists = FALSE;
+		return FALSE;
+	}
+
+	*ret_exists = (lookup_share_by_share_name (share_name) != NULL);
+
+	return TRUE;
+}
+
+/**
+ * shares_get_share_info_for_share_name:
+ * @share_name: Name of a share.
+ * @ret_share_info: Location to store result with the share's info - on return,
+ * will be non-NULL if there is a share for the specified name, or #NULL if no
+ * share has such name.  You must free the non-NULL value with
+ * shares_free_share_info().
+ * @error: Location to store error, or #NULL.
+ *
+ * Queries the information for the share which has a specific name.
+ *
+ * Return value: #TRUE if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned in the
+ * @error argument, and *@ret_share_info will be set to #NULL.
+ **/
+gboolean
+shares_get_share_info_for_share_name (const char *share_name, ShareInfo **ret_share_info, GError **error)
+{
+	ShareInfo *info;
+
+	g_assert (share_name != NULL);
+	g_assert (ret_share_info != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error)) {
+		*ret_share_info = NULL;
+		return FALSE;
+	}
+
+	info = lookup_share_by_share_name (share_name);
+	*ret_share_info = copy_share_info (info);
+
+	return TRUE;
+}
+
+/**
+ * shares_modify_share:
+ * @old_path: Path of the share to modify, or %NULL.
+ * @info: Info of the share to modify/add, or %NULL to delete a share.
+ * @error: Location to store error, or #NULL.
+ *
+ * Can add, modify, or delete shares.  To add a share, pass %NULL for @old_path,
+ * and a non-null @info.  To modify a share, pass a non-null @old_path and
+ * non-null @info; in this case, @info->path must have the same contents as
+ * @old_path.  To remove a share, pass a non-NULL @old_path and a %NULL @info.
+ *
+ * Return value: TRUE if the share could be modified, FALSE otherwise.  If this returns
+ * FALSE, then the error information will be placed in @error.
+ **/
+gboolean
+shares_modify_share (const char *old_path, ShareInfo *info, GError **error)
+{
+	g_assert ((old_path == NULL && info != NULL)
+		  || (old_path != NULL && info == NULL)
+		  || (old_path != NULL && info != NULL));
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error))
+		return FALSE;
+
+	if (old_path == NULL)
+		return add_share (info, error);
+	else if (info == NULL)
+		return remove_share (old_path, error);
+	else
+		return modify_share (old_path, info, error);
+}
+
+static void
+copy_to_slist_cb (gpointer key, gpointer value, gpointer data)
+{
+	ShareInfo *info;
+	ShareInfo *copy;
+	GSList **list;
+
+	info = value;
+	list = data;
+
+	copy = copy_share_info (info);
+	*list = g_slist_prepend (*list, copy);
+}
+
+/**
+ * shares_get_share_info_list:
+ * @ret_info_list: Location to store the return value, which is a list
+ * of #ShareInfo structures.  Free this with shares_free_share_info_list().
+ * @error: Location to store error, or #NULL.
+ *
+ * Gets the list of shared folders and their information.
+ *
+ * Return value: #TRUE if the info could be queried successfully, #FALSE
+ * otherwise.  If this function returns #FALSE, an error code will be returned in the
+ * @error argument, and *@ret_info_list will be set to #NULL.
+ **/
+gboolean
+shares_get_share_info_list (GSList **ret_info_list, GError **error)
+{
+	g_assert (ret_info_list != NULL);
+	g_assert (error == NULL || *error == NULL);
+
+	if (!refresh_if_needed (error)) {
+		*ret_info_list = NULL;
+		return FALSE;
+	}
+
+	*ret_info_list = NULL;
+	g_hash_table_foreach (path_share_info_hash, copy_to_slist_cb, ret_info_list);
+
+	return TRUE;
+}
+
+/**
+ * shares_free_share_info_list:
+ * @list: List of #ShareInfo structures, or %NULL.
+ *
+ * Frees a list of #ShareInfo structures as returned by shares_get_share_info_list().
+ **/
+void
+shares_free_share_info_list (GSList *list)
+{
+	GSList *l;
+
+	for (l = list; l; l = l->next) {
+		shares_free_share_info (l->data);
+	}
+
+	g_slist_free (list);
+}
+
+void
+shares_set_debug (gboolean error_on_refresh,
+		  gboolean error_on_add,
+		  gboolean error_on_modify,
+		  gboolean error_on_remove)
+{
+	throw_error_on_refresh = error_on_refresh;
+	throw_error_on_add = error_on_add;
+	throw_error_on_modify = error_on_modify;
+	throw_error_on_remove = error_on_remove;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/37.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/37.html new file mode 100644 index 0000000..f4aa4db --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/37.html @@ -0,0 +1,361 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
/*
+ *  Caja Wallpaper extension
+ *
+ *  Copyright (C) 2005 Adam Israel
+ *  Copyright (C) 2014 Stefano Karapetsas
+ *  Copyright (C) 2014-2021 MATE developers.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Authors: Adam Israel <adam@battleaxe.net>
+ *           Stefano Karapetsas <stefano@karapetsas.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-wallpaper-extension.h"
+
+void
+caja_module_initialize (GTypeModule*module)
+{
+    g_print ("Initializing caja-wallpaper extension\n");
+    caja_cwe_register_type (module);
+#ifdef ENABLE_NLS
+    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+    g_print ("Shutting down caja-wallpaper extension\n");
+}
+
+void
+caja_module_list_types (const GType **types, int *num_types)
+{
+    static GType type_list[1];
+
+    type_list[0] = CAJA_TYPE_CWE;
+    *types = type_list;
+    *num_types = 1;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/38.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/38.html new file mode 100644 index 0000000..2e09312 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/38.html @@ -0,0 +1,343 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
/*
+ *  Caja Wallpaper extension
+ *
+ *  Copyright (C) 2005 Adam Israel
+ *  Copyright (C) 2014 Stefano Karapetsas
+ *  Copyright (C) 2014-2021 MATE developers.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Authors: Adam Israel <adam@battleaxe.net>
+ *           Stefano Karapetsas <stefano@karapetsas.com>
+ */
+
+#ifndef CAJA_WALLPAPER_EXTENSION_H
+#define CAJA_WALLPAPER_EXTENSION_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define CAJA_TYPE_CWE  (caja_cwe_get_type ())
+#define CAJA_CWE(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_CWE, CajaCwe))
+#define CAJA_IS_CWE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_CWE))
+
+typedef struct _CajaCwe      CajaCwe;
+typedef struct _CajaCweClass CajaCweClass;
+
+struct _CajaCwe {
+	GObject __parent;
+};
+
+struct _CajaCweClass {
+	GObjectClass __parent;
+};
+
+GType caja_cwe_get_type      (void);
+void  caja_cwe_register_type (GTypeModule *module);
+
+G_END_DECLS
+
+#endif /* CAJA_WALLPAPER_EXTENSION_H */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/39.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/39.html new file mode 100644 index 0000000..e09ee81 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/39.html @@ -0,0 +1,611 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
/*
+ *  Caja Wallpaper extension
+ *
+ *  Copyright (C) 2005 Adam Israel
+ *  Copyright (C) 2014 Stefano Karapetsas
+ *  Copyright (C) 2014-2021 MATE developers.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Authors: Adam Israel <adam@battleaxe.net>
+ *           Stefano Karapetsas <stefano@karapetsas.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include "caja-wallpaper-extension.h"
+
+#define WP_SCHEMA "org.mate.background"
+#define WP_FILE_KEY "picture-filename"
+
+static GObjectClass *parent_class;
+
+static void
+set_wallpaper_callback (CajaMenuItem *item,
+              gpointer          user_data)
+{
+    GList *files;
+    GSettings *settings;
+    CajaFileInfo *file;
+    gchar *uri;
+    gchar *filename;
+
+    files = g_object_get_data (G_OBJECT (item), "files");
+    file = files->data;
+
+    uri = caja_file_info_get_uri (file);
+    filename = g_filename_from_uri(uri, NULL, NULL);
+
+    settings = g_settings_new (WP_SCHEMA);
+
+    g_settings_set_string (settings, WP_FILE_KEY, filename);
+
+    g_object_unref (settings);
+    g_free (filename);
+    g_free (uri);
+
+}
+
+static gboolean
+is_image (CajaFileInfo *file)
+{
+    gchar   *mimeType;
+    gboolean isImage;
+
+    mimeType = caja_file_info_get_mime_type (file);
+    isImage = g_str_has_prefix (mimeType, "image/");
+    g_free (mimeType);
+    return isImage;
+}
+
+static GList *
+caja_cwe_get_file_items (CajaMenuProvider *provider,
+                  GtkWidget            *window,
+                  GList                *files)
+{
+    GList    *items = NULL;
+    GList    *scan;
+    gboolean  one_item;
+    CajaMenuItem *item;
+
+    for (scan = files; scan; scan = scan->next) {
+        CajaFileInfo *file = scan->data;
+        gchar            *scheme;
+        gboolean          local;
+
+        scheme = caja_file_info_get_uri_scheme (file);
+        local = strncmp (scheme, "file", 4) == 0;
+        g_free (scheme);
+
+        if (!local)
+            return NULL;
+    }
+
+    one_item = (files != NULL) && (files->next == NULL);
+    if (one_item && is_image ((CajaFileInfo *)files->data) &&
+        !caja_file_info_is_directory ((CajaFileInfo *)files->data)) {
+        item = caja_menu_item_new ("CajaCwe::sendto",
+                           _("Set as wallpaper"),
+                           _("Set image as the current wallpaper"),
+                           NULL);
+        g_signal_connect (item,
+                  "activate",
+                  G_CALLBACK (set_wallpaper_callback),
+                provider);
+        g_object_set_data_full (G_OBJECT (item),
+                    "files",
+                    caja_file_info_list_copy (files),
+                    (GDestroyNotify) caja_file_info_list_free);
+        items = g_list_append (items, item);
+    }
+    return items;
+}
+
+static void
+caja_cwe_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+    iface->get_file_items = caja_cwe_get_file_items;
+}
+
+static void
+caja_cwe_instance_init (CajaCwe *cwe)
+{
+}
+
+static void
+caja_cwe_class_init (CajaCweClass *class)
+{
+    parent_class = g_type_class_peek_parent (class);
+}
+
+static GType cwe_type = 0;
+
+GType
+caja_cwe_get_type (void)
+{
+    return cwe_type;
+}
+
+void
+caja_cwe_register_type (GTypeModule *module)
+{
+    static const GTypeInfo info = {
+        sizeof (CajaCweClass),
+        (GBaseInitFunc) NULL,
+        (GBaseFinalizeFunc) NULL,
+        (GClassInitFunc) caja_cwe_class_init,
+        NULL,
+        NULL,
+        sizeof (CajaCwe),
+        0,
+        (GInstanceInitFunc) caja_cwe_instance_init,
+        NULL
+    };
+
+    static const GInterfaceInfo menu_provider_iface_info = {
+        (GInterfaceInitFunc) caja_cwe_menu_provider_iface_init,
+        NULL,
+        NULL
+    };
+
+    cwe_type = g_type_module_register_type (module,
+                             G_TYPE_OBJECT,
+                             "CajaCwe",
+                             &info, 0);
+
+    g_type_module_add_interface (module,
+                     cwe_type,
+                     CAJA_TYPE_MENU_PROVIDER,
+                     &menu_provider_iface_info);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/4.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/4.html new file mode 100644 index 0000000..a703cb0 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/4.html @@ -0,0 +1,547 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
/*
+ * Copyright (C) 2000, 2001 Eazel Inc.
+ * Copyright (C) 2003  Andrew Sobala <aes@gnome.org>
+ * Copyright (C) 2005  Bastien Nocera <hadess@hadess.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#define GST_USE_UNSTABLE_API 1
+#include <gst/gst.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "totem-properties-view.h"
+#include "totem-gst-helpers.h"
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-property-page-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define WANT_MIME_TYPES 1
+#include "totem-mime-types.h"
+
+static GType tpp_type = 0;
+static void property_page_provider_iface_init
+	(CajaPropertyPageProviderIface *iface);
+static GList *totem_properties_get_pages
+	(CajaPropertyPageProvider *provider, GList *files);
+
+static void
+totem_properties_plugin_register_type (GTypeModule *module)
+{
+	const GTypeInfo info = {
+		sizeof (GObjectClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) NULL,
+		NULL,
+		NULL,
+		sizeof (GObject),
+		0,
+		(GInstanceInitFunc) NULL
+	};
+	const GInterfaceInfo property_page_provider_iface_info = {
+		(GInterfaceInitFunc)property_page_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	tpp_type = g_type_module_register_type (module, G_TYPE_OBJECT,
+			"TotemPropertiesPlugin",
+			&info, 0);
+	g_type_module_add_interface (module,
+			tpp_type,
+			CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
+			&property_page_provider_iface_info);
+}
+
+static void
+property_page_provider_iface_init (CajaPropertyPageProviderIface *iface)
+{
+	iface->get_pages = totem_properties_get_pages;
+}
+
+static gpointer
+init_backend (gpointer data)
+{
+	gst_init (NULL, NULL);
+	totem_gst_disable_display_decoders ();
+	return NULL;
+}
+
+static GList *
+totem_properties_get_pages (CajaPropertyPageProvider *provider,
+			     GList *files)
+{
+	static GOnce backend_inited = G_ONCE_INIT;
+	CajaFileInfo *file;
+	char *uri;
+	GtkWidget *page, *label;
+	CajaPropertyPage *property_page;
+	guint i;
+	gboolean found;
+
+	/* only add properties page if a single file is selected */
+	if (files == NULL || files->next != NULL)
+		return NULL;
+	file = files->data;
+
+	/* only add the properties page to these mime types */
+	found = FALSE;
+	for (i = 0; mime_types[i] != NULL; i++) {
+		if (caja_file_info_is_mime_type (file, mime_types[i])) {
+			found = TRUE;
+			break;
+		}
+	}
+	if (found == FALSE)
+		return NULL;
+
+	/* okay, make the page, init'ing the backend first if necessary */
+	g_once (&backend_inited, init_backend, NULL);
+
+	uri = caja_file_info_get_uri (file);
+	label = gtk_label_new (_("Audio/Video"));
+	page = totem_properties_view_new (uri, label);
+	g_free (uri);
+
+	gtk_container_set_border_width (GTK_CONTAINER (page), 6);
+	property_page = caja_property_page_new ("video-properties",
+			label, page);
+
+	return g_list_prepend (NULL, property_page);
+}
+
+/* --- extension interface --- */
+void
+caja_module_initialize (GTypeModule *module)
+{
+	/* set up translation catalog */
+	bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
+	totem_properties_plugin_register_type (module);
+	totem_properties_view_register_type (module);
+}
+
+void
+caja_module_shutdown (void)
+{
+}
+
+void
+caja_module_list_types (const GType **types,
+                            int          *num_types)
+{
+	static GType type_list[1];
+
+	type_list[0] = tpp_type;
+	*types = type_list;
+	*num_types = G_N_ELEMENTS (type_list);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/40.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/40.html new file mode 100644 index 0000000..6af26c4 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/40.html @@ -0,0 +1,857 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
/*
+ *  Caja xattr tags extension
+ *
+ *  Copyright (C) 2016 Felipe Barriga Richards
+ *  Copyright (C) 2016-2021 MATE developers.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Authors: Felipe Barriga Richards <spam@felipebarriga.cl>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-info-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-xattr-tags-extension.h"
+
+#define XATTR_TAGS_NAME "Xattr::Tags"
+#define XATTR_TAGS_ATTRIBUTE "xattr_tags"
+
+#define G_FILE_ATTRIBUTE_XATTR_XDG_TAGS "xattr::xdg.tags"
+
+static GObjectClass *parent_class;
+
+typedef struct {
+    gboolean cancelled;
+    CajaInfoProvider *provider;
+    CajaFileInfo *file;
+    GClosure *update_complete;
+} CajaXattrTagsHandle;
+
+/* List of protocols that don't support xattr retriving,
+ * so we can skip it safetely
+ */
+static gchar *protocols_blacklist[] = {
+    "mtp://",
+    "gphoto2://",
+
+    NULL
+};
+
+/* Stolen code: why they didn't expose it!?
+ * file: glocalfileinfo.c
+ * function: hex_unescape_string
+ * GIO - GLib Input, Output and Streaming Library
+ */
+static char *
+hex_unescape_string (const char *str,
+                     int        *out_len,
+                     gboolean   *free_return)
+{
+    int i;
+    char *unescaped_str, *p;
+    unsigned char c;
+    int len;
+
+    len = strlen (str);
+
+    if (strchr (str, '\\') == NULL)
+    {
+        if (out_len)
+            *out_len = len;
+        *free_return = FALSE;
+        return (char *)str;
+    }
+
+    unescaped_str = g_malloc (len + 1);
+
+    p = unescaped_str;
+    for (i = 0; i < len; i++)
+    {
+        if (str[i] == '\\' &&
+            str[i+1] == 'x' &&
+            len - i >= 4)
+        {
+            c =
+                (g_ascii_xdigit_value (str[i+2]) << 4) |
+                g_ascii_xdigit_value (str[i+3]);
+            *p++ = c;
+            i += 3;
+        }
+        else
+            *p++ = str[i];
+    }
+    *p++ = 0;
+
+    if (out_len)
+        *out_len = p - unescaped_str;
+    *free_return = TRUE;
+    return unescaped_str;
+}
+/* End of stolen code */
+
+static gchar *caja_xattr_tags_get_xdg_tags(CajaFileInfo *file)
+{
+    gchar *tags = NULL, *uri;
+    GFile *location;
+    GFileInfo *info;
+    int i;
+
+    uri = caja_file_info_get_activation_uri (file);
+    for (i = 0 ; protocols_blacklist[i] ; i++) {
+        int l = strlen(protocols_blacklist[i]);
+
+        if (strlen(uri) < l)
+            continue;
+        if (strncasecmp(uri, protocols_blacklist[i], l))
+            continue;
+
+        g_free (uri);
+        return NULL;
+    }
+
+    location = g_file_new_for_uri (uri);
+    info = g_file_query_info (location,
+                              G_FILE_ATTRIBUTE_XATTR_XDG_TAGS,
+                              0,
+                              NULL,
+                              NULL);
+
+    if (info) {
+        if (g_file_info_has_attribute(info, G_FILE_ATTRIBUTE_XATTR_XDG_TAGS)) {
+            const gchar *escaped_tags =
+                g_file_info_get_attribute_string(info, G_FILE_ATTRIBUTE_XATTR_XDG_TAGS);
+
+            gboolean new_created = FALSE;
+            gchar *un_escaped_tags = hex_unescape_string (escaped_tags, NULL, &new_created);
+            if (new_created) {
+                tags = un_escaped_tags;
+            } else {
+                /* the string didn't contain any escaped character */
+                tags = g_strdup(escaped_tags);
+            }
+        }
+        g_object_unref (info);
+    }
+    g_object_unref (location);
+    g_free (uri);
+
+    return tags;
+}
+
+static CajaOperationResult
+caja_xattr_tags_update_file_info(CajaInfoProvider *provider,
+                            CajaFileInfo *file,
+                            GClosure *update_complete,
+                            CajaOperationHandle **handle)
+{
+    gchar *value = caja_xattr_tags_get_xdg_tags(file);
+    if (value != NULL) {
+        caja_file_info_add_string_attribute(file, XATTR_TAGS_ATTRIBUTE, value);
+        g_free(value);
+    } else {
+        caja_file_info_add_string_attribute(file, XATTR_TAGS_ATTRIBUTE, "");
+    }
+    return CAJA_OPERATION_COMPLETE;
+}
+
+static void
+caja_xattr_tags_cancel_update(CajaInfoProvider *provider,
+                         CajaOperationHandle *handle)
+{
+    CajaXattrTagsHandle *xattr_handle;
+
+    xattr_handle = (CajaXattrTagsHandle*)handle;
+    xattr_handle->cancelled = TRUE;
+}
+
+static void
+caja_xattr_tags_info_provider_iface_init(CajaInfoProviderIface *iface)
+{
+    iface->update_file_info = caja_xattr_tags_update_file_info;
+    iface->cancel_update = caja_xattr_tags_cancel_update;
+}
+
+static GList *
+caja_xattr_tags_get_columns(CajaColumnProvider *provider)
+{
+    GList *ret = NULL;
+    CajaColumn *column = NULL;
+
+    column = caja_column_new(XATTR_TAGS_NAME,
+                             XATTR_TAGS_ATTRIBUTE,
+                             _("Tags"),
+                             _("Tags stored in extended attributes"));
+    ret = g_list_append(NULL, column);
+
+    return ret;
+}
+
+static void
+caja_xattr_tags_column_provider_iface_init(CajaColumnProviderIface *iface)
+{
+    iface->get_columns = caja_xattr_tags_get_columns;
+}
+
+static void
+caja_xattr_tags_instance_init(CajaXattrTags *cajaXattrTags)
+{
+}
+
+static void
+caja_xattr_tags_class_init(CajaXattrTagsClass *class)
+{
+    parent_class = g_type_class_peek_parent (class);
+}
+
+static GType caja_xattr_tags_type = 0;
+
+GType
+caja_xattr_tags_get_type(void)
+{
+    return caja_xattr_tags_type;
+}
+
+void
+caja_xattr_tags_register_type(GTypeModule *module)
+{
+    static const GTypeInfo info = {
+        sizeof (CajaXattrTagsClass),
+        (GBaseInitFunc) NULL,
+        (GBaseFinalizeFunc) NULL,
+        (GClassInitFunc) caja_xattr_tags_class_init,
+        NULL,
+        NULL,
+        sizeof (CajaXattrTags),
+        0,
+        (GInstanceInitFunc) caja_xattr_tags_instance_init,
+        NULL
+    };
+
+    caja_xattr_tags_type = g_type_module_register_type (module,
+                                            G_TYPE_OBJECT,
+                                            "CajaXattrTags",
+                                            &info, 0);
+
+    static const GInterfaceInfo info_provider_iface_info = {
+            (GInterfaceInitFunc) caja_xattr_tags_info_provider_iface_init,
+            NULL,
+            NULL
+    };
+
+    g_type_module_add_interface (module,
+                                 CAJA_TYPE_XATTR_TAGS,
+                                 CAJA_TYPE_INFO_PROVIDER,
+                                 &info_provider_iface_info);
+
+    static const GInterfaceInfo column_provider_iface_info = {
+            (GInterfaceInitFunc) caja_xattr_tags_column_provider_iface_init,
+            NULL,
+            NULL
+    };
+
+    g_type_module_add_interface (module,
+                                 CAJA_TYPE_XATTR_TAGS,
+                                 CAJA_TYPE_COLUMN_PROVIDER,
+                                 &column_provider_iface_info);
+
+}
+
+void
+caja_module_initialize (GTypeModule  *module)
+{
+    g_print ("Initializing caja-xattr-tags extension\n");
+    caja_xattr_tags_register_type (module);
+#ifdef ENABLE_NLS
+    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+    g_print ("Shutting down caja-xattr-tags extension\n");
+}
+
+/* List all the extension types.  */
+void
+caja_module_list_types (const GType **types,
+                        int          *num_types)
+{
+    static GType type_list[1];
+
+    type_list[0] = CAJA_TYPE_XATTR_TAGS;
+
+    *types = type_list;
+    *num_types = 1;
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/41.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/41.html new file mode 100644 index 0000000..f33480a --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/41.html @@ -0,0 +1,339 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
/*
+ *  Caja xattr tags extension
+ *
+ *  Copyright (C) 2016 Felipe Barriga Richards
+ *  Copyright (C) 2016-2021 MATE developers.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Authors: Felipe Barriga Richards <spam@felipebarriga.cl>
+ */
+
+#ifndef CAJA_XATTR_TAGS_EXTENSION_H
+#define CAJA_XATTR_TAGS_EXTENSION_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+#define CAJA_TYPE_XATTR_TAGS  (caja_xattr_tags_get_type ())
+#define CAJA_XATTR_TAGS(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), CAJA_TYPE_XATTR_TAGS, cajaXattrTags))
+#define CAJA_IS_XATTR_TAGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAJA_TYPE_XATTR_TAGS))
+
+typedef struct _CajaXattrTags      CajaXattrTags;
+typedef struct _CajaXattrTagsClass CajaXattrTagsClass;
+
+struct _CajaXattrTags {
+	GObject __parent;
+};
+
+struct _CajaXattrTagsClass {
+	GObjectClass __parent;
+};
+
+GType caja_xattr_tags_get_type(void);
+void  caja_xattr_tags_register_type(GTypeModule *module);
+
+G_END_DECLS
+
+#endif /* CAJA_XATTR_TAGS_EXTENSION_H */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/5.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/5.html new file mode 100644 index 0000000..10055df --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/5.html @@ -0,0 +1,335 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
/*
+ * Copyright (C) 2003  Andrew Sobala <aes@gnome.org>
+ * Copyright (C) 2005  Bastien Nocera <hadess@hadess.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef TOTEM_PROPERTIES_VIEW_H
+#define TOTEM_PROPERTIES_VIEW_H
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define TOTEM_TYPE_PROPERTIES_VIEW	    (totem_properties_view_get_type ())
+#define TOTEM_PROPERTIES_VIEW(obj)	    (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesView))
+#define TOTEM_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PROPERTIES_VIEW, TotemPropertiesViewClass))
+#define TOTEM_IS_PROPERTIES_VIEW(obj)	    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PROPERTIES_VIEW))
+#define TOTEM_IS_PROPERTIES_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PROPERTIES_VIEW))
+
+typedef struct TotemPropertiesViewPriv TotemPropertiesViewPriv;
+
+typedef struct {
+	GtkGrid parent;
+	TotemPropertiesViewPriv *priv;
+} TotemPropertiesView;
+
+typedef struct {
+	GtkGridClass parent;
+} TotemPropertiesViewClass;
+
+GType      totem_properties_view_get_type      (void);
+void       totem_properties_view_register_type (GTypeModule *module);
+
+GtkWidget *totem_properties_view_new           (const char *location,
+						GtkWidget  *label);
+
+#endif /* TOTEM_PROPERTIES_VIEW_H */
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/6.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/6.html new file mode 100644 index 0000000..b5a1cdf --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/6.html @@ -0,0 +1,1015 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
/*
+ * Copyright (C) 2003  Andrew Sobala <aes@gnome.org>
+ * Copyright (C) 2004  Bastien Nocera <hadess@hadess.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define GST_USE_UNSTABLE_API 1
+#include <gst/tag/tag.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gst/pbutils/pbutils.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "totem-properties-view.h"
+#include "bacon-video-widget-properties.h"
+
+struct TotemPropertiesViewPriv {
+	GtkWidget *label;
+	GtkWidget *vbox;
+	BaconVideoWidgetProperties *props;
+	GstDiscoverer *disco;
+};
+
+static GObjectClass *parent_class = NULL;
+static void totem_properties_view_finalize (GObject *object);
+
+G_DEFINE_TYPE (TotemPropertiesView, totem_properties_view, GTK_TYPE_GRID)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
+
+void
+totem_properties_view_register_type (GTypeModule *module)
+{
+	totem_properties_view_get_type ();
+}
+
+static void
+totem_properties_view_class_init (TotemPropertiesViewClass *class)
+{
+	parent_class = g_type_class_peek_parent (class);
+	G_OBJECT_CLASS (class)->finalize = totem_properties_view_finalize;
+}
+
+static void
+update_general (TotemPropertiesView *props,
+		const GstTagList    *list)
+{
+	struct {
+		const char *tag_name;
+		const char *widget;
+	} items[] = {
+		{ GST_TAG_TITLE, "title" },
+		{ GST_TAG_ARTIST, "artist" },
+		{ GST_TAG_ALBUM, "album" },
+	};
+	guint i;
+        GDate *date;
+	GstDateTime *datetime;
+	gchar *comment;
+
+	for (i = 0; i < G_N_ELEMENTS(items); i++) {
+		char *string;
+
+		if (gst_tag_list_get_string_index (list, items[i].tag_name, 0, &string) != FALSE) {
+			bacon_video_widget_properties_set_label (props->priv->props,
+								 items[i].widget,
+								 string);
+			g_free (string);
+		}
+	}
+
+	/* Comment else use Description defined by:
+	 * http://xiph.org/vorbis/doc/v-comment.html */
+	if (gst_tag_list_get_string (list, GST_TAG_COMMENT, &comment) ||
+		gst_tag_list_get_string (list, GST_TAG_DESCRIPTION, &comment)) {
+
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "comment",
+							 comment);
+		g_free (comment);
+        }
+
+	/* Date */
+        if (gst_tag_list_get_date (list, GST_TAG_DATE, &date)) {
+		char *string;
+
+		string = g_strdup_printf ("%d", g_date_get_year (date));
+		g_date_free (date);
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "year",
+							 string);
+		g_free (string);
+        } else if (gst_tag_list_get_date_time (list, GST_TAG_DATE_TIME, &datetime)) {
+		char *string;
+
+		string = g_strdup_printf ("%d", gst_date_time_get_year (datetime));
+		gst_date_time_unref (datetime);
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "year",
+							 string);
+		g_free (string);
+	}
+}
+
+static void
+set_codec (TotemPropertiesView     *props,
+	   GstDiscovererStreamInfo *info,
+	   const char              *widget)
+{
+	GstCaps *caps;
+	const char *nick;
+
+	nick = gst_discoverer_stream_info_get_stream_type_nick (info);
+	if (g_str_equal (nick, "audio") == FALSE &&
+	    g_str_equal (nick, "video") == FALSE &&
+	    g_str_equal (nick, "container") == FALSE) {
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 widget,
+							 _("N/A"));
+		return;
+	}
+
+	caps = gst_discoverer_stream_info_get_caps (info);
+	if (caps) {
+		if (gst_caps_is_fixed (caps)) {
+			char *string;
+
+			string = gst_pb_utils_get_codec_description (caps);
+			bacon_video_widget_properties_set_label (props->priv->props,
+								 widget,
+								 string);
+			g_free (string);
+		}
+		gst_caps_unref (caps);
+	}
+}
+
+static void
+set_bitrate (TotemPropertiesView    *props,
+	     guint                   bitrate,
+	     const char             *widget)
+{
+	char *string;
+
+	if (!bitrate) {
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 widget,
+							 C_("Stream bit rate", "N/A"));
+		return;
+	}
+	string = g_strdup_printf (_("%d kbps"), bitrate / 1000);
+	bacon_video_widget_properties_set_label (props->priv->props,
+						 widget,
+						 string);
+	g_free (string);
+}
+
+static void
+update_video (TotemPropertiesView    *props,
+	      GstDiscovererVideoInfo *info)
+{
+	guint width, height;
+	guint fps_n, fps_d;
+	char *string;
+
+	width = gst_discoverer_video_info_get_width (info);
+	height = gst_discoverer_video_info_get_height (info);
+	string = g_strdup_printf (N_("%d × %d"), width, height);
+	bacon_video_widget_properties_set_label (props->priv->props,
+						 "dimensions",
+						 string);
+	g_free (string);
+
+	set_codec (props, (GstDiscovererStreamInfo *) info, "vcodec");
+	set_bitrate (props, gst_discoverer_video_info_get_bitrate (info), "video_bitrate");
+
+	/* Round up/down to the nearest integer framerate */
+	fps_n = gst_discoverer_video_info_get_framerate_num (info);
+	fps_d = gst_discoverer_video_info_get_framerate_denom (info);
+	if (fps_d > 0.0)
+		bacon_video_widget_properties_set_framerate (props->priv->props,
+							     (float) fps_n / (float) fps_d);
+	else
+		bacon_video_widget_properties_set_framerate (props->priv->props, 0.0);
+}
+
+static void
+update_audio (TotemPropertiesView    *props,
+	      GstDiscovererAudioInfo *info)
+{
+	guint samplerate, channels;
+
+	set_codec (props, (GstDiscovererStreamInfo *) info, "acodec");
+
+	set_bitrate (props, gst_discoverer_audio_info_get_bitrate (info), "audio_bitrate");
+
+	samplerate = gst_discoverer_audio_info_get_sample_rate (info);
+	if (samplerate) {
+		char *string;
+		string = g_strdup_printf (_("%d Hz"), samplerate);
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "samplerate",
+							 string);
+		g_free (string);
+	} else {
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "samplerate",
+							 C_("Sample rate", "N/A"));
+	}
+
+	channels = gst_discoverer_audio_info_get_channels (info);
+	if (channels) {
+		char *string;
+
+		if (channels > 2) {
+			string = g_strdup_printf ("%s %d.1", _("Surround"), channels - 1);
+		} else if (channels == 1) {
+			string = g_strdup (_("Mono"));
+		} else if (channels == 2) {
+			string = g_strdup (_("Stereo"));
+		} else {
+			string = g_strdup (""); //Should not happen
+		}
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "channels",
+							 string);
+		g_free (string);
+	} else {
+		bacon_video_widget_properties_set_label (props->priv->props,
+							 "channels",
+							 C_("Number of audio channels", "N/A"));
+	}
+}
+
+static void
+discovered_cb (GstDiscoverer       *discoverer,
+	       GstDiscovererInfo   *info,
+	       GError              *error,
+	       TotemPropertiesView *props)
+{
+	GList *video_streams, *audio_streams;
+	const GstTagList *taglist;
+	gboolean has_audio, has_video;
+	const char *label;
+        GstClockTime duration;
+        GstDiscovererStreamInfo *sinfo;
+
+	if (error) {
+		g_warning ("Couldn't get information about '%s': %s",
+			   gst_discoverer_info_get_uri (info),
+			   error->message);
+		return;
+	}
+
+	video_streams = gst_discoverer_info_get_video_streams (info);
+	has_video = (video_streams != NULL);
+	audio_streams = gst_discoverer_info_get_audio_streams (info);
+	has_audio = (audio_streams != NULL);
+
+	if (has_audio == has_video)
+		label = N_("Audio/Video");
+	else if (has_audio)
+		label = N_("Audio");
+	else
+		label = N_("Video");
+
+	gtk_label_set_text (GTK_LABEL (props->priv->label), _(label));
+
+	/* Widgets */
+	bacon_video_widget_properties_set_has_type (props->priv->props,
+						    has_video,
+						    has_audio);
+
+	/* General */
+        duration = gst_discoverer_info_get_duration (info);
+        bacon_video_widget_properties_set_duration (props->priv->props, duration / GST_SECOND * 1000);
+
+        sinfo = gst_discoverer_info_get_stream_info (info);
+        if (sinfo) {
+		set_codec (props, sinfo, "container");
+		gst_discoverer_stream_info_unref (sinfo);
+	}
+
+	taglist = gst_discoverer_info_get_tags (info);
+	update_general (props, taglist);
+
+	/* Video and Audio */
+	if (video_streams)
+		update_video (props, video_streams->data);
+	if (audio_streams)
+		update_audio (props, audio_streams->data);
+
+	gst_discoverer_stream_info_list_free (video_streams);
+	gst_discoverer_stream_info_list_free (audio_streams);
+}
+
+static void
+totem_properties_view_init (TotemPropertiesView *props)
+{
+	GError *err = NULL;
+
+	props->priv = g_new0 (TotemPropertiesViewPriv, 1);
+
+	props->priv->vbox = bacon_video_widget_properties_new ();
+	gtk_grid_attach (GTK_GRID (props), props->priv->vbox, 0, 0, 1, 1);
+	gtk_widget_show (GTK_WIDGET (props));
+
+	props->priv->props = BACON_VIDEO_WIDGET_PROPERTIES (props->priv->vbox);
+
+	props->priv->disco = gst_discoverer_new (GST_SECOND * 60, &err);
+	if (props->priv->disco == NULL) {
+		g_warning ("Could not create discoverer object: %s", err->message);
+		g_error_free (err);
+		return;
+	}
+	g_signal_connect (props->priv->disco, "discovered",
+			  G_CALLBACK (discovered_cb), props);
+}
+
+static void
+totem_properties_view_finalize (GObject *object)
+{
+	TotemPropertiesView *props;
+
+	props = TOTEM_PROPERTIES_VIEW (object);
+
+	if (props->priv != NULL) {
+		if (props->priv->disco) {
+			g_signal_handlers_disconnect_by_func (props->priv->disco,
+							      discovered_cb,
+							      props);
+			gst_discoverer_stop (props->priv->disco);
+			g_clear_object (&props->priv->disco);
+		}
+		g_clear_object (&props->priv->label);
+		g_free (props->priv);
+	}
+	props->priv = NULL;
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static void
+totem_properties_view_set_location (TotemPropertiesView *props,
+				    const char          *location)
+{
+	g_assert (TOTEM_IS_PROPERTIES_VIEW (props));
+
+	if (props->priv->disco)
+		gst_discoverer_stop (props->priv->disco);
+
+	bacon_video_widget_properties_reset (props->priv->props);
+
+	if (location != NULL && props->priv->disco != NULL) {
+		gst_discoverer_start (props->priv->disco);
+
+		if (gst_discoverer_discover_uri_async (props->priv->disco, location) == FALSE) {
+			g_warning ("Couldn't add %s to list", location);
+			return;
+		}
+	}
+}
+
+GtkWidget *
+totem_properties_view_new (const char *location, GtkWidget *label)
+{
+	TotemPropertiesView *self;
+
+	self = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL);
+	g_object_ref (label);
+	self->priv->label = label;
+	totem_properties_view_set_location (self, location);
+
+	return GTK_WIDGET (self);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/7.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/7.html new file mode 100644 index 0000000..3813d0e --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/7.html @@ -0,0 +1,833 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <stdlib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <unistd.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define GKSU_TYPE_CONTEXT_MENU (gksu_context_menu_get_type ())
+
+typedef struct {
+    GObject parent;
+} GksuContextMenu;
+
+typedef struct {
+    GObjectClass parent_class;
+} GksuContextMenuClass;
+
+static GType gksucm_type = 0;
+static GObjectClass *parent_class = NULL;
+
+static void
+gksu_context_menu_init (GksuContextMenu *self);
+static void
+gksu_context_menu_class_init (GksuContextMenuClass *class);
+static void
+menu_provider_iface_init (CajaMenuProviderIface *iface);
+
+static GList*
+gksu_context_menu_get_file_items (CajaMenuProvider *provider,
+				  GtkWidget *window,
+				  GList *files);
+static void
+gksu_context_menu_activate (CajaMenuItem *item,
+			    CajaFileInfo *file);
+
+static GType
+gksu_context_menu_get_type (void)
+{
+    return gksucm_type;
+}
+
+static void
+gksu_context_menu_register_type (GTypeModule *module)
+{
+    static const GTypeInfo info = {
+	sizeof (GksuContextMenuClass),
+	(GBaseInitFunc) NULL,
+	(GBaseFinalizeFunc) NULL,
+	(GClassInitFunc) gksu_context_menu_class_init,
+	NULL,
+	NULL,
+	sizeof (GksuContextMenu),
+	0,
+	(GInstanceInitFunc) gksu_context_menu_init,
+	NULL
+    };
+    static const GInterfaceInfo menu_provider_iface_info = {
+	(GInterfaceInitFunc)menu_provider_iface_init,
+	NULL,
+	NULL
+    };
+
+    gksucm_type = g_type_module_register_type (module,
+					    G_TYPE_OBJECT,
+					    "GksuContextMenu",
+					    &info, 0);
+    g_type_module_add_interface (module,
+				 gksucm_type,
+				 CAJA_TYPE_MENU_PROVIDER,
+				 &menu_provider_iface_info);
+}
+
+static void
+gksu_context_menu_class_init (GksuContextMenuClass *class)
+{
+    parent_class = g_type_class_peek_parent (class);
+}
+
+static void menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+    iface->get_file_items = gksu_context_menu_get_file_items;
+}
+
+static void
+gksu_context_menu_init (GksuContextMenu *self)
+{
+  g_message ("Initializing gksu extension...");
+}
+
+static GList *
+gksu_context_menu_get_file_items (CajaMenuProvider *provider,
+				  GtkWidget *window,
+				  GList *files)
+{
+    GList *items = NULL;
+    CajaFileInfo *file;
+    CajaMenuItem *item;
+
+    /* if we're already root, really or effectively, do not add
+       the menu item */
+    if (geteuid () == 0)
+      return NULL;
+
+    /* only add a menu item if a single file is selected ... */
+    if (files == NULL || files->next != NULL)
+      return NULL;
+
+    file = files->data;
+
+    /* ... and if it is not a caja special item */
+    {
+      gchar *uri_scheme = NULL;
+
+      uri_scheme = caja_file_info_get_uri_scheme (file);
+      if (!strncmp (uri_scheme, "x-caja-desktop", 18))
+	{
+	  g_free (uri_scheme);
+	  return NULL;
+	}
+      g_free (uri_scheme);
+    }
+
+    /* create the context menu item */
+    item = caja_menu_item_new ("Gksu::open_as_root",
+				   _("Open as administrator"),
+				   _("Opens the file with administrator privileges"),
+				   NULL);
+    g_signal_connect_object (item, "activate",
+			     G_CALLBACK (gksu_context_menu_activate),
+			     file, 0);
+    items = g_list_prepend (items, item);
+
+    return items;
+}
+
+static void
+gksu_context_menu_activate (CajaMenuItem *item,
+			    CajaFileInfo *file)
+{
+  gchar *exec_path;
+  gchar *uri = NULL;
+  gchar *mime_type = NULL;
+  gchar *cmd = NULL;
+  gchar *full_cmd = NULL;
+  gchar *tmp = NULL;
+  gboolean is_desktop = FALSE;
+
+  uri = caja_file_info_get_uri (file);
+  mime_type = caja_file_info_get_mime_type (file);
+
+  if (!strcmp (mime_type, "application/x-desktop"))
+    { /* we're handling a .desktop file */
+      GKeyFile *key_file = g_key_file_new ();
+      gint retval = 0;
+
+      is_desktop = TRUE;
+
+      gchar *file_path = g_filename_from_uri (uri, NULL, NULL);
+      retval = g_key_file_load_from_file (key_file, file_path, 0, NULL);
+      g_free (file_path);
+
+      if (retval)
+        cmd = g_key_file_get_string (key_file, "Desktop Entry", "Exec", NULL);
+      g_key_file_free (key_file);
+    }
+  else
+    {
+      GAppInfo *app_info = g_app_info_get_default_for_type (mime_type, strncmp (uri, "file://", 7));
+      if (app_info)
+	{
+	  cmd = g_strdup (g_app_info_get_executable (app_info));
+          g_object_unref (app_info);
+	}
+    }
+
+  if (cmd == NULL)
+    {
+      GtkWidget *dialog;
+
+      dialog = gtk_message_dialog_new_with_markup (NULL, 0,
+						   GTK_MESSAGE_ERROR,
+						   GTK_BUTTONS_CLOSE,
+						   _("<big><b>"
+						     "Unable to determine the program to run."
+						     "</b></big>\n\n"
+						     "The item you selected cannot be open with "
+						     "administrator powers because the correct "
+						     "application cannot be determined."));
+      gtk_dialog_run (GTK_DIALOG(dialog));
+      gtk_widget_destroy (dialog);
+      return;
+    }
+
+  /*
+   * FIXME: remove any FreeDesktop substitution variable for now; we
+   * need to process them!
+   */
+  tmp = strstr (cmd, "%");
+  if (tmp)
+    *tmp = '\0';
+
+  if (is_desktop)
+    full_cmd = cmd;
+  else
+    {
+      full_cmd = g_strdup_printf ("%s '%s'", cmd, uri);
+      g_free (cmd);
+    }
+
+  if ((exec_path = g_find_program_in_path ("gksu")) == NULL)
+    {
+       if ((exec_path = g_find_program_in_path ("beesu")) == NULL)
+         {
+           GtkWidget *dialog;
+
+           dialog = gtk_message_dialog_new_with_markup (NULL, 0,
+                                                        GTK_MESSAGE_ERROR,
+                                                        GTK_BUTTONS_CLOSE,
+                                                        _("<big><b>"
+                                                          "Unable to determine the graphical wrapper for su"
+                                                           "</b></big>\n\n"
+                                                           "The item you selected cannot be open with "
+                                                           "administrator powers because the graphical wrapper "
+                                                           "for su cannot be determined, such as gtksu or beesu."));
+           gtk_dialog_run (GTK_DIALOG (dialog));
+           gtk_widget_destroy (dialog);
+         }
+    }
+
+  if (exec_path != NULL)
+    {
+      GError *error = NULL;
+      gchar **argv = (gchar**) g_malloc (sizeof (gchar*) * 3);
+
+      argv[0] = exec_path;
+      argv[1] = full_cmd;
+      argv[2] = NULL;
+
+      if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error))
+        {
+           GtkWidget *dialog;
+
+           dialog = gtk_message_dialog_new (NULL, 0,
+                                            GTK_MESSAGE_ERROR,
+                                            GTK_BUTTONS_CLOSE,
+                                            _("Error: %s"),
+                                            error->message);
+           gtk_dialog_run (GTK_DIALOG (dialog));
+           gtk_widget_destroy (dialog);
+           g_error_free (error);
+        }
+      g_strfreev (argv);
+    }
+  else
+    {
+      g_free (full_cmd);
+    }
+
+  g_free (uri);
+  g_free (mime_type);
+}
+
+/* --- extension interface --- */
+void
+caja_module_initialize (GTypeModule *module)
+{
+    g_print ("Initializing caja-gksu extension\n");
+    gksu_context_menu_register_type (module);
+#ifdef ENABLE_NLS
+    bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+}
+
+void
+caja_module_shutdown (void)
+{
+    g_print ("Shutting down caja-gksu extension\n");
+}
+
+void
+caja_module_list_types (const GType **types,
+			    int *num_types)
+{
+    static GType type_list[1];
+
+    type_list[0] = GKSU_TYPE_CONTEXT_MENU;
+    *types = type_list;
+    *num_types = G_N_ELEMENTS (type_list);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/8.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/8.html new file mode 100644 index 0000000..ac87ceb --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/8.html @@ -0,0 +1,1189 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
#include <gio/gio.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
+# define SECTION __attribute__ ((section (".gresource.imageconverter"), aligned (8)))
+#else
+# define SECTION
+#endif
+
+static const SECTION union { const guint8 data[4329]; const double alignment; void * const ptr;}  imageconverter_resource_data = { {<--- union member 'Anonymous0::alignment' is never used.<--- union member 'Anonymous0::ptr' is never used.
+  0107, 0126, 0141, 0162, 0151, 0141, 0156, 0164, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 
+  0030, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 0000, 0000, 0000, 0050, 0011, 0000, 0000, 0000, 
+  0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0002, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 
+  0003, 0000, 0000, 0000, 0005, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 0007, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0113, 0120, 0220, 0013, 0005, 0000, 0000, 0000, 0034, 0001, 0000, 0000, 
+  0004, 0000, 0114, 0000, 0040, 0001, 0000, 0000, 0044, 0001, 0000, 0000, 0362, 0306, 0050, 0375, 
+  0004, 0000, 0000, 0000, 0044, 0001, 0000, 0000, 0024, 0000, 0166, 0000, 0070, 0001, 0000, 0000, 
+  0214, 0007, 0000, 0000, 0137, 0144, 0153, 0207, 0010, 0000, 0000, 0000, 0214, 0007, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0224, 0007, 0000, 0000, 0230, 0007, 0000, 0000, 0176, 0157, 0252, 0021, 
+  0002, 0000, 0000, 0000, 0230, 0007, 0000, 0000, 0013, 0000, 0114, 0000, 0244, 0007, 0000, 0000, 
+  0250, 0007, 0000, 0000, 0110, 0122, 0272, 0300, 0003, 0000, 0000, 0000, 0250, 0007, 0000, 0000, 
+  0017, 0000, 0114, 0000, 0270, 0007, 0000, 0000, 0304, 0007, 0000, 0000, 0324, 0265, 0002, 0000, 
+  0377, 0377, 0377, 0377, 0304, 0007, 0000, 0000, 0001, 0000, 0114, 0000, 0310, 0007, 0000, 0000, 
+  0314, 0007, 0000, 0000, 0157, 0174, 0237, 0161, 0004, 0000, 0000, 0000, 0314, 0007, 0000, 0000, 
+  0024, 0000, 0166, 0000, 0340, 0007, 0000, 0000, 0130, 0015, 0000, 0000, 0073, 0056, 0277, 0311, 
+  0004, 0000, 0000, 0000, 0130, 0015, 0000, 0000, 0017, 0000, 0166, 0000, 0150, 0015, 0000, 0000, 
+  0334, 0020, 0000, 0000, 0201, 0321, 0040, 0031, 0000, 0000, 0000, 0000, 0334, 0020, 0000, 0000, 
+  0005, 0000, 0114, 0000, 0344, 0020, 0000, 0000, 0350, 0020, 0000, 0000, 0157, 0162, 0147, 0057, 
+  0010, 0000, 0000, 0000, 0143, 0141, 0152, 0141, 0055, 0151, 0155, 0141, 0147, 0145, 0055, 0162, 
+  0145, 0163, 0151, 0172, 0145, 0056, 0165, 0151, 0352, 0140, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0135, 0337, 0163, 0343, 0046, 0020, 0176, 0277, 0277, 0102, 0345, 0265, 0343, 
+  0330, 0126, 0022, 0327, 0271, 0261, 0165, 0223, 0246, 0315, 0265, 0063, 0175, 0272, 0244, 0323, 
+  0107, 0015, 0226, 0210, 0315, 0005, 0203, 0012, 0050, 0266, 0373, 0327, 0027, 0041, 0047, 0261, 
+  0143, 0311, 0002, 0113, 0311, 0371, 0007, 0231, 0311, 0214, 0043, 0263, 0013, 0373, 0301, 0176, 
+  0354, 0202, 0040, 0203, 0057, 0363, 0051, 0361, 0236, 0020, 0027, 0230, 0321, 0041, 0350, 0236, 
+  0165, 0200, 0207, 0150, 0304, 0142, 0114, 0307, 0103, 0360, 0367, 0375, 0155, 0253, 0017, 0276, 
+  0004, 0237, 0006, 0077, 0265, 0132, 0336, 0127, 0104, 0021, 0207, 0022, 0305, 0336, 0014, 0313, 
+  0211, 0067, 0046, 0060, 0106, 0336, 0371, 0231, 0357, 0237, 0371, 0136, 0253, 0245, 0012, 0141, 
+  0052, 0021, 0177, 0200, 0021, 0012, 0076, 0171, 0336, 0200, 0243, 0177, 0123, 0314, 0221, 0360, 
+  0010, 0036, 0015, 0301, 0130, 0076, 0376, 0014, 0136, 0053, 0312, 0304, 0100, 0133, 0227, 0143, 
+  0243, 0357, 0050, 0222, 0136, 0104, 0240, 0020, 0103, 0360, 0125, 0076, 0136, 0307, 0337, 0123, 
+  0041, 0247, 0210, 0112, 0340, 0341, 0170, 0010, 0340, 0313, 0337, 0135, 0220, 0111, 0050, 0231, 
+  0204, 0263, 0004, 0161, 0271, 0360, 0050, 0234, 0242, 0041, 0040, 0154, 0206, 0070, 0010, 0272, 
+  0203, 0366, 0363, 0027, 0305, 0345, 0322, 0044, 0321, 0345, 0072, 0235, 0252, 0222, 0117, 0220, 
+  0244, 0010, 0004, 0227, 0225, 0005, 0205, 0104, 0111, 0210, 0151, 0304, 0221, 0156, 0160, 0165, 
+  0033, 0022, 0070, 0106, 0153, 0002, 0157, 0252, 0030, 0264, 0163, 0100, 0154, 0261, 0361, 0233, 
+  0301, 0346, 0112, 0375, 0030, 0202, 0243, 0140, 0074, 0034, 0170, 0316, 0035, 0074, 0362, 0361, 
+  0317, 0251, 0022, 0317, 0221, 0301, 0331, 0307, 0062, 0177, 0172, 0302, 0002, 0217, 0210, 0262, 
+  0341, 0236, 0247, 0250, 0252, 0111, 0021, 0244, 0341, 0003, 0213, 0122, 0001, 0202, 0133, 0110, 
+  0104, 0145, 0171, 0034, 0061, 0032, 0146, 0037, 0101, 0240, 0110, 0241, 0245, 0304, 0043, 0104, 
+  0154, 0254, 0370, 0015, 0103, 0302, 0306, 0271, 0031, 0212, 0137, 0360, 0177, 0050, 0214, 0363, 
+  0107, 0315, 0064, 0120, 0142, 0251, 0154, 0367, 0044, 0207, 0124, 0020, 0050, 0241, 0102, 0142, 
+  0010, 0026, 0110, 0211, 0177, 0323, 0265, 0171, 0032, 0106, 0121, 0251, 0146, 0221, 0240, 0160, 
+  0202, 0263, 0136, 0312, 0233, 0267, 0041, 0020, 0115, 0060, 0211, 0363, 0317, 0231, 0070, 0121, 
+  0314, 0071, 0141, 0044, 0106, 0274, 0275, 0054, 0320, 0136, 0051, 0221, 0227, 0366, 0064, 0307, 
+  0122, 0110, 0132, 0372, 0117, 0325, 0125, 0043, 0066, 0007, 0057, 0072, 0066, 0260, 0372, 0165, 
+  0345, 0133, 0173, 0144, 0212, 0144, 0246, 0220, 0217, 0061, 0015, 0011, 0172, 0310, 0206, 0237, 
+  0157, 0041, 0302, 0361, 0170, 0142, 0053, 0043, 0131, 0142, 0051, 0061, 0142, 0122, 0262, 0251, 
+  0251, 0020, 0343, 0130, 0371, 0021, 0224, 0152, 0122, 0002, 0201, 0232, 0235, 0044, 0216, 0040, 
+  0061, 0021, 0024, 0011, 0214, 0324, 0034, 0131, 0132, 0117, 0161, 0157, 0301, 0050, 0253, 0051, 
+  0204, 0034, 0301, 0225, 0156, 0051, 0354, 0270, 0124, 0231, 0101, 0327, 0273, 0157, 0327, 0056, 
+  0054, 0344, 0075, 0270, 0140, 0251, 0014, 0205, 0134, 0144, 0176, 0216, 0150, 0134, 0052, 0270, 
+  0066, 0112, 0253, 0032, 0234, 0173, 0345, 0110, 0177, 0356, 0202, 0267, 0122, 0105, 0315, 0030, 
+  0041, 0122, 0350, 0153, 0341, 0115, 0001, 0061, 0154, 0127, 0266, 0225, 0266, 0014, 0101, 0264, 
+  0025, 0345, 0050, 0102, 0370, 0011, 0211, 0060, 0106, 0017, 0060, 0045, 0322, 0136, 0203, 0146, 
+  0142, 0020, 0344, 0204, 0154, 0043, 0230, 0012, 0024, 0246, 0124, 0321, 0005, 0301, 0164, 0007, 
+  0243, 0041, 0231, 0301, 0205, 0010, 0305, 0204, 0315, 0302, 0145, 0033, 0266, 0253, 0130, 0145, 
+  0345, 0165, 0305, 0060, 0172, 0124, 0276, 0120, 0135, 0045, 0232, 0047, 0220, 0306, 0366, 0115, 
+  0175, 0300, 0204, 0330, 0113, 0045, 0114, 0340, 0334, 0261, 0073, 0333, 0214, 0052, 0154, 0375, 
+  0032, 0365, 0326, 0167, 0005, 0277, 0236, 0053, 0344, 0363, 0316, 0361, 0273, 0202, 0325, 0210, 
+  0076, 0334, 0341, 0330, 0155, 0142, 0070, 0026, 0231, 0137, 0154, 0172, 0231, 0331, 0126, 0363, 
+  0105, 0156, 0263, 0225, 0110, 0245, 0377, 0025, 0030, 0273, 0141, 0350, 0246, 0317, 0125, 0005, 
+  0071, 0073, 0273, 0103, 0123, 0123, 0253, 0161, 0114, 0261, 0103, 0134, 0141, 0103, 0103, 0267, 
+  0134, 0007, 0331, 0037, 0302, 0025, 0133, 0001, 0052, 0145, 0273, 0160, 0016, 0011, 0036, 0157, 
+  0047, 0350, 0002, 0210, 0046, 0060, 0126, 0163, 0126, 0026, 0137, 0203, 0200, 0062, 0272, 0275, 
+  0336, 0102, 0260, 0212, 0001, 0273, 0316, 0032, 0223, 0347, 0125, 0005, 0345, 0153, 0000, 0127, 
+  0027, 0274, 0102, 0000, 0125, 0000, 0036, 0046, 0060, 0216, 0053, 0106, 0113, 0065, 0020, 0246, 
+  0116, 0325, 0030, 0024, 0115, 0300, 0121, 0225, 0063, 0364, 0167, 0121, 0140, 0345, 0271, 0106, 
+  0136, 0154, 0326, 0214, 0255, 0135, 0263, 0113, 0367, 0064, 0322, 0105, 0115, 0165, 0123, 0175, 
+  0200, 0314, 0100, 0052, 0006, 0352, 0033, 0214, 0061, 0133, 0215, 0310, 0226, 0321, 0111, 0250, 
+  0027, 0016, 0170, 0366, 0155, 0036, 0243, 0201, 0052, 0335, 0066, 0041, 0333, 0035, 0042, 0131, 
+  0063, 0240, 0227, 0325, 0362, 0331, 0324, 0306, 0306, 0272, 0255, 0146, 0144, 0147, 0037, 0351, 
+  0131, 0015, 0206, 0042, 0225, 0223, 0345, 0114, 0040, 0044, 0344, 0262, 0216, 0242, 0054, 0305, 
+  0176, 0152, 0000, 0256, 0230, 0103, 0225, 0027, 0321, 0130, 0121, 0200, 0144, 0334, 0126, 0137, 
+  0131, 0160, 0272, 0131, 0153, 0131, 0260, 0152, 0032, 0274, 0326, 0106, 0336, 0054, 0232, 0155, 
+  0044, 0331, 0332, 0104, 0311, 0310, 0374, 0302, 0144, 0254, 0051, 0176, 0270, 0141, 0323, 0021, 
+  0123, 0154, 0172, 0217, 0346, 0313, 0105, 0343, 0050, 0173, 0062, 0142, 0163, 0251, 0236, 0150, 
+  0226, 0000, 0373, 0341, 0265, 0015, 0370, 0230, 0010, 0325, 0374, 0306, 0027, 0365, 0233, 0245, 
+  0325, 0204, 0032, 0241, 0210, 0221, 0164, 0152, 0327, 0357, 0112, 0037, 0226, 0150, 0052, 0252, 
+  0313, 0055, 0113, 0006, 0127, 0275, 0371, 0125, 0157, 0320, 0326, 0237, 0215, 0205, 0272, 0176, 
+  0177, 0256, 0176, 0155, 0305, 0172, 0027, 0235, 0371, 0105, 0277, 0143, 0053, 0326, 0357, 0164, 
+  0346, 0275, 0216, 0265, 0130, 0267, 0343, 0137, 0314, 0177, 0351, 0365, 0167, 0060, 0256, 0243, 
+  0060, 0261, 0257, 0257, 0247, 0344, 0272, 0235, 0113, 0173, 0301, 0053, 0137, 0011, 0372, 0346, 
+  0026, 0346, 0345, 0014, 0072, 0271, 0144, 0261, 0164, 0071, 0124, 0115, 0032, 0270, 0341, 0325, 
+  0277, 0153, 0331, 0065, 0167, 0326, 0352, 0132, 0346, 0112, 0033, 0235, 0101, 0315, 0147, 0004, 
+  0103, 0272, 0373, 0310, 0051, 0246, 0056, 0131, 0064, 0075, 0303, 0164, 0017, 0153, 0206, 0371, 
+  0113, 0107, 0211, 0107, 0062, 0207, 0224, 0207, 0274, 0011, 0236, 0043, 0042, 0134, 0210, 0144, 
+  0060, 0200, 0375, 0037, 0061, 0200, 0115, 0360, 0066, 0303, 0272, 0021, 0234, 0353, 0143, 0134, 
+  0073, 0004, 0065, 0300, 0266, 0022, 0127, 0227, 0273, 0177, 0144, 0356, 0256, 0032, 0057, 0331, 
+  0064, 0114, 0042, 0371, 0176, 0231, 0173, 0004, 0211, 0313, 0330, 0117, 0057, 0143, 0337, 0324, 
+  0067, 0346, 0054, 0115, 0100, 0120, 0266, 0136, 0344, 0146, 0272, 0343, 0133, 0014, 0270, 0113, 
+  0060, 0135, 0345, 0233, 0214, 0150, 0204, 0172, 0266, 0063, 0317, 0354, 0043, 0027, 0274, 0276, 
+  0024, 0007, 0202, 0225, 0167, 0053, 0367, 0161, 0074, 0273, 0314, 0303, 0145, 0036, 0006, 0231, 
+  0007, 0342, 0221, 0032, 0301, 0216, 0220, 0135, 0352, 0361, 0303, 0123, 0217, 0256, 0113, 0075, 
+  0216, 0072, 0365, 0170, 0327, 0135, 0303, 0033, 0135, 0207, 0333, 0063, 0164, 0031, 0210, 0313, 
+  0100, 0116, 0064, 0003, 0071, 0221, 0220, 0355, 0037, 0034, 0313, 0311, 0147, 0067, 0200, 0217, 
+  0057, 0347, 0170, 0233, 0102, 0317, 0262, 0236, 0076, 0225, 0044, 0332, 0167, 0111, 0364, 0236, 
+  0246, 0040, 0216, 0221, 0053, 0030, 0371, 0017, 0224, 0035, 0317, 0162, 0224, 0154, 0062, 0202, 
+  0317, 0017, 0233, 0222, 0047, 0272, 0253, 0117, 0205, 0223, 0317, 0035, 0047, 0127, 0217, 0350, 
+  0013, 0307, 0311, 0356, 0225, 0212, 0103, 0246, 0344, 0113, 0267, 0256, 0371, 0256, 0353, 0232, 
+  0376, 0107, 0255, 0153, 0156, 0307, 0164, 0213, 0160, 0271, 0140, 0251, 0320, 0362, 0305, 0303, 
+  0354, 0044, 0321, 0263, 0033, 0232, 0235, 0024, 0332, 0306, 0077, 0373, 0165, 0112, 0250, 0224, 
+  0133, 0364, 0045, 0006, 0336, 0135, 0305, 0271, 0122, 0255, 0023, 0112, 0311, 0261, 0212, 0024, 
+  0120, 0351, 0273, 0234, 0257, 0105, 0226, 0365, 0316, 0164, 0210, 0001, 0074, 0175, 0027, 0306, 
+  0020, 0214, 0030, 0211, 0101, 0273, 0254, 0113, 0267, 0353, 0267, 0356, 0327, 0346, 0016, 0206, 
+  0132, 0237, 0152, 0073, 0260, 0203, 0312, 0356, 0204, 0240, 0347, 0116, 0010, 0032, 0006, 0143, 
+  0356, 0204, 0240, 0073, 0041, 0170, 0042, 0133, 0175, 0060, 0111, 0020, 0215, 0337, 0155, 0227, 
+  0357, 0132, 0253, 0167, 0373, 0173, 0247, 0266, 0277, 0347, 0066, 0341, 0016, 0145, 0171, 0141, 
+  0345, 0364, 0120, 0146, 0111, 0150, 0172, 0150, 0350, 0020, 0374, 0124, 0352, 0163, 0216, 0005, 
+  0264, 0164, 0226, 0337, 0245, 0026, 0273, 0345, 0262, 0243, 0333, 0223, 0073, 0221, 0345, 0062, 
+  0311, 0074, 0325, 0321, 0310, 0323, 0027, 0370, 0071, 0136, 0336, 0327, 0255, 0070, 0167, 0020, 
+  0251, 0371, 0125, 0263, 0335, 0122, 0204, 0215, 0310, 0027, 0123, 0175, 0013, 0245, 0105, 0350, 
+  0153, 0356, 0235, 0313, 0313, 0063, 0061, 0365, 0164, 0035, 0273, 0202, 0333, 0164, 0222, 0122, 
+  0107, 0115, 0315, 0230, 0267, 0221, 0170, 0267, 0211, 0130, 0267, 0311, 0070, 0267, 0344, 0035, 
+  0266, 0315, 0234, 0312, 0324, 0065, 0334, 0253, 0303, 0156, 0211, 0375, 0060, 0227, 0330, 0157, 
+  0125, 0060, 0222, 0225, 0161, 0013, 0354, 0173, 0263, 0300, 0176, 0270, 0127, 0057, 0332, 0334, 
+  0134, 0130, 0151, 0157, 0365, 0315, 0213, 0353, 0066, 0256, 0337, 0104, 0235, 0337, 0142, 0334, 
+  0232, 0341, 0170, 0214, 0344, 0313, 0220, 0132, 0177, 0354, 0251, 0154, 0062, 0141, 0124, 0250, 
+  0326, 0264, 0172, 0040, 0130, 0336, 0010, 0254, 0206, 0342, 0152, 0241, 0152, 0321, 0313, 0147, 
+  0121, 0277, 0120, 0364, 0315, 0103, 0261, 0176, 0171, 0370, 0240, 0275, 0362, 0037, 0011, 0376, 
+  0007, 0217, 0252, 0332, 0352, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0143, 0141, 0152, 0141, 
+  0057, 0000, 0000, 0000, 0003, 0000, 0000, 0000, 0145, 0170, 0164, 0145, 0156, 0163, 0151, 0157, 
+  0156, 0163, 0057, 0000, 0004, 0000, 0000, 0000, 0151, 0155, 0141, 0147, 0145, 0143, 0157, 0156, 
+  0166, 0145, 0162, 0164, 0145, 0162, 0057, 0000, 0001, 0000, 0000, 0000, 0006, 0000, 0000, 0000, 
+  0007, 0000, 0000, 0000, 0057, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0143, 0141, 0152, 0141, 
+  0055, 0151, 0155, 0141, 0147, 0145, 0055, 0162, 0157, 0164, 0141, 0164, 0145, 0056, 0165, 0151, 
+  0045, 0105, 0000, 0000, 0001, 0000, 0000, 0000, 0170, 0332, 0355, 0134, 0315, 0162, 0333, 0066, 
+  0020, 0276, 0347, 0051, 0120, 0134, 0073, 0262, 0176, 0062, 0315, 0070, 0035, 0211, 0031, 0327, 
+  0255, 0063, 0235, 0351, 0051, 0161, 0316, 0034, 0210, 0134, 0123, 0210, 0041, 0200, 0005, 0100, 
+  0313, 0172, 0253, 0076, 0103, 0237, 0254, 0040, 0050, 0333, 0222, 0005, 0212, 0204, 0310, 0270, 
+  0212, 0203, 0233, 0104, 0355, 0056, 0260, 0213, 0305, 0307, 0017, 0013, 0100, 0323, 0017, 0367, 
+  0113, 0206, 0356, 0100, 0052, 0052, 0370, 0014, 0217, 0317, 0106, 0030, 0001, 0117, 0104, 0112, 
+  0171, 0066, 0303, 0137, 0256, 0257, 0006, 0347, 0370, 0103, 0364, 0146, 0372, 0323, 0140, 0200, 
+  0076, 0002, 0007, 0111, 0064, 0244, 0150, 0105, 0365, 0002, 0145, 0214, 0244, 0200, 0336, 0236, 
+  0115, 0046, 0147, 0143, 0064, 0030, 0030, 0041, 0312, 0065, 0310, 0033, 0222, 0100, 0364, 0006, 
+  0241, 0251, 0204, 0277, 0013, 0052, 0101, 0041, 0106, 0347, 0063, 0234, 0351, 0333, 0237, 0361, 
+  0123, 0103, 0245, 0032, 0036, 0132, 0071, 0061, 0377, 0012, 0211, 0106, 0011, 0043, 0112, 0315, 
+  0360, 0107, 0175, 0173, 0221, 0176, 0055, 0224, 0136, 0002, 0327, 0030, 0321, 0164, 0206, 0311, 
+  0343, 0367, 0061, 0056, 0065, 0214, 0116, 0056, 0105, 0016, 0122, 0257, 0021, 0047, 0113, 0230, 
+  0141, 0046, 0126, 0040, 0161, 0064, 0236, 0016, 0037, 0176, 0160, 0313, 0025, 0171, 0136, 0312, 
+  0275, 0175, 0067, 0152, 0222, 0274, 0043, 0254, 0000, 0034, 0275, 0157, 0024, 0124, 0032, 0362, 
+  0230, 0362, 0104, 0202, 0355, 0160, 0163, 0037, 0162, 0222, 0301, 0216, 0302, 0263, 0046, 0246, 
+  0303, 0052, 0040, 0356, 0330, 0374, 0271, 0064, 0352, 0125, 0130, 0150, 0371, 0261, 0056, 0042, 
+  0167, 0124, 0321, 0071, 0063, 0036, 0134, 0313, 0002, 0232, 0272, 0224, 0020, 0036, 0337, 0210, 
+  0244, 0120, 0070, 0272, 0042, 0114, 0065, 0312, 0323, 0104, 0360, 0270, 0374, 0210, 0043, 0363, 
+  0113, 0002, 0112, 0015, 0224, 0026, 0271, 0217, 0037, 0277, 0123, 0302, 0104, 0126, 0071, 0042, 
+  0205, 0066, 0131, 0025, 0247, 0325, 0243, 0176, 0272, 0250, 0251, 0066, 0336, 0043, 0055, 0011, 
+  0127, 0214, 0150, 0142, 0142, 0061, 0303, 0153, 0060, 0352, 0237, 0154, 0153, 0310, 0006, 0122, 
+  0065, 0232, 0131, 0347, 0020, 0057, 0150, 0071, 0116, 0125, 0367, 0366, 0024, 0222, 0005, 0145, 
+  0151, 0365, 0271, 0124, 0147, 0046, 0373, 0027, 0202, 0245, 0040, 0207, 0033, 0201, 0341, 0226, 
+  0104, 0045, 0215, 0354, 0074, 0341, 0204, 0015, 0354, 0127, 0063, 0130, 0163, 0161, 0217, 0037, 
+  0155, 0354, 0305, 0352, 0267, 0255, 0137, 0375, 0043, 0343, 0322, 0131, 0022, 0231, 0121, 0036, 
+  0063, 0270, 0051, 0023, 0160, 0342, 0241, 0042, 0151, 0266, 0360, 0325, 0061, 0251, 0341, 0251, 
+  0061, 0027, 0132, 0213, 0145, 0133, 0045, 0041, 0251, 0231, 0111, 0104, 0033, 0140, 0301, 0221, 
+  0101, 0030, 0115, 0023, 0302, 0332, 0050, 0252, 0234, 0044, 0006, 0347, 0160, 0164, 0356, 0224, 
+  0166, 0017, 0026, 0111, 0312, 0206, 0142, 0042, 0201, 0154, 0215, 0212, 0163, 0334, 0012, 0343, 
+  0005, 0337, 0035, 0275, 0143, 0107, 0320, 0211, 0172, 0144, 0055, 0012, 0035, 0053, 0275, 0056, 
+  0047, 0072, 0360, 0264, 0126, 0161, 0047, 0111, 0233, 0072, 0134, 0115, 0312, 0271, 0375, 0074, 
+  0306, 0317, 0265, 0134, 0335, 0230, 0003, 0163, 0116, 0265, 0370, 0222, 0360, 0004, 0130, 0135, 
+  0267, 0274, 0161, 0253, 0145, 0020, 0175, 0125, 0045, 0044, 0100, 0357, 0100, 0305, 0051, 0334, 
+  0220, 0202, 0151, 0177, 0013, 0026, 0212, 0161, 0124, 0041, 0262, 0217, 0142, 0241, 0040, 0056, 
+  0270, 0101, 0013, 0106, 0171, 0243, 0323, 0333, 0210, 0272, 0153, 0224, 0044, 0267, 0046, 0217, 
+  0233, 0233, 0203, 0373, 0234, 0360, 0324, 0337, 0277, 0033, 0312, 0230, 0277, 0126, 0056, 0024, 
+  0255, 0046, 0345, 0370, 0220, 0123, 0316, 0336, 0357, 0300, 0146, 0367, 0074, 0236, 0164, 0313, 
+  0343, 0352, 0235, 0361, 0372, 0363, 0370, 0007, 0111, 0307, 0111, 0037, 0351, 0350, 0162, 0337, 
+  0355, 0172, 0235, 0333, 0136, 0140, 0137, 0371, 0354, 0245, 0362, 0344, 0360, 0310, 0255, 0342, 
+  0160, 0166, 0317, 0321, 0375, 0071, 0327, 0104, 0120, 0216, 0236, 0016, 0175, 0275, 0027, 0133, 
+  0363, 0201, 0203, 0234, 0140, 0074, 0351, 0372, 0072, 0275, 0222, 0226, 0042, 0277, 0010, 0126, 
+  0034, 0014, 0120, 0055, 0332, 0305, 0367, 0204, 0321, 0254, 0076, 0101, 0152, 0102, 0264, 0040, 
+  0251, 0130, 0305, 0045, 0067, 0306, 0021, 0027, 0374, 0160, 0273, 0316, 0140, 0271, 0003, 0166, 
+  0121, 0166, 0246, 0132, 0025, 0071, 0344, 0073, 0004, 0256, 0153, 0360, 0234, 0001, 0064, 0344, 
+  0071, 0316, 0111, 0232, 0066, 0144, 0113, 0163, 0040, 0332, 0116, 0252, 0336, 0102, 0321, 0107, 
+  0070, 0232, 0370, 0376, 0371, 0061, 0006, 0274, 0146, 0156, 0253, 0131, 0334, 0256, 0033, 0007, 
+  0207, 0346, 0230, 0341, 0351, 0145, 0210, 0372, 0032, 0246, 0356, 0001, 0152, 0027, 0044, 0167, 
+  0240, 0076, 0221, 0224, 0212, 0155, 0106, 0266, 0141, 0047, 0061, 0341, 0031, 0203, 0130, 0226, 
+  0077, 0127, 0044, 0015, 0067, 0031, 0367, 0341, 0154, 0237, 0201, 0225, 0375, 0040, 0034, 0331, 
+  0166, 0176, 0155, 0353, 0146, 0157, 0043, 0327, 0221, 0334, 0371, 0223, 0075, 0257, 0174, 0160, 
+  0231, 0134, 0154, 0136, 0006, 0112, 0023, 0251, 0273, 0030, 0052, 0227, 0310, 0167, 0075, 0204, 
+  0053, 0225, 0144, 0025, 0123, 0236, 0032, 0024, 0320, 0102, 0372, 0332, 0253, 0343, 0247, 0373, 
+  0255, 0326, 0361, 0325, 0266, 0374, 0265, 0163, 0344, 0333, 0021, 0332, 0366, 0004, 0167, 0344, 
+  0023, 0245, 0126, 0356, 0073, 0327, 0143, 0175, 0101, 0304, 0245, 0130, 0316, 0205, 0001, 0324, 
+  0153, 0270, 0177, 0050, 0371, 0132, 0154, 0110, 0312, 0347, 0363, 0106, 0240, 0175, 0251, 0051, 
+  0333, 0171, 0230, 0037, 0346, 0305, 0310, 0313, 0010, 0325, 0260, 0124, 0315, 0162, 0033, 0111, 
+  0027, 0026, 0276, 0037, 0375, 0373, 0217, 0011, 0267, 0110, 0156, 0127, 0264, 0364, 0240, 0224, 
+  0353, 0301, 0240, 0050, 0312, 0322, 0330, 0240, 0117, 0303, 0343, 0163, 0143, 0271, 0255, 0235, 
+  0112, 0116, 0235, 0016, 0016, 0164, 0315, 0265, 0276, 0141, 0140, 0374, 0177, 0300, 0100, 0233, 
+  0160, 0267, 0013, 0165, 0057, 0160, 0333, 0075, 0306, 0235, 0141, 0266, 0105, 0154, 0033, 0343, 
+  0032, 0050, 0352, 0113, 0122, 0124, 0323, 0171, 0055, 0226, 0337, 0230, 0241, 0136, 0332, 0106, 
+  0002, 0075, 0375, 0101, 0351, 0351, 0276, 0275, 0114, 0212, 0302, 0254, 0234, 0153, 0327, 0107, 
+  0201, 0372, 0276, 0076, 0352, 0373, 0071, 0247, 0174, 0033, 0171, 0252, 0101, 0127, 0346, 0351, 
+  0321, 0210, 0163, 0212, 0160, 0360, 0164, 0204, 0003, 0107, 0133, 0307, 0071, 0116, 0061, 0243, 
+  0003, 0211, 0353, 0224, 0320, 0177, 0331, 0367, 0335, 0053, 0131, 0260, 0365, 0366, 0312, 0251, 
+  0147, 0001, 0051, 0144, 0022, 0100, 0155, 0057, 0317, 0002, 0312, 0167, 0331, 0301, 0013, 0053, 
+  0233, 0036, 0126, 0066, 0343, 0227, 0132, 0331, 0034, 0216, 0351, 0001, 0345, 0172, 0305, 0132, 
+  0245, 0315, 0201, 0236, 0162, 0337, 0352, 0141, 0106, 0266, 0333, 0227, 0072, 0204, 0151, 0247, 
+  0265, 0047, 0125, 0013, 0063, 0366, 0270, 0033, 0262, 0347, 0030, 0150, 0063, 0223, 0234, 0022, 
+  0255, 0045, 0065, 0014, 0004, 0152, 0253, 0053, 0117, 0042, 0233, 0266, 0127, 0140, 0217, 0206, 
+  0041, 0173, 0162, 0162, 0206, 0347, 0202, 0245, 0170, 0130, 0067, 0254, 0207, 0355, 0173, 0217, 
+  0155, 0177, 0107, 0021, 0274, 0367, 0121, 0273, 0236, 0105, 0030, 0275, 0354, 0321, 0230, 0260, 
+  0047, 0035, 0366, 0244, 0303, 0236, 0164, 0330, 0223, 0016, 0005, 0277, 0235, 0202, 0037, 0311, 
+  0163, 0340, 0351, 0067, 0053, 0365, 0135, 0130, 0363, 0241, 0306, 0027, 0266, 0240, 0103, 0035, 
+  0356, 0064, 0313, 0026, 0177, 0160, 0055, 0327, 0025, 0026, 0224, 0236, 0304, 0140, 0277, 0277, 
+  0216, 0171, 0252, 0355, 0266, 0272, 0003, 0226, 0316, 0252, 0233, 0067, 0151, 0050, 0303, 0205, 
+  0062, 0334, 0017, 0136, 0206, 0323, 0002, 0231, 0214, 0001, 0144, 0357, 0215, 0005, 0200, 0017, 
+  0045, 0270, 0160, 0270, 0300, 0223, 0102, 0123, 0156, 0057, 0077, 0172, 0160, 0350, 0366, 0263, 
+  0163, 0163, 0147, 0223, 0162, 0144, 0333, 0070, 0066, 0270, 0175, 0257, 0166, 0272, 0230, 0351, 
+  0110, 0236, 0173, 0201, 0310, 0076, 0110, 0163, 0237, 0204, 0271, 0146, 0103, 0174, 0177, 0161, 
+  0326, 0166, 0152, 0204, 0172, 0175, 0250, 0327, 0177, 0237, 0365, 0372, 0053, 0103, 0106, 0112, 
+  0231, 0120, 0251, 0077, 0231, 0112, 0375, 0370, 0273, 0275, 0065, 0350, 0163, 0351, 0256, 0321, 
+  0337, 0346, 0113, 0203, 0273, 0076, 0356, 0376, 0001, 0102, 0165, 0173, 0176, 0260, 0242, 0151, 
+  0006, 0372, 0061, 0245, 0166, 0037, 0043, 0011, 0052, 0027, 0134, 0231, 0336, 0014, 0336, 0341, 
+  0150, 0163, 0023, 0335, 0244, 0342, 0266, 0120, 0263, 0352, 0057, 0017, 0252, 0023, 0247, 0352, 
+  0263, 0207, 0152, 0367, 0077, 0053, 0246, 0303, 0255, 0077, 0063, 0371, 0017, 0146, 0110, 0026, 
+  0045, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0145, 0162, 0162, 0157, 0162, 0055, 0144, 0151, 
+  0141, 0154, 0157, 0147, 0056, 0165, 0151, 0000, 0022, 0031, 0000, 0000, 0001, 0000, 0000, 0000, 
+  0170, 0332, 0355, 0131, 0115, 0163, 0233, 0060, 0020, 0275, 0367, 0127, 0250, 0272, 0166, 0360, 
+  0127, 0072, 0231, 0034, 0154, 0062, 0375, 0112, 0246, 0063, 0075, 0265, 0351, 0231, 0021, 0142, 
+  0015, 0252, 0145, 0211, 0112, 0042, 0066, 0375, 0365, 0025, 0140, 0327, 0046, 0226, 0215, 0301, 
+  0356, 0244, 0165, 0173, 0303, 0260, 0117, 0332, 0267, 0373, 0166, 0131, 0344, 0361, 0355, 0162, 
+  0316, 0321, 0043, 0050, 0315, 0244, 0230, 0340, 0141, 0157, 0200, 0021, 0010, 0052, 0043, 0046, 
+  0342, 0011, 0376, 0372, 0160, 0347, 0335, 0340, 0133, 0377, 0305, 0370, 0245, 0347, 0241, 0173, 
+  0020, 0240, 0210, 0201, 0010, 0055, 0230, 0111, 0120, 0314, 0111, 0004, 0350, 0252, 0067, 0032, 
+  0365, 0106, 0310, 0363, 0254, 0021, 0023, 0006, 0324, 0224, 0120, 0360, 0137, 0040, 0064, 0126, 
+  0360, 0075, 0143, 0012, 0064, 0342, 0054, 0234, 0340, 0330, 0314, 0136, 0341, 0315, 0106, 0005, 
+  0014, 0367, 0113, 0073, 0031, 0176, 0003, 0152, 0020, 0345, 0104, 0353, 0011, 0276, 0067, 0263, 
+  0217, 0163, 0022, 0003, 0106, 0054, 0232, 0140, 0126, 0134, 0016, 0161, 0141, 0147, 0055, 0123, 
+  0045, 0123, 0120, 0046, 0107, 0202, 0314, 0141, 0202, 0037, 0231, 0146, 0041, 0007, 0354, 0077, 
+  0250, 0014, 0306, 0375, 0365, 0123, 0267, 0061, 0045, 0042, 0230, 0112, 0232, 0151, 0354, 0337, 
+  0021, 0256, 0033, 0355, 0031, 0225, 0042, 0050, 0056, 0261, 0157, 0237, 0120, 0320, 0332, 0323, 
+  0106, 0246, 0165, 0330, 0270, 0137, 0071, 0357, 0346, 0361, 0236, 0021, 0056, 0343, 0212, 0010, 
+  0050, 0045, 0125, 0020, 0125, 0167, 0316, 0343, 0141, 0050, 0125, 0004, 0052, 0130, 0260, 0310, 
+  0044, 0330, 0037, 0216, 0232, 0354, 0015, 0063, 0066, 0130, 0310, 0050, 0042, 0064, 0047, 0206, 
+  0330, 0320, 0115, 0160, 0016, 0166, 0273, 0017, 0205, 0163, 0115, 0360, 0005, 0023, 0221, 0134, 
+  0004, 0251, 0324, 0314, 0330, 0024, 0142, 0237, 0102, 0221, 0356, 0026, 0161, 0254, 0330, 0173, 
+  0160, 0314, 0156, 0046, 0117, 0041, 0110, 0254, 0240, 0326, 0260, 0035, 0000, 0115, 0030, 0217, 
+  0120, 0141, 0267, 0242, 0026, 0022, 0265, 0212, 0154, 0261, 0034, 0267, 0062, 0114, 0044, 0267, 
+  0021, 0352, 0257, 0000, 0375, 0022, 0121, 0103, 0227, 0202, 0025, 0204, 0173, 0345, 0117, 0253, 
+  0250, 0120, 0056, 0067, 0153, 0354, 0044, 0364, 0355, 0326, 0323, 0226, 0162, 0354, 0222, 0160, 
+  0027, 0106, 0052, 0146, 0303, 0116, 0252, 0014, 0330, 0152, 0062, 0214, 0022, 0356, 0004, 0272, 
+  0031, 0022, 0132, 0100, 0003, 0242, 0200, 0154, 0121, 0161, 0222, 0315, 0214, 0221, 0242, 0116, 
+  0271, 0023, 0355, 0256, 0324, 0135, 0270, 0004, 0226, 0051, 0021, 0121, 0273, 0315, 0022, 0071, 
+  0227, 0261, 0355, 0135, 0262, 0330, 0256, 0015, 0220, 0223, 0134, 0146, 0046, 0320, 0046, 0057, 
+  0370, 0125, 0133, 0357, 0305, 0156, 0251, 0253, 0071, 0254, 0125, 0123, 0010, 0313, 0353, 0021, 
+  0176, 0212, 0162, 0171, 0022, 0002, 0167, 0326, 0156, 0360, 0145, 0306, 0322, 0175, 0116, 0165, 
+  0316, 0127, 0103, 0316, 0332, 0102, 0025, 0120, 0140, 0217, 0240, 0203, 0010, 0246, 0044, 0343, 
+  0246, 0375, 0012, 0231, 0206, 0040, 0023, 0266, 0232, 0071, 0023, 0215, 0276, 0157, 0267, 0345, 
+  0372, 0242, 0204, 0316, 0354, 0213, 0255, 0171, 0273, 0143, 0144, 0346, 0302, 0115, 0031, 0347, 
+  0355, 0121, 0233, 0236, 0072, 0070, 0104, 0312, 0351, 0175, 0255, 0255, 0235, 0056, 0306, 0341, 
+  0151, 0142, 0174, 0107, 0004, 0005, 0176, 0371, 0162, 0054, 0347, 0022, 0354, 0127, 0343, 0311, 
+  0157, 0323, 0361, 0056, 0234, 0360, 0005, 0311, 0165, 0240, 0023, 0373, 0046, 0136, 0371, 0160, 
+  0251, 0245, 0060, 0174, 0356, 0122, 0270, 0072, 0255, 0024, 0076, 0203, 0121, 0371, 0377, 0306, 
+  0174, 0041, 0152, 0034, 0235, 0111, 0215, 0345, 0054, 0261, 0263, 0102, 0051, 0303, 0265, 0244, 
+  0230, 0230, 0101, 0204, 0373, 0117, 0127, 0333, 0101, 0272, 0202, 0351, 0016, 0344, 0276, 0040, 
+  0266, 0032, 0275, 0232, 0043, 0270, 0023, 0075, 0353, 0113, 0120, 0014, 0350, 0166, 0166, 0072, 
+  0060, 0070, 0265, 0175, 0031, 0072, 0342, 0275, 0023, 0353, 0335, 0252, 0167, 0117, 0363, 0145, 
+  0271, 0027, 0123, 0377, 0315, 0263, 0116, 0271, 0307, 0366, 0250, 0265, 0307, 0211, 0365, 0370, 
+  0230, 0366, 0164, 0216, 0226, 0162, 0320, 0163, 0027, 0126, 0333, 0364, 0330, 0354, 0270, 0076, 
+  0111, 0233, 0111, 0273, 0211, 0127, 0047, 0002, 0056, 0333, 0023, 0070, 0237, 0312, 0373, 0204, 
+  0257, 0335, 0243, 0226, 0321, 0354, 0207, 0135, 0346, 0372, 0060, 0166, 0137, 0107, 0075, 0334, 
+  0125, 0073, 0067, 0205, 0303, 0315, 0241, 0023, 0364, 0250, 0341, 0367, 0100, 0237, 0335, 0333, 
+  0153, 0333, 0212, 0354, 0123, 0365, 0056, 0337, 0234, 0326, 0030, 0130, 0232, 0277, 0101, 0164, 
+  0373, 0207, 0220, 0067, 0002, 0225, 0124, 0120, 0102, 0064, 0222, 0224, 0146, 0112, 0101, 0324, 
+  0153, 0273, 0376, 0102, 0221, 0264, 0033, 0063, 0015, 0334, 0306, 0230, 0164, 0216, 0314, 0234, 
+  0054, 0253, 0363, 0255, 0200, 0046, 0104, 0131, 0102, 0257, 0007, 0155, 0227, 0310, 0011, 0147, 
+  0361, 0061, 0342, 0272, 0234, 0072, 0032, 0236, 0273, 0216, 0376, 0361, 0357, 0351, 0077, 0177, 
+  0320, 0152, 0112, 0175, 0363, 0310, 0124, 0347, 0130, 0077, 0053, 0255, 0316, 0014, 0075, 0133, 
+  0210, 0061, 0030, 0375, 0013, 0121, 0273, 0215, 0024, 0350, 0124, 0012, 0155, 0275, 0031, 0142, 
+  0177, 0165, 0260, 0065, 0356, 0327, 0154, 0032, 0221, 0336, 0365, 0032, 0072, 0154, 0013, 0035, 
+  0254, 0221, 0127, 0116, 0344, 0223, 0233, 0272, 0176, 0170, 0077, 0356, 0157, 0375, 0163, 0361, 
+  0023, 0211, 0251, 0110, 0070, 0000, 0050, 0165, 0165, 0141, 0171, 0051, 0155, 0141, 0164, 0145, 
+  0057, 0000, 0000, 0000, 0002, 0000, 0000, 0000
+} };
+
+static GStaticResource static_resource = { imageconverter_resource_data.data, sizeof (imageconverter_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL };
+
+G_MODULE_EXPORT
+GResource *imageconverter_get_resource (void);
+GResource *imageconverter_get_resource (void)
+{
+  return g_static_resource_get_resource (&static_resource);
+}
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __G_CONSTRUCTOR_H__
+#define __G_CONSTRUCTOR_H__
+
+/*
+  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
+  destructors, in a usable way, including e.g. on library unload. If not you're on
+  your own.
+
+  Some compilers need #pragma to handle this, which does not work with macros,
+  so the way you need to use this is (for constructors):
+
+  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
+  #endif
+  G_DEFINE_CONSTRUCTOR(my_constructor)
+  static void my_constructor(void) {
+   ...
+  }
+
+*/
+
+#ifndef __GTK_DOC_IGNORE__
+
+#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
+#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);
+
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
+/* Visual studio 2008 and later has _Pragma */
+
+/*
+ * Only try to include gslist.h if not already included via glib.h,
+ * so that items using gconstructor.h outside of GLib (such as
+ * GResources) continue to build properly.
+ */
+#ifndef __G_LIB_H__
+#include "gslist.h"
+#endif
+
+#include <stdlib.h>
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* We do some weird things to avoid the constructors being optimized
+ * away on VS2015 if WholeProgramOptimization is enabled. First we
+ * make a reference to the array from the wrapper to make sure its
+ * references. Then we use a pragma to make sure the wrapper function
+ * symbol is always included at the link stage. Also, the symbols
+ * need to be extern (but not dllexport), even though they are not
+ * really used from another object file.
+ */
+
+/* We need to account for differences between the mangling of symbols
+ * for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed
+ * with an underscore but symbols on x64/ARM/ARM64 are not.
+ */
+#ifdef _M_IX86
+#define G_MSVC_SYMBOL_PREFIX "_"
+#else
+#define G_MSVC_SYMBOL_PREFIX ""
+#endif
+
+#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
+#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)
+
+#define G_MSVC_CTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
+  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;
+
+#define G_MSVC_DTOR(_func,_sym_prefix) \
+  static void _func(void); \
+  extern int (* _array ## _func)(void);              \
+  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
+   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
+  __pragma(section(".CRT$XCU",read)) \
+  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined (_MSC_VER)
+
+#define G_HAS_CONSTRUCTORS 1
+
+/* Pre Visual studio 2008 must use #pragma section */
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _wrapper(void) { _func(); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  section(".CRT$XCU",read)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void); \
+  static int _func ## _constructor(void) { atexit (_func); return 0; } \
+  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;
+
+#elif defined(__SUNPRO_C)
+
+/* This is not tested, but i believe it should work, based on:
+ * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
+ */
+
+#define G_HAS_CONSTRUCTORS 1
+
+#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
+#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1
+
+#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
+  init(_func)
+#define G_DEFINE_CONSTRUCTOR(_func) \
+  static void _func(void);
+
+#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
+  fini(_func)
+#define G_DEFINE_DESTRUCTOR(_func) \
+  static void _func(void);
+
+#else
+
+/* constructors not supported for this compiler */
+
+#endif
+
+#endif /* __GTK_DOC_IGNORE__ */
+#endif /* __G_CONSTRUCTOR_H__ */
+
+#ifdef G_HAS_CONSTRUCTORS
+
+#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(imageconverterresource_constructor)
+#endif
+G_DEFINE_CONSTRUCTOR(imageconverterresource_constructor)
+#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
+#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(imageconverterresource_destructor)
+#endif
+G_DEFINE_DESTRUCTOR(imageconverterresource_destructor)
+
+#else
+#warning "Constructor not supported on this compiler, linking in resources will not work"
+#endif
+
+static void imageconverterresource_constructor (void)
+{
+  g_static_resource_init (&static_resource);
+}
+
+static void imageconverterresource_destructor (void)
+{
+  g_static_resource_fini (&static_resource);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/9.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/9.html new file mode 100644 index 0000000..df71994 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/9.html @@ -0,0 +1,643 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
/*
+ *  caja-image-converter.c
+ *
+ *  Copyright (C) 2004-2005 Jürg Billeter
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Jürg Billeter <j@bitron.ch>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <glib/gi18n-lib.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-image-converter.h"
+#include "caja-image-resizer.h"
+#include "caja-image-rotator.h"
+
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h> /* for strcmp */<--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static void caja_image_converter_instance_init (CajaImageConverter      *img);
+static void caja_image_converter_class_init    (CajaImageConverterClass *class);
+GList *     caja_image_converter_get_file_items (CajaMenuProvider *provider,
+						     GtkWidget            *window,
+						     GList                *files);
+
+static GType image_converter_type = 0;
+
+static gboolean
+image_converter_file_is_image (CajaFileInfo *file_info)
+{
+	gchar            *uri_scheme;
+	gchar            *mime_type;
+	gboolean	maybe_image;
+
+	maybe_image = TRUE;
+	uri_scheme = caja_file_info_get_uri_scheme (file_info);
+	if (strcmp (uri_scheme, "file") != 0)
+		maybe_image = FALSE;
+	g_free (uri_scheme);
+
+	mime_type = caja_file_info_get_mime_type (file_info);
+	if (strncmp (mime_type, "image/", 6) != 0)
+		maybe_image = FALSE;
+	g_free (mime_type);
+
+	return maybe_image;
+}
+
+static GList *
+image_converter_filter_images (GList *files)
+{
+	GList *images;
+	GList *file;
+
+	images = NULL;
+
+	for (file = files; file != NULL; file = file->next) {
+		if (image_converter_file_is_image (file->data))
+			images = g_list_prepend (images, file->data);
+	}
+
+	return images;
+}
+
+static void
+image_resize_callback (CajaMenuItem *item,
+			GList *files)
+{
+	CajaImageResizer *resizer = caja_image_resizer_new (image_converter_filter_images (files));
+	caja_image_resizer_show_dialog (resizer);
+}
+
+static void
+image_rotate_callback (CajaMenuItem *item,
+			GList *files)
+{
+	CajaImageRotator *rotator = caja_image_rotator_new (image_converter_filter_images (files));
+	caja_image_rotator_show_dialog (rotator);
+}
+
+static GList *
+caja_image_converter_get_background_items (CajaMenuProvider *provider,
+					     GtkWidget		  *window,
+					     CajaFileInfo	  *file_info)
+{
+	return NULL;
+}
+
+GList *
+caja_image_converter_get_file_items (CajaMenuProvider *provider,
+				       GtkWidget            *window,
+				       GList                *files)
+{
+	CajaMenuItem *item;
+	GList *file;
+	GList *items = NULL;
+
+	for (file = files; file != NULL; file = file->next) {
+		if (image_converter_file_is_image (file->data)) {
+			item = caja_menu_item_new ("CajaImageConverter::resize",
+				        _("_Resize Images..."),
+				        _("Resize each selected image"),
+				       NULL);
+			g_signal_connect (item, "activate",
+					  G_CALLBACK (image_resize_callback),
+					  caja_file_info_list_copy (files));
+
+			items = g_list_prepend (items, item);
+
+			item = caja_menu_item_new ("CajaImageConverter::rotate",
+				        _("Ro_tate Images..."),
+				        _("Rotate each selected image"),
+				       NULL);
+			g_signal_connect (item, "activate",
+					  G_CALLBACK (image_rotate_callback),
+					  caja_file_info_list_copy (files));
+
+			items = g_list_prepend (items, item);
+
+			items = g_list_reverse (items);
+
+			return items;
+		}
+	}
+
+	return NULL;
+}
+
+static void
+caja_image_converter_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_background_items = caja_image_converter_get_background_items;
+	iface->get_file_items = caja_image_converter_get_file_items;
+}
+
+static void
+caja_image_converter_instance_init (CajaImageConverter *img)
+{
+}
+
+static void
+caja_image_converter_class_init (CajaImageConverterClass *class)
+{
+}
+
+GType
+caja_image_converter_get_type (void)
+{
+	return image_converter_type;
+}
+
+void
+caja_image_converter_register_type (GTypeModule *module)
+{
+	static const GTypeInfo info = {
+		sizeof (CajaImageConverterClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) caja_image_converter_class_init,
+		NULL,
+		NULL,
+		sizeof (CajaImageConverter),
+		0,
+		(GInstanceInitFunc) caja_image_converter_instance_init,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_image_converter_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	image_converter_type = g_type_module_register_type (module,
+						     G_TYPE_OBJECT,
+						     "CajaImageConverter",
+						     &info, 0);
+
+	g_type_module_add_interface (module,
+				     image_converter_type,
+				     CAJA_TYPE_MENU_PROVIDER,
+				     &menu_provider_iface_info);
+}
+
+ +
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/index.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/index.html new file mode 100644 index 0000000..d6786e4 --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/index.html @@ -0,0 +1,473 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
audio-video-properties/bacon-video-widget-properties.c
23missingIncludeinformationInclude file: "config.h" not found.
25missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <math.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
audio-video-properties/bacon-video-widget-properties.h
26missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
audio-video-properties/caja-av-resources.c
1missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9unusedStructMember563styleunion member 'Anonymous0::alignment' is never used.
9unusedStructMember563styleunion member 'Anonymous0::ptr' is never used.
audio-video-properties/totem-gst-helpers.c
26missingIncludeSysteminformationInclude file: <gst/gstprotection.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
audio-video-properties/totem-properties-main.c
22missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <gst/gst.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libcaja-extension/caja-property-page-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
audio-video-properties/totem-properties-view.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
23missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gst/tag/tag.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gst/pbutils/pbutils.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE is a macro then please configure it.
audio-video-properties/totem-properties-view.h
24missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
gksu/libcaja-gksu.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
11missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
12missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
13missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
14missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-converter-resources.c
1missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9unusedStructMember563styleunion member 'Anonymous0::alignment' is never used.
9unusedStructMember563styleunion member 'Anonymous0::ptr' is never used.
image-converter/caja-image-converter.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-converter.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-resizer.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-resizer.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-rotator.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/caja-image-rotator.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
image-converter/image-converter.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
open-terminal/caja-open-terminal.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-configurable.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <gtk/gtkicontheme.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <gtk/gtkwidget.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <gtk/gtkmain.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <libmate-desktop/mate-desktop-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <errno.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <fcntl.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
44missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
320variableScope398styleThe scope of the variable 'ditem' can be reduced.
open-terminal/caja-open-terminal.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
open-terminal/open-terminal.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/caja-nste.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43variableScope398styleThe scope of the variable 'uri' can be reduced.
75knownConditionTrueFalse571styleCondition 'files!=NULL' is always true
sendto/caja-nste.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/caja-sendto-command.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib/gi18n.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <glib/gstdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
402variableScope398styleThe scope of the variable 'w' can be reduced.
634variableScope398styleThe scope of the variable 'item' can be reduced.
sendto/caja-sendto-module.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/caja-sendto-plugin.h
29missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/caja-sendto-resources.c
1missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9unusedStructMember563styleunion member 'Anonymous0::alignment' is never used.
9unusedStructMember563styleunion member 'Anonymous0::ptr' is never used.
sendto/nst-enum-types.c
4missingIncludeSysteminformationInclude file: <caja-sendto-plugin.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
6missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/nst-enum-types.h
7missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/plugins/caja-burn/caja-burn.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeinformationInclude file: "nst-common.h" not found.
32missingIncludeinformationInclude file: "caja-sendto-plugin.h" not found.
140variableScope398styleThe scope of the variable 'fenum' can be reduced.
141variableScope398styleThe scope of the variable 'file_info' can be reduced.
142variableScope398styleThe scope of the variable 'child' can be reduced.
sendto/plugins/emailclient/emailclient.c
28missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeinformationInclude file: "caja-sendto-plugin.h" not found.
35missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/plugins/nst-common.c
21missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
sendto/plugins/pidgin/pidgin.c
29missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <dbus/dbus.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <dbus/dbus-glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeinformationInclude file: "caja-sendto-plugin.h" not found.
381variableScope398styleThe scope of the variable 'file' can be reduced.
382variableScope398styleThe scope of the variable 'file_path' can be reduced.
447uninitvar457errorUninitialized variable: contacts_group
sendto/plugins/removable-devices/removable-devices.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeinformationInclude file: "nst-common.h" not found.
31missingIncludeinformationInclude file: "caja-sendto-plugin.h" not found.
sendto/plugins/upnp/upnp.c
29missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libgupnp/gupnp.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeinformationInclude file: "caja-sendto-plugin.h" not found.
share/caja-share.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libcaja-extension/caja-info-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libcaja-extension/caja-property-page-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
42missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
45missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
46missingIncludeSysteminformationInclude file: <sys/stat.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
47missingIncludeSysteminformationInclude file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
48missingIncludeSysteminformationInclude file: <stdlib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
737duplicateCondition398styleThe if condition is the same as the previous if condition
share/caja-share.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
share/shares.c
2missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
5missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
7missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
8missingIncludeSysteminformationInclude file: <time.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
9missingIncludeSysteminformationInclude file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
10missingIncludeSysteminformationInclude file: <sys/wait.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
394knownConditionTrueFalse571styleCondition 'path!=NULL' is always true
723knownConditionTrueFalse571styleCondition 'old_info!=NULL' is always true
share/shares.h
4missingIncludeSysteminformationInclude file: <glib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
wallpaper/caja-wallpaper-command.c
27missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
wallpaper/caja-wallpaper-extension.c
27missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
90variableScope398styleThe scope of the variable 'item' can be reduced.
wallpaper/caja-wallpaper-extension.h
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
xattr-tags/caja-xattr-tags-extension.c
25missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <glib/gi18n-lib.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
31missingIncludeSysteminformationInclude file: <gio/gio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
34missingIncludeSysteminformationInclude file: <libcaja-extension/caja-info-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
xattr-tags/caja-xattr-tags-extension.h
27missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+ +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/stats.html b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/stats.html new file mode 100644 index 0000000..4d817da --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/stats.html @@ -0,0 +1,193 @@ + + + + + + Cppcheck - HTML report - caja-extensions + + + + + +
+ + + + + +
+ + diff --git a/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/style.css b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2023-10-07-030918-7842-cppcheck@17387404b494_sendto-remove-gajim/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} -- cgit v1.2.1