summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Caulier <[email protected]>2015-10-10 09:51:54 +0200
committerGilles Caulier <[email protected]>2015-10-10 09:51:54 +0200
commitb8b579051e5ba8f4ad92258acfac83e905cd602b (patch)
treeabccb75aa09433e6730ef679c819c51055a1ffc1
parent6ceaf51d9d01f5caffe51e1d5b6a00045e055453 (diff)
port++
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/kdcraw.cpp28
-rw-r--r--src/kdcraw_p.cpp18
-rw-r--r--tests/multithreading/CMakeLists.txt1
4 files changed, 24 insertions, 26 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1c0c06d..ae6955b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,8 +11,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
add_definitions(${LibRaw_DEFINITIONS})
-remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
-
set(kdcraw_LIB_SRCS kdcraw.cpp
kdcraw_p.cpp
dcrawinfocontainer.cpp
@@ -53,7 +51,6 @@ target_link_libraries(KF5KDcraw
${LibRaw_LIBRARIES}
PUBLIC
Qt5::Core
- Qt5::Widgets
Qt5::Gui
)
diff --git a/src/kdcraw.cpp b/src/kdcraw.cpp
index 4ae0d65..2b3fb27 100644
--- a/src/kdcraw.cpp
+++ b/src/kdcraw.cpp
@@ -71,7 +71,7 @@ KDcraw::~KDcraw()
QString KDcraw::version()
{
- return QString(KDCRAW_VERSION_STRING);
+ return QString::fromLatin1(KDCRAW_VERSION_STRING);
}
void KDcraw::cancel()
@@ -113,8 +113,8 @@ bool KDcraw::loadEmbeddedPreview(QImage& image, const QString& path)
bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QString& path)
{
QFileInfo fileInfo(path);
- QString rawFilesExt(rawFiles());
- QString ext = fileInfo.suffix().toUpper();
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
+ QString ext = fileInfo.suffix().toUpper();
if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext))
return false;
@@ -135,7 +135,7 @@ bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QString& path)
bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QBuffer& buffer)
{
- QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
LibRaw raw;
QByteArray inData = buffer.data();
@@ -154,7 +154,7 @@ bool KDcraw::loadEmbeddedPreview(QByteArray& imgData, const QBuffer& buffer)
bool KDcraw::loadHalfPreview(QImage& image, const QString& path)
{
QFileInfo fileInfo(path);
- QString rawFilesExt(rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
QString ext = fileInfo.suffix().toUpper();
if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext))
@@ -191,7 +191,7 @@ bool KDcraw::loadHalfPreview(QImage& image, const QString& path)
bool KDcraw::loadHalfPreview(QByteArray& imgData, const QString& path)
{
QFileInfo fileInfo(path);
- QString rawFilesExt(rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
QString ext = fileInfo.suffix().toUpper();
if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext))
@@ -226,7 +226,7 @@ bool KDcraw::loadHalfPreview(QByteArray& imgData, const QString& path)
bool KDcraw::loadHalfPreview(QByteArray& imgData, const QBuffer& inBuffer)
{
- QString rawFilesExt(KDcrawIface::KDcraw::rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
LibRaw raw;
QByteArray inData = inBuffer.data();
@@ -257,8 +257,8 @@ bool KDcraw::loadHalfPreview(QByteArray& imgData, const QBuffer& inBuffer)
bool KDcraw::loadFullImage(QImage& image, const QString& path, const RawDecodingSettings& settings)
{
QFileInfo fileInfo(path);
- QString rawFilesExt(rawFiles());
- QString ext = fileInfo.suffix().toUpper();
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
+ QString ext = fileInfo.suffix().toUpper();
if (!fileInfo.exists() || ext.isEmpty() || !rawFilesExt.toUpper().contains(ext))
return false;
@@ -312,7 +312,7 @@ bool KDcraw::loadFullImage(QImage& image, const QString& path, const RawDecoding
bool KDcraw::rawFileIdentify(DcrawInfoContainer& identify, const QString& path)
{
QFileInfo fileInfo(path);
- QString rawFilesExt(rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
QString ext = fileInfo.suffix().toUpper();
identify.isDecodable = false;
@@ -349,7 +349,7 @@ bool KDcraw::rawFileIdentify(DcrawInfoContainer& identify, const QString& path)
bool KDcraw::extractRAWData(const QString& filePath, QByteArray& rawData, DcrawInfoContainer& identify, unsigned int shotSelect)
{
QFileInfo fileInfo(filePath);
- QString rawFilesExt(rawFiles());
+ QString rawFilesExt = QString::fromUtf8(rawFiles());
QString ext = fileInfo.suffix().toUpper();
identify.isDecodable = false;
@@ -502,7 +502,7 @@ const char* KDcraw::rawFiles()
QStringList KDcraw::rawFilesList()
{
QString string = QString::fromLatin1(rawFiles());
- return string.remove("*.").split(' ');
+ return string.remove(QLatin1String("*.")).split(QLatin1Char(' '));
}
int KDcraw::rawFilesVersion()
@@ -516,14 +516,14 @@ QStringList KDcraw::supportedCamera()
const char** const list = LibRaw::cameraList();
for (int i = 0; i < LibRaw::cameraCount(); i++)
- camera.append(list[i]);
+ camera.append(QString::fromUtf8(list[i]));
return camera;
}
QString KDcraw::librawVersion()
{
- return QString(LIBRAW_VERSION_STR).remove("-Release");
+ return QString::fromLatin1(LIBRAW_VERSION_STR).remove(QLatin1String("-Release"));
}
int KDcraw::librawUseGomp()
diff --git a/src/kdcraw_p.cpp b/src/kdcraw_p.cpp
index 38fdc2b..02fd13c 100644
--- a/src/kdcraw_p.cpp
+++ b/src/kdcraw_p.cpp
@@ -67,10 +67,10 @@ KDcraw::Private::~Private()
void KDcraw::Private::createPPMHeader(QByteArray& imgData, libraw_processed_image_t* const img)
{
- QString header = QString("P%1\n%2 %3\n%4\n").arg(img->colors == 3 ? "6" : "5")
- .arg(img->width)
- .arg(img->height)
- .arg((1 << img->bits)-1);
+ QString header = QString::fromUtf8("P%1\n%2 %3\n%4\n").arg(img->colors == 3 ? QLatin1String("6") : QLatin1String("5"))
+ .arg(img->width)
+ .arg(img->height)
+ .arg((1 << img->bits)-1);
imgData.append(header.toLatin1());
imgData.append(QByteArray((const char*)img->data, (int)img->data_size));
}
@@ -110,9 +110,9 @@ double KDcraw::Private::progressValue() const
void KDcraw::Private::fillIndentifyInfo(LibRaw* const raw, DcrawInfoContainer& identify)
{
identify.dateTime.setTime_t(raw->imgdata.other.timestamp);
- identify.make = QString(raw->imgdata.idata.make);
- identify.model = QString(raw->imgdata.idata.model);
- identify.owner = QString(raw->imgdata.other.artist);
+ identify.make = QString::fromUtf8(raw->imgdata.idata.make);
+ identify.model = QString::fromUtf8(raw->imgdata.idata.model);
+ identify.owner = QString::fromUtf8(raw->imgdata.other.artist);
identify.DNGVersion = QString::number(raw->imgdata.idata.dng_version);
identify.sensitivity = raw->imgdata.other.iso_speed;
identify.exposureTime = raw->imgdata.other.shutter;
@@ -152,10 +152,10 @@ void KDcraw::Private::fillIndentifyInfo(LibRaw* const raw, DcrawInfoContainer& i
for (int i=0; i < 16; i++)
{
- identify.filterPattern.append(raw->imgdata.idata.cdesc[raw->COLOR(i >> 1,i & 1)]);
+ identify.filterPattern.append(QChar::fromLatin1(raw->imgdata.idata.cdesc[raw->COLOR(i >> 1, i & 1)]));
}
- identify.colorKeys = raw->imgdata.idata.cdesc;
+ identify.colorKeys = QString::fromLatin1(raw->imgdata.idata.cdesc);
}
for(int c = 0 ; c < raw->imgdata.idata.colors ; c++)
diff --git a/tests/multithreading/CMakeLists.txt b/tests/multithreading/CMakeLists.txt
index 2ae8104..bc59b82 100644
--- a/tests/multithreading/CMakeLists.txt
+++ b/tests/multithreading/CMakeLists.txt
@@ -17,6 +17,7 @@ set(multicorerawtopng_SRCS
add_executable(multicorerawtopng ${multicorerawtopng_SRCS})
target_link_libraries(multicorerawtopng
+ Qt5::Widgets
Qt5::Gui
Qt5::Core
KF5KDcraw