From 3c13b2f0f2d9d6dbac0b76c60937de7bf72a47cd Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 3 Nov 2006 22:48:41 +0000 Subject: [PATCH] patch 1590039, whitespace --- src/ui/dialog/filedialog.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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; - } + } } -- 2.30.2