summaryrefslogtreecommitdiffstats
path: root/pictureviewer2.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2015-08-13 14:05:10 +0200
committerArno <arno@disconnect.de>2015-08-13 14:05:10 +0200
commitbc21f0ed338040497f1755331d5fc6a824a4de25 (patch)
tree003168fc280a7e2ade46356b57c12bebf69e7714 /pictureviewer2.cpp
parente223bc238ea3e2dbeaabcc4c9218558d26273de5 (diff)
downloadSheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.tar.gz
SheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.tar.bz2
SheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.zip
Don't crash when current pic doesn't exist
Check if the currently shown picture still exists instead of crashing.
Diffstat (limited to 'pictureviewer2.cpp')
-rw-r--r--pictureviewer2.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp
index d8cae44..6568128 100644
--- a/pictureviewer2.cpp
+++ b/pictureviewer2.cpp
@@ -460,6 +460,10 @@ void PictureViewer2::showFile(const PicData &file){
return;
}
mCurPicData = file;
+ QFileInfo fi(file.at(PicFilesModel::FullPath).toString());
+ if(!fi.exists()){
+ return;
+ }
QPixmap pixmap(file.at(PicFilesModel::FullPath).toString());
if(pixmap.isNull()){
mCurPicData = Helper::convertToPng(file);