Commit 4a489778 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factorize

parent dca06c9e
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
// Local includes // Local includes
#include "slideshowkb.h" #include "slideshowkb.h"
#include "kpmetadata.h"
using namespace KIPIPlugins;
using namespace KDcrawIface;
namespace KIPIAdvancedSlideshowPlugin namespace KIPIAdvancedSlideshowPlugin
{ {
...@@ -149,7 +153,6 @@ void ImageLoadThread::run() ...@@ -149,7 +153,6 @@ void ImageLoadThread::run()
m_haveImages = ok; m_haveImages = ok;
m_initialized = true; m_initialized = true;
} }
} }
else else
{ {
...@@ -164,21 +167,18 @@ bool ImageLoadThread::loadImage() ...@@ -164,21 +167,18 @@ bool ImageLoadThread::loadImage()
QPair<QString, int> fileAngle = m_fileList[m_fileIndex]; QPair<QString, int> fileAngle = m_fileList[m_fileIndex];
QString path(fileAngle.first); QString path(fileAngle.first);
int angle(fileAngle.second); int angle(fileAngle.second);
QImage image; QImage image;
// check if it's a RAW file. // check if it's a RAW file.
QString rawFilesExt(KDcrawIface::KDcraw::rawFiles()); if (KPMetadata::isRawFile(path))
QFileInfo fileInfo(path);
if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() ))
{ {
// it's a RAW file, use the libkdcraw loader // it's a RAW file, use the libkdcraw loader
KDcrawIface::KDcraw::loadDcrawPreview(image, path); KDcraw::loadDcrawPreview(image, path);
} }
else else
{ {
// use the standard loader // use the standard loader
image=QImage(path); image = QImage(path);
} }
if (angle != 0) if (angle != 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment