From 8659ca5c350b9b08fb5f343c68955cdd6d361c96 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Sat, 11 May 2013 17:35:04 +0100 Subject: fdo#64311 - don't encourage the fpicker to give us URLs we can't handle. Change-Id: Ide7d833801e96a3375909238d036687082f34605 --- config_host/config_vclplug.h.in | 2 ++ configure.ac | 2 ++ vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 4 ++++ vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in index 8eecf3453801..4daf38375766 100644 --- a/config_host/config_vclplug.h.in +++ b/config_host/config_vclplug.h.in @@ -11,5 +11,7 @@ Settings about which X11 desktops have support enabled. #define ENABLE_KDE 0 #define ENABLE_KDE4 0 #define ENABLE_TDE 0 +#define ENABLE_GNOME_VFS 0 +#define ENABLE_GIO 0 #endif diff --git a/configure.ac b/configure.ac index 10d064835133..aa65cda5df18 100644 --- a/configure.ac +++ b/configure.ac @@ -9346,6 +9346,7 @@ if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" - ENABLE_GNOMEVFS="TRUE" AC_MSG_RESULT([yes]) PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 ) + AC_DEFINE(ENABLE_GNOME_VFS) else AC_MSG_RESULT([no]) fi @@ -9485,6 +9486,7 @@ if test "$test_gtk" = "yes"; then ENABLE_GIO="TRUE" AC_MSG_RESULT([yes]) PKG_CHECK_MODULES( GIO, gio-2.0 ) + AC_DEFINE(ENABLE_GIO) else AC_MSG_RESULT([no]) fi diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 5672b030b76e..b1b2d6087275 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -23,6 +23,8 @@ #undef _LINUX_SOURCE_COMPAT #endif +#include + #include #include #include @@ -138,7 +140,9 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); +#if defined(ENABLE_GNOME_VFS) || defined (ENABLE_GIO) gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); +#endif gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); m_pVBox = gtk_vbox_new( sal_False, 0 ); diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx index e08fdf78f2c4..7c8790628c28 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx @@ -23,6 +23,8 @@ #undef _LINUX_SOURCE_COMPAT #endif +#include + #include #include #include @@ -57,7 +59,9 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference< uno::XComponentCon GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, (char *)NULL ); gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); +#if defined(ENABLE_GNOME_VFS) || defined (ENABLE_GIO) gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); +#endif gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); } -- cgit v1.2.3