aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-07 22:44:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-10 22:20:17 +0800
commit9b50f0ae49e9c99995ed5289eab656aede142c6b (patch)
tree72b856f7c567de2aeab8218bc495cfb10521df27 /libempathy-gtk/empathy-ui-utils.c
parentcec65054ff56209c3e660817830b7586b56a16d0 (diff)
downloadgsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar.gz
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar.bz2
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar.lz
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar.xz
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.tar.zst
gsoc2013-empathy-9b50f0ae49e9c99995ed5289eab656aede142c6b.zip
doesn't allow to send socket files
https://bugzilla.gnome.org/show_bug.cgi?id=663563
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 5d9551d12..a387160d3 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1825,6 +1825,27 @@ file_manager_send_file_response_cb (GtkDialog *widget,
gtk_widget_destroy (GTK_WIDGET (widget));
}
+static gboolean
+filter_cb (const GtkFileFilterInfo *filter_info,
+ gpointer data)
+{
+ /* filter out socket files */
+ return tp_strdiff (filter_info->mime_type, "inode/socket");
+}
+
+static GtkFileFilter *
+create_file_filter (void)
+{
+ GtkFileFilter *filter;
+
+ filter = gtk_file_filter_new ();
+
+ gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_MIME_TYPE, filter_cb,
+ NULL, NULL);
+
+ return filter;
+}
+
void
empathy_send_file_with_file_chooser (EmpathyContact *contact)
{
@@ -1859,6 +1880,9 @@ empathy_send_file_with_file_chooser (EmpathyContact *contact)
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (widget),
g_get_home_dir ());
+ gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (widget),
+ create_file_filter ());
+
g_signal_connect (widget, "response",
G_CALLBACK (file_manager_send_file_response_cb),
g_object_ref (contact));