index b6c35140e5d0eaadfec4f17cd6e9686ffc218190..08c0d411615c801106332b5a31816862a84cb491 100644 (file)
//Another hack
#include <gtk/gtkentry.h>
#include <gtk/gtkexpander.h>
+#ifdef WITH_GNOME_VFS
+# include <libgnomevfs/gnome-vfs-init.h> // gnome_vfs_initialized
+#endif
Glib::ustring fileName = get_preview_filename();
#ifdef WITH_GNOME_VFS
- if (fileName.length() < 1)
+ if ( fileName.empty() && gnome_vfs_initialized() ) {
fileName = get_preview_uri();
+ }
#endif
- if (fileName.length() < 1)
+ if (fileName.empty()) {
return;
+ }
svgPreview.set(fileName, dialogType);
}
void FileOpenDialogImpl::createFilterMenu()
{
- //patterns added dynamically below
- Gtk::FileFilter allImageFilter;
- allImageFilter.set_name(_("All Images"));
- extensionMap[Glib::ustring(_("All Images"))]=NULL;
- add_filter(allImageFilter);
+ Gtk::FileFilter allInkscapeFilter;
+ allInkscapeFilter.set_name(_("All Inkscape Files"));
+ extensionMap[Glib::ustring(_("All Inkscape Files"))]=NULL;
+ add_filter(allInkscapeFilter);
Gtk::FileFilter allFilter;
allFilter.set_name(_("All Files"));
allFilter.add_pattern("*");
add_filter(allFilter);
- //patterns added dynamically below
- Gtk::FileFilter allInkscapeFilter;
- allInkscapeFilter.set_name(_("All Inkscape Files"));
- extensionMap[Glib::ustring(_("All Inkscape Files"))]=NULL;
- add_filter(allInkscapeFilter);
+ Gtk::FileFilter allImageFilter;
+ allImageFilter.set_name(_("All Images"));
+ extensionMap[Glib::ustring(_("All Images"))]=NULL;
+ add_filter(allImageFilter);
+ //patterns added dynamically below
Inkscape::Extension::DB::InputList extension_list;
Inkscape::Extension::db.get_input_list(extension_list);
set_select_multiple(true);
#ifdef WITH_GNOME_VFS
- set_local_only(false);
+ if (gnome_vfs_initialized()) {
+ set_local_only(false);
+ }
#endif
/* Initalize to Autodetect */
}
myFilename = get_filename();
#ifdef WITH_GNOME_VFS
- if (myFilename.length() < 1)
+ if (myFilename.empty() && gnome_vfs_initialized())
myFilename = get_uri();
#endif
cleanup( true );
{
std::vector<Glib::ustring> result = get_filenames();
#ifdef WITH_GNOME_VFS
- if (result.empty())
+ if (result.empty() && gnome_vfs_initialized())
result = get_uris();
#endif
return result;
set_select_multiple(false);
#ifdef WITH_GNOME_VFS
- set_local_only(false);
+ if (gnome_vfs_initialized()) {
+ set_local_only(false);
+ }
#endif
/* Initalize to Autodetect */
// Pick up any changes the user has typed in.
Glib::ustring tmp = get_filename();
#ifdef WITH_GNOME_VFS
- if ( tmp.empty() ) {
+ if ( tmp.empty() && gnome_vfs_initialized() ) {
tmp = get_uri();
}
#endif
set_select_multiple(false);
#ifdef WITH_GNOME_VFS
- set_local_only(false);
+ if (gnome_vfs_initialized()) {
+ set_local_only(false);
+ }
#endif
/* Initalize to Autodetect */
}
myFilename = get_filename();
#ifdef WITH_GNOME_VFS
- if (myFilename.length() < 1)
+ if ( myFilename.empty() && gnome_vfs_initialized() ) {
myFilename = get_uri();
+ }
#endif
/*