Code

patch 1590039, whitespace
authorbuliabyak <buliabyak@users.sourceforge.net>
Fri, 3 Nov 2006 22:48:41 +0000 (22:48 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Fri, 3 Nov 2006 22:48:41 +0000 (22:48 +0000)
src/ui/dialog/filedialog.cpp

index 7381c660e4a820c709a847f11949e27627b72f71..cf816033ad43c16764c8e3e58d71abb6785e4a80 100644 (file)
@@ -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;
-        }
+    }
 }