summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3e0c0e)
raw | patch | inline | side by side (parent: f3e0c0e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Nov 2006 22:48:41 +0000 (22:48 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Nov 2006 22:48:41 +0000 (22:48 +0000) |
src/ui/dialog/filedialog.cpp | patch | blob | history |
index 7381c660e4a820c709a847f11949e27627b72f71..cf816033ad43c16764c8e3e58d71abb6785e4a80 100644 (file)
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))
{
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;
- }
+ }
}