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

factorize

parent dca06c9e
......@@ -43,6 +43,10 @@
// Local includes
#include "slideshowkb.h"
#include "kpmetadata.h"
using namespace KIPIPlugins;
using namespace KDcrawIface;
namespace KIPIAdvancedSlideshowPlugin
{
......@@ -149,7 +153,6 @@ void ImageLoadThread::run()
m_haveImages = ok;
m_initialized = true;
}
}
else
{
......@@ -164,21 +167,18 @@ bool ImageLoadThread::loadImage()
QPair<QString, int> fileAngle = m_fileList[m_fileIndex];
QString path(fileAngle.first);
int angle(fileAngle.second);
QImage image;
// check if it's a RAW file.
QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
QFileInfo fileInfo(path);
if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() ))
if (KPMetadata::isRawFile(path))
{
// it's a RAW file, use the libkdcraw loader
KDcrawIface::KDcraw::loadDcrawPreview(image, path);
KDcraw::loadDcrawPreview(image, path);
}
else
{
// use the standard loader
image=QImage(path);
image = QImage(path);
}
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