From: buliabyak Date: Fri, 3 Nov 2006 22:48:41 +0000 (+0000) Subject: patch 1590039, whitespace X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c13b2f0f2d9d6dbac0b76c60937de7bf72a47cd;p=inkscape.git patch 1590039, whitespace --- diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index 7381c660e..cf816033a 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -624,6 +624,10 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType) gchar *fName = (gchar *)fileName.c_str(); //g_message("fname:%s\n", fName); + if (Glib::file_test(fileName, Glib::FILE_TEST_IS_DIR)) { + showNoPreview(); + return false; + } if (Glib::file_test(fileName, Glib::FILE_TEST_IS_REGULAR)) { @@ -646,23 +650,18 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType) if ((dialogType == SVG_TYPES || dialogType == IMPORT_TYPES) && (hasSuffix(fileName, svg) || hasSuffix(fileName, svgz) ) - ) - { + ) { bool retval = setFileName(fileName); showingNoPreview = false; return retval; - } - else if (isValidImageFile(fileName)) - { + } else if (isValidImageFile(fileName)) { showImage(fileName); showingNoPreview = false; return true; - } - else - { + } else { showNoPreview(); return false; - } + } }