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

new commun static method to check if file is RAW type

parent b1685e66
......@@ -38,11 +38,17 @@
#include "kpmetasettings.h"
#include "kphostsettings.h"
// LibKDcraw includes
#include <libkdcraw/kdcraw.h>
// LibKipi includes
#include <libkipi/interface.h>
#include <libkipi/pluginloader.h>
using namespace KDcrawIface;
namespace KIPIPlugins
{
......@@ -143,6 +149,8 @@ bool KPMetadata::hasSidecar(const QString& path)
#endif // KEXIV2_VERSION < 0x020300
// -- Static Methods -------------------------------------------------------------------------
bool KPMetadata::moveSidecar(const KUrl& src, const KUrl& dst)
{
if (hasSidecar(src.toLocalFile()))
......@@ -154,4 +162,11 @@ bool KPMetadata::moveSidecar(const KUrl& src, const KUrl& dst)
return false;
}
bool KPMetadata::isRawFile(const KUrl& url)
{
QString rawFilesExt(KDcraw::rawFiles());
QFileInfo fileInfo(url.toLocalFile());
return (rawFilesExt.toUpper().contains(fileInfo.suffix().toUpper()));
}
} // namespace KIPIPlugins
......@@ -135,13 +135,14 @@ public:
public:
static bool moveSidecar(const KUrl& src, const KUrl& dest);
static bool isRawFile(const KUrl& url);
private:
void init();
private:
Interface* m_iface;
};
......
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