Commit efb9ff14 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factorize

parent 83bc987c
......@@ -70,7 +70,7 @@ using namespace KIPIPlugins;
namespace KIPIJPEGLossLessPlugin
{
Utils::Utils(QObject *parent)
Utils::Utils(QObject* const parent)
: QObject(parent)
{
}
......@@ -200,16 +200,6 @@ bool Utils::isJPEG(const QString& file)
return format=="JPEG";
}
bool Utils::isRAW(const QString& file)
{
QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
QFileInfo fileInfo(file);
if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() ))
return true;
return false;
}
bool Utils::copyOneFile(const QString& src, const QString& dst)
{
QFile sFile(src);
......
......@@ -39,7 +39,7 @@ class Utils : public QObject
public:
Utils(QObject* parent);
Utils(QObject* const parent);
~Utils();
bool updateMetadataImageMagick(const QString& src, QString& err);
......@@ -50,10 +50,6 @@ public: // Static methods.
*/
static bool isJPEG(const QString& file);
/** Test if a file is a RAW file supported by dcraw.
*/
static bool isRAW(const QString& file);
/** POSIX Compliant File Copy and Move -
Can't use KIO based operations as we need to use these in a thread
*/
......
......@@ -106,7 +106,7 @@ bool ImageGrayScale::image2GrayScale(const QString& src, QString& err)
static_cast<QFSFileEngine*>(m_tmpFile.fileEngine())->rename(tmp);
#endif
if (Utils::isRAW(src))
if (KPMetadata::isRawFile(src))
{
err = i18n("Cannot convert to gray scale RAW file");
return false;
......
......@@ -101,7 +101,7 @@ bool ImageFlip::flip(const QString& src, FlipAction action, QString& err)
static_cast<QFSFileEngine*>(m_tmpFile.fileEngine())->rename(tmp);
#endif
if (Utils::isRAW(src))
if (KPMetadata::isRawFile(src))
{
err = i18n("Cannot rotate RAW file");
return false;
......
......@@ -104,7 +104,7 @@ bool ImageRotate::rotate(const QString& src, RotateAction angle, QString& err)
static_cast<QFSFileEngine*>(m_tmpFile.fileEngine())->rename(tmp);
#endif
if (Utils::isRAW(src))
if (KPMetadata::isRawFile(src))
{
err = i18n("Cannot rotate RAW file");
return false;
......
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