Commit fef9c7ff authored by Halla Rempt's avatar Halla Rempt Committed by Agata Cacko
Browse files

Do not use QDir::separator to build file paths

Since https://doc.qt.io/qt-5/qdir.html#separator says

"You do not need to use this function to build file paths. If you always
use "/", Qt will translate your paths to conform to the underlying
operating system. "

CCBUG:421575
parent 7a052f9c
......@@ -71,7 +71,7 @@ void KisBContrastBenchmark::benchmarkFilter()
KisFilterConfigurationSP kfc = filter->defaultConfiguration();
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
QFile file(QString(FILES_DATA_DIR) + '/' + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
......
......@@ -68,7 +68,7 @@ void KisBlurBenchmark::benchmarkFilter()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
KisFilterConfigurationSP kfc = filter->defaultConfiguration();
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
QFile file(QString(FILES_DATA_DIR) + '/' + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
......
......@@ -141,7 +141,7 @@ void KisFilterSelectionsBenchmark::testAll()
initSelection();
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8();
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
m_device = new KisPaintDevice(cs);
m_device->convertFromQImage(image, 0, 0, 0);
......
......@@ -77,7 +77,7 @@ void KisLevelFilterBenchmark::benchmarkFilter()
kfc->setProperty("outblackvalue", 0);
kfc->setProperty("outwhitevalue", 255);
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
QFile file(QString(FILES_DATA_DIR) + '/' + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
......
......@@ -61,7 +61,7 @@ void KisLowMemoryBenchmark::benchmarkWideArea(const QString presetFileName,
int poolLimitMiB,
int index)
{
KisPaintOpPresetSP preset = new KisPaintOpPreset(QString(FILES_DATA_DIR) + QDir::separator() + presetFileName);
KisPaintOpPresetSP preset = new KisPaintOpPreset(QString(FILES_DATA_DIR) + '/' + presetFileName);
LOAD_PRESET_OR_RETURN(preset, presetFileName);
......
......@@ -42,9 +42,9 @@ void KisProjectionBenchmark::benchmarkProjection()
{
QBENCHMARK{
KisDocument *doc = KisPart::instance()->createDocument();
doc->loadNativeFormat(QString(FILES_DATA_DIR) + QDir::separator() + "load_test.kra");
doc->loadNativeFormat(QString(FILES_DATA_DIR) + '/' + "load_test.kra");
doc->image()->refreshGraph();
doc->exportDocumentSync(QUrl::fromLocalFile(QString(FILES_OUTPUT_DIR) + QDir::separator() + "save_test.kra"), doc->mimeType());
doc->exportDocumentSync(QUrl::fromLocalFile(QString(FILES_OUTPUT_DIR) + '/' + "save_test.kra"), doc->mimeType());
delete doc;
}
}
......@@ -53,7 +53,7 @@ void KisProjectionBenchmark::benchmarkLoading()
{
QBENCHMARK{
KisDocument *doc2 = KisPart::instance()->createDocument();
doc2->loadNativeFormat(QString(FILES_DATA_DIR) + QDir::separator() + "load_test.kra");
doc2->loadNativeFormat(QString(FILES_DATA_DIR) + '/' + "load_test.kra");
delete doc2;
}
}
......
......@@ -58,8 +58,8 @@ const QString OUTPUT_FORMAT = ".png";
void KisStrokeBenchmark::initTestCase()
{
m_dataPath = QString(FILES_DATA_DIR) + QDir::separator();
m_outputPath = QString(FILES_OUTPUT_DIR) + QDir::separator();
m_dataPath = QString(FILES_DATA_DIR) + '/';
m_outputPath = QString(FILES_OUTPUT_DIR) + '/';
m_colorSpace = KoColorSpaceRegistry::instance()->rgb8();
m_color = KoColor(m_colorSpace);
......
......@@ -54,7 +54,7 @@ void KisAutoBrushTest::testMaskGeneration()
cs->setOpacity(fdev->data(), OPACITY_OPAQUE_U8, 100 * 100);
QPoint errpoint;
QImage result(QString(FILES_DATA_DIR) + QDir::separator() + "result_autobrush_1.png");
QImage result(QString(FILES_DATA_DIR) + '/' + "result_autobrush_1.png");
QImage image = fdev->convertToQImage(0);
if (!TestUtil::compareQImages(errpoint, image, result)) {
......@@ -66,7 +66,7 @@ void KisAutoBrushTest::testMaskGeneration()
fdev = new KisFixedPaintDevice(cs);
a->mask(fdev, KoColor(Qt::black, cs), KisDabShape(), info);
result = QImage(QString(FILES_DATA_DIR) + QDir::separator() + "result_autobrush_3.png");
result = QImage(QString(FILES_DATA_DIR) + '/' + "result_autobrush_3.png");
image = fdev->convertToQImage(0);
if (!TestUtil::compareQImages(errpoint, image, result)) {
image.save("kis_autobrush_test_3.png");
......@@ -82,7 +82,7 @@ void KisAutoBrushTest::testMaskGeneration()
fdev = new KisFixedPaintDevice(cs);
a->mask(fdev, dev, KisDabShape(), info);
result = QImage(QString(FILES_DATA_DIR) + QDir::separator() + "result_autobrush_4.png");
result = QImage(QString(FILES_DATA_DIR) + '/' + "result_autobrush_4.png");
image = fdev->convertToQImage(0);
if (!TestUtil::compareQImages(errpoint, image, result)) {
image.save("kis_autobrush_test_4.png");
......
......@@ -35,7 +35,7 @@
void KisGbrBrushTest::testMaskGenerationSingleColor()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "brush.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "brush.gbr"));
brush->load();
Q_ASSERT(brush->valid());
const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8();
......@@ -53,7 +53,7 @@ void KisGbrBrushTest::testMaskGenerationSingleColor()
brush->mask(fdev, KoColor(Qt::black, cs), KisDabShape(), info);
QPoint errpoint;
QImage result = QImage(QString(FILES_DATA_DIR) + QDir::separator() + "result_brush_3.png");
QImage result = QImage(QString(FILES_DATA_DIR) + '/' + "result_brush_3.png");
QImage image = fdev->convertToQImage(0);
if (!TestUtil::compareQImages(errpoint, image, result)) {
image.save("kis_gbr_brush_test_3.png");
......@@ -63,7 +63,7 @@ void KisGbrBrushTest::testMaskGenerationSingleColor()
void KisGbrBrushTest::testMaskGenerationDevColor()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "brush.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "brush.gbr"));
brush->load();
Q_ASSERT(brush->valid());
const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8();
......@@ -86,7 +86,7 @@ void KisGbrBrushTest::testMaskGenerationDevColor()
brush->mask(fdev, dev, KisDabShape(), info);
QPoint errpoint;
QImage result = QImage(QString(FILES_DATA_DIR) + QDir::separator() + "result_brush_4.png");
QImage result = QImage(QString(FILES_DATA_DIR) + '/' + "result_brush_4.png");
QImage image = fdev->convertToQImage(0);
if (!TestUtil::compareQImages(errpoint, image, result)) {
image.save("kis_gbr_brush_test_4.png");
......@@ -96,7 +96,7 @@ void KisGbrBrushTest::testMaskGenerationDevColor()
void KisGbrBrushTest::testImageGeneration()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "testing_brush_512_bars.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "testing_brush_512_bars.gbr"));
bool res = brush->load();
Q_UNUSED(res);
Q_ASSERT(res);
......@@ -131,7 +131,7 @@ void KisGbrBrushTest::testImageGeneration()
void KisGbrBrushTest::benchmarkPyramidCreation()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "testing_brush_512_bars.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "testing_brush_512_bars.gbr"));
brush->load();
QVERIFY(!brush->brushTipImage().isNull());
......@@ -143,7 +143,7 @@ void KisGbrBrushTest::benchmarkPyramidCreation()
void KisGbrBrushTest::benchmarkScaling()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "testing_brush_512_bars.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "testing_brush_512_bars.gbr"));
brush->load();
QVERIFY(!brush->brushTipImage().isNull());
qsrand(1);
......@@ -167,7 +167,7 @@ void KisGbrBrushTest::benchmarkScaling()
void KisGbrBrushTest::benchmarkRotation()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "testing_brush_512_bars.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "testing_brush_512_bars.gbr"));
brush->load();
QVERIFY(!brush->brushTipImage().isNull());
qsrand(1);
......@@ -183,7 +183,7 @@ void KisGbrBrushTest::benchmarkRotation()
void KisGbrBrushTest::benchmarkMaskScaling()
{
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + QDir::separator() + "testing_brush_512_bars.gbr"));
QScopedPointer<KisGbrBrush> brush(new KisGbrBrush(QString(FILES_DATA_DIR) + '/' + "testing_brush_512_bars.gbr"));
brush->load();
QVERIFY(!brush->brushTipImage().isNull());
qsrand(1);
......
......@@ -96,7 +96,7 @@ inline void KisImagePipeBrushTest::checkConsistency(KisImagePipeBrush *brush)
void KisImagePipeBrushTest::testLoading()
{
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + QDir::separator() + "C_Dirty_Spot.gih"));
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + '/' + "C_Dirty_Spot.gih"));
brush->load();
QVERIFY(brush->valid());
......@@ -105,7 +105,7 @@ void KisImagePipeBrushTest::testLoading()
void KisImagePipeBrushTest::testChangingBrushes()
{
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + QDir::separator() + "C_Dirty_Spot.gih"));
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + '/' + "C_Dirty_Spot.gih"));
brush->load();
QVERIFY(brush->valid());
......@@ -151,7 +151,7 @@ void checkIncrementalPainting(KisBrush *brush, const QString &prefix)
void KisImagePipeBrushTest::testSimpleDabApplication()
{
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + QDir::separator() + "C_Dirty_Spot.gih"));
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + '/' + "C_Dirty_Spot.gih"));
brush->load();
QVERIFY(brush->valid());
......@@ -161,7 +161,7 @@ void KisImagePipeBrushTest::testSimpleDabApplication()
void KisImagePipeBrushTest::testColoredDab()
{
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + QDir::separator() + "G_Sparks.gih"));
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + '/' + "G_Sparks.gih"));
brush->load();
QVERIFY(brush->valid());
......@@ -196,7 +196,7 @@ void KisImagePipeBrushTest::testColoredDab()
void KisImagePipeBrushTest::testColoredDabWash()
{
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + QDir::separator() + "G_Sparks.gih"));
QScopedPointer<KisImagePipeBrush> brush(new KisImagePipeBrush(QString(FILES_DATA_DIR) + '/' + "G_Sparks.gih"));
brush->load();
QVERIFY(brush->valid());
......
......@@ -178,9 +178,9 @@ QString SvgLoadingContext::relativeFilePath(const QString &href)
QString result = href;
if (!gc->xmlBaseDir.isEmpty()) {
result = gc->xmlBaseDir + QDir::separator() + href;
result = gc->xmlBaseDir + '/' + href;
} else if (!d->initialXmlBaseDir.isEmpty()) {
result = d->initialXmlBaseDir + QDir::separator() + href;
result = d->initialXmlBaseDir + '/' + href;
}
return QDir::cleanPath(result);
......
......@@ -196,7 +196,7 @@ void SvgParser::setXmlBaseDir(const QString &baseDir)
setFileFetcher(
[this](const QString &name) {
const QString fileName = m_context.xmlBaseDir() + QDir::separator() + name;
const QString fileName = m_context.xmlBaseDir() + '/' + name;
QFile file(fileName);
if (!file.exists()) {
return QByteArray();
......
......@@ -247,7 +247,7 @@ QString KisImageConfig::safelyGetWritableTempLocation(const QString &suffix, con
// furthermore, this is just a default and swapDir can always be configured
// to another location.
QString swap = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QDir::separator() + suffix;
QString swap = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + '/' + suffix;
#else
Q_UNUSED(suffix);
QString swap = QDir::tempPath();
......@@ -275,7 +275,7 @@ QString KisImageConfig::safelyGetWritableTempLocation(const QString &suffix, con
* (yes, there is a hacky-global-variable workaround, but let's be safe)
*/
QTemporaryFile tempFile;
tempFile.setFileTemplate(location + QDir::separator() + "krita_test_swap_location");
tempFile.setFileTemplate(location + '/' + "krita_test_swap_location");
if (tempFile.open() && !tempFile.fileName().isEmpty()) {
chosenLocation = location;
break;
......
......@@ -287,7 +287,7 @@ void KisAslParserTest::testASLWriter()
void KisAslParserTest::testParserWithPatterns()
{
QDir dir(QString(FILES_DATA_DIR) + QDir::separator() + "testset");
QDir dir(QString(FILES_DATA_DIR) + '/' + "testset");
QFileInfoList files = dir.entryInfoList(QStringList() << "*.asl", QDir::Files);
......
......@@ -64,9 +64,9 @@ void KisAsyncMergerTest::testMerger()
const KoColorSpace * colorSpace = KoColorSpaceRegistry::instance()->rgb8();
KisImageSP image = new KisImage(0, 640, 441, colorSpace, "merger test");
QImage sourceImage1(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage sourceImage2(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage referenceProjection(QString(FILES_DATA_DIR) + QDir::separator() + "merged_hakonepa.png");
QImage sourceImage1(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage sourceImage2(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
QImage referenceProjection(QString(FILES_DATA_DIR) + '/' + "merged_hakonepa.png");
KisPaintDeviceSP device1 = new KisPaintDevice(colorSpace);
KisPaintDeviceSP device2 = new KisPaintDevice(colorSpace);
......@@ -127,7 +127,7 @@ void KisAsyncMergerTest::testMerger()
QVERIFY(rootLayer->exactBounds() == image->bounds());
QImage resultProjection = rootLayer->projection()->convertToQImage(0);
resultProjection.save(QString(FILES_OUTPUT_DIR) + QDir::separator() + "actual_merge_result.png");
resultProjection.save(QString(FILES_OUTPUT_DIR) + '/' + "actual_merge_result.png");
QPoint pt;
QVERIFY(TestUtil::compareQImages(pt, resultProjection, referenceProjection, 5, 0, 0));
}
......@@ -153,7 +153,7 @@ void KisAsyncMergerTest::debugObligeChild()
const KoColorSpace * colorSpace = KoColorSpaceRegistry::instance()->rgb8();
KisImageSP image = new KisImage(0, 640, 441, colorSpace, "merger test");
QImage sourceImage1(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage sourceImage1(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
KisPaintDeviceSP device1 = new KisPaintDevice(colorSpace);
device1->convertFromQImage(sourceImage1, 0, 0, 0);
......@@ -276,7 +276,7 @@ void KisAsyncMergerTest::testSubgraphingWithoutUpdatingParent()
image->initialRefreshGraph();
QImage refImage(QString(FILES_DATA_DIR) + QDir::separator() + "subgraphing_without_updating.png");
QImage refImage(QString(FILES_DATA_DIR) + '/' + "subgraphing_without_updating.png");
{
QImage resultImage = image->projection()->convertToQImage(0);
......
......@@ -112,7 +112,7 @@ void printPixel(QString prefix, int pixelSize, quint8 *data) {
void KisConvolutionPainterTest::testIdentityConvolution()
{
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
KisDefaultBoundsBaseSP bounds = new TestUtil::TestingTimedDefaultBounds(qimage.rect());
......@@ -281,7 +281,7 @@ void KisConvolutionPainterTest::testAsymmSkipAlpha()
// #include <valgrind/callgrind.h>
void KisConvolutionPainterTest::benchmarkConvolution()
{
QImage referenceImage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage referenceImage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QRect imageRect(QPoint(), referenceImage.size());
KisPaintDeviceSP dev = new KisPaintDevice(KoColorSpaceRegistry::instance()->rgb8());
......
......@@ -63,7 +63,7 @@ void KisCsConversionTest::testColorSpaceConversion()
QList<const KoColorSpace*> colorSpaces = KoColorSpaceRegistry::instance()->allColorSpaces(KoColorSpaceRegistry::AllColorSpaces, KoColorSpaceRegistry::OnlyDefaultProfile);
int failedColorSpaces = 0;
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "tile.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "tile.png");
Q_FOREACH (const KoColorSpace * srcCs, colorSpaces) {
Q_FOREACH (const KoColorSpace * dstCs, colorSpaces) {
......
......@@ -45,8 +45,8 @@ void KisFilterMaskTest::testProjectionNotSelected()
KisPaintLayerSP layer = p.layer;
KisPaintDeviceSP projection = layer->paintDevice();
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
projection->convertFromQImage(qimage, 0, 0, 0);
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
......@@ -80,8 +80,8 @@ void KisFilterMaskTest::testProjectionSelected()
KisPaintLayerSP layer = p.layer;
KisPaintDeviceSP projection = layer->paintDevice();
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
projection->convertFromQImage(qimage, 0, 0, 0);
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
......
......@@ -64,8 +64,8 @@ void KisFilterTest::testWithProgressUpdater()
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
KisPaintDeviceSP dev = new KisPaintDevice(cs);
dev->convertFromQImage(qimage, 0, 0, 0);
dev->setDefaultBounds(new TestUtil::TestingTimedDefaultBounds(dev->exactBounds()));
......@@ -93,8 +93,8 @@ void KisFilterTest::testSingleThreaded()
{
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
KisPaintDeviceSP dev = new KisPaintDevice(cs);
dev->convertFromQImage(qimage, 0, 0, 0);
dev->setDefaultBounds(new TestUtil::TestingTimedDefaultBounds(dev->exactBounds()));
......@@ -118,8 +118,8 @@ void KisFilterTest::testDifferentSrcAndDst()
{
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
QImage qimage(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + QDir::separator() + "inverted_hakonepa.png");
QImage qimage(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
QImage inverted(QString(FILES_DATA_DIR) + '/' + "inverted_hakonepa.png");
KisPaintDeviceSP src = new KisPaintDevice(cs);
KisPaintDeviceSP dst = new KisPaintDevice(cs);
KisSelectionSP sel = new KisSelection(new KisSelectionDefaultBounds(src));
......
......@@ -80,7 +80,7 @@ void logFailure(const QString & reason, const KoColorSpace * srcCs, const KoColo
void KisFixedPaintDeviceTest::testColorSpaceConversion()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "tile.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "tile.png");
const KoColorSpace* srcCs = KoColorSpaceRegistry::instance()->rgb8();
const KoColorSpace* dstCs = KoColorSpaceRegistry::instance()->lab16();
KisFixedPaintDeviceSP dev = new KisFixedPaintDevice(srcCs);
......@@ -97,7 +97,7 @@ void KisFixedPaintDeviceTest::testColorSpaceConversion()
void KisFixedPaintDeviceTest::testRoundtripQImageConversion()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFixedPaintDeviceSP dev = new KisFixedPaintDevice(cs);
dev->convertFromQImage(image, 0);
......@@ -114,7 +114,7 @@ void KisFixedPaintDeviceTest::testRoundtripQImageConversion()
void KisFixedPaintDeviceTest::testBltFixed()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "hakonepa.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFixedPaintDeviceSP fdev = new KisFixedPaintDevice(cs);
fdev->convertFromQImage(image, 0);
......@@ -140,7 +140,7 @@ void KisFixedPaintDeviceTest::testBltFixedOpacity()
{
// blt a semi-transparent image on a white paint device
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa_transparent.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "hakonepa_transparent.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFixedPaintDeviceSP fdev = new KisFixedPaintDevice(cs);
fdev->convertFromQImage(image, 0);
......@@ -151,7 +151,7 @@ void KisFixedPaintDeviceTest::testBltFixedOpacity()
gc.bltFixed(QPoint(0, 0), fdev, image.rect());
QImage result = dev->convertToQImage(0, 0, 0, 640, 441);
QImage checkResult(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa_transparent_result.png");
QImage checkResult(QString(FILES_DATA_DIR) + '/' + "hakonepa_transparent_result.png");
QPoint errpoint;
if (!TestUtil::compareQImages(errpoint, checkResult, result, 1)) {
......@@ -216,7 +216,7 @@ void KisFixedPaintDeviceTest::testFill()
void KisFixedPaintDeviceTest::testBltFixedSmall()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "fixed_blit_small.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "fixed_blit_small.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFixedPaintDeviceSP fdev = new KisFixedPaintDevice(cs);
fdev->convertFromQImage(image, 0);
......@@ -239,7 +239,7 @@ void KisFixedPaintDeviceTest::testBltFixedSmall()
void KisFixedPaintDeviceTest::testBltPerformance()
{
QImage image(QString(FILES_DATA_DIR) + QDir::separator() + "hakonepa_transparent.png");
QImage image(QString(FILES_DATA_DIR) + '/' + "hakonepa_transparent.png");
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFixedPaintDeviceSP fdev = new KisFixedPaintDevice(cs);
fdev->convertFromQImage(image, 0);
......
Supports Markdown
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