Commit 48459c63 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factorize

parent a29a43ba
......@@ -33,11 +33,9 @@
#include <klocale.h>
#include <kiconloader.h>
// LibKDcraw includes
// Local includes
#include <libkdcraw/kdcraw.h>
using namespace KDcrawIface;
#include "kpmetadata.h"
namespace KIPIRawConverterPlugin
{
......@@ -80,7 +78,7 @@ void MyImageList::slotAddImages(const KUrl::List& list)
}
}
if (!found && isRAWFile(imageUrl))
if (!found && KPMetadata::isRawFile(imageUrl))
{
new MyImageListViewItem(listView(), imageUrl);
}
......@@ -113,16 +111,6 @@ void MyImageList::slotRemoveItems()
while(find);
}
bool MyImageList::isRAWFile(const KUrl& url)
{
QString rawFilesExt(KDcraw::rawFiles());
QFileInfo fileInfo(url.path());
if (rawFilesExt.toUpper().contains( fileInfo.suffix().toUpper() ))
return true;
return false;
}
// ------------------------------------------------------------------------------------------------
MyImageListViewItem::MyImageListViewItem(KPImagesListView* const view, const KUrl& url)
......
......@@ -55,9 +55,6 @@ public:
explicit MyImageList(QWidget* const parent = 0);
virtual ~MyImageList();
static bool isRAWFile(const KUrl& url);
public Q_SLOTS:
virtual void slotAddImages(const KUrl::List& list);
......
......@@ -48,6 +48,7 @@
// Local includes
#include "kpmetadata.h"
#include "myimagelist.h"
#include "singledialog.h"
#include "batchdialog.h"
......@@ -126,7 +127,7 @@ void Plugin_RawConverter::slotActivateSingle()
if ( images.images().isEmpty() )
return;
if (!MyImageList::isRAWFile(images.images()[0]))
if (!KPMetadata::isRawFile(images.images()[0]))
{
KMessageBox::error(kapp->activeWindow(),
i18n("\"%1\" is not a RAW file.", images.images()[0].fileName()));
......
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