summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-10-28 07:43:32 +0100
committerMontel Laurent <[email protected]>2015-10-28 07:43:32 +0100
commit972d7040c2b6923962312366579f8c5dddac6f8f (patch)
tree4e096dcd4ce9385f26166a8c78a443361c7296f9
parenta0415555625bf91253de165c5f09a01d7dd8ae87 (diff)
Fix string
-rw-r--r--src/composer-ng/autotests/richtextcomposertest.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/composer-ng/autotests/richtextcomposertest.cpp b/src/composer-ng/autotests/richtextcomposertest.cpp
index 6d35c6b..3ab708f 100644
--- a/src/composer-ng/autotests/richtextcomposertest.cpp
+++ b/src/composer-ng/autotests/richtextcomposertest.cpp
@@ -247,23 +247,23 @@ void RichTextComposerTest::testEnter_data()
QTest::addColumn<QString>("expectedText");
QTest::addColumn<int>("cursorPos");
- QTest::newRow("") << QString::fromLatin1("> Hello World")
- << QString::fromLatin1("> Hello \n> World")
+ QTest::newRow("") << QLatin1String("> Hello World")
+ << QLatin1String("> Hello \n> World")
<< 8;
- QTest::newRow("") << QString::fromLatin1("Hello World")
- << QString::fromLatin1("Hello \nWorld")
+ QTest::newRow("") << QLatin1String("Hello World")
+ << QLatin1String("Hello \nWorld")
<< 6;
- QTest::newRow("") << QString::fromLatin1("> Hello World")
- << QString::fromLatin1("> Hello World\n")
+ QTest::newRow("") << QLatin1String("> Hello World")
+ << QLatin1String("> Hello World\n")
<< 13;
- QTest::newRow("") << QString::fromLatin1(">Hello World")
- << QString::fromLatin1(">Hello \n>World")
+ QTest::newRow("") << QLatin1String(">Hello World")
+ << QLatin1String(">Hello \n>World")
<< 7;
- QTest::newRow("") << QString::fromLatin1("> > Hello World")
- << QString::fromLatin1("> > Hello \n> > World")
+ QTest::newRow("") << QLatin1String("> > Hello World")
+ << QLatin1String("> > Hello \n> > World")
<< 10;
- QTest::newRow("") << QString::fromLatin1("| | Hello World")
- << QString::fromLatin1("| | Hello \n| | World")
+ QTest::newRow("") << QLatin1String("| | Hello World")
+ << QLatin1String("| | Hello \n| | World")
<< 10;
}
@@ -379,34 +379,34 @@ void RichTextComposerTest::testDeleteLine_data()
QTest::addColumn<QString>("expectedText");
QTest::addColumn<int>("cursorPos");
- QTest::newRow("") << QString::fromLatin1("line1\nline2\nline3")
- << QString::fromLatin1("line1\nline3")
+ QTest::newRow("") << QLatin1String("line1\nline2\nline3")
+ << QLatin1String("line1\nline3")
<< 6;
- QTest::newRow("") << QString::fromLatin1("line1\nline2\nline3")
- << QString::fromLatin1("line2\nline3")
+ QTest::newRow("") << QLatin1String("line1\nline2\nline3")
+ << QLatin1String("line2\nline3")
<< 5;
- QTest::newRow("") << QString::fromLatin1("line1\nline2\nline3")
- << QString::fromLatin1("line1\nline3")
+ QTest::newRow("") << QLatin1String("line1\nline2\nline3")
+ << QLatin1String("line1\nline3")
<< 11;
- QTest::newRow("") << QString::fromLatin1("line1\nline2\nline3")
- << QString::fromLatin1("line2\nline3")
+ QTest::newRow("") << QLatin1String("line1\nline2\nline3")
+ << QLatin1String("line2\nline3")
<< 0;
- QTest::newRow("") << QString::fromLatin1("line1\nline2\nline3")
- << QString::fromLatin1("line1\nline2")
+ QTest::newRow("") << QLatin1String("line1\nline2\nline3")
+ << QLatin1String("line1\nline2")
<< 17;
- QTest::newRow("") << QString::fromLatin1("line1")
- << QString::fromLatin1("")
+ QTest::newRow("") << QLatin1String("line1")
+ << QLatin1String("")
<< 0;
- QTest::newRow("") << QString::fromLatin1("line1")
- << QString::fromLatin1("")
+ QTest::newRow("") << QLatin1String("line1")
+ << QLatin1String("")
<< 5;
// Now, test deletion with word wrapping. The line with the Ms is so long that it will get wrapped
- QTest::newRow("") << QString::fromLatin1("line1\nMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
- << QString::fromLatin1("line1\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
+ QTest::newRow("") << QLatin1String("line1\nMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
+ << QLatin1String("line1\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
<< 6;
- QTest::newRow("") << QString::fromLatin1("line1\nMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
- << QString::fromLatin1("line1\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
+ QTest::newRow("") << QLatin1String("line1\nMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
+ << QLatin1String("line1\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nline3")
<< 13;
}
@@ -444,11 +444,11 @@ void RichTextComposerTest::testLoadImage()
edit.setHtml(QStringLiteral("Bla<img src=\"folder-new.png\">Bla"));
// First try to load an image with a name that doesn't match, it should fail
- edit.composerControler()->composerImages()->loadImage(image1, QString::fromLatin1("doesntmatch"), QString::fromLatin1("folder-new"));
+ edit.composerControler()->composerImages()->loadImage(image1, QStringLiteral("doesntmatch"), QStringLiteral("folder-new"));
QVERIFY(!edit.document()->resource(QTextDocument::ImageResource, QUrl(QStringLiteral("folder-new"))).isValid());
// Now, load the image for real
- edit.composerControler()->composerImages()->loadImage(image1, QString::fromLatin1("folder-new.png"), QString::fromLatin1("folder-new"));
+ edit.composerControler()->composerImages()->loadImage(image1, QStringLiteral("folder-new.png"), QStringLiteral("folder-new"));
QVERIFY(edit.document()->resource(QTextDocument::ImageResource, QUrl(QStringLiteral("folder-new"))).isValid());
// New test with a new textedit (so that we don't use the cached resources
@@ -456,7 +456,7 @@ void RichTextComposerTest::testLoadImage()
KPIMTextEdit::RichTextComposer edit2;
edit2.createActions(new KActionCollection(this));
edit2.setHtml(QStringLiteral("<img src=\"folder-new.png\"><img src=\"folder-new.png\">"));
- edit2.composerControler()->composerImages()->loadImage(image1, QString::fromLatin1("folder-new.png"), QString::fromLatin1("folder-new"));
+ edit2.composerControler()->composerImages()->loadImage(image1, QStringLiteral("folder-new.png"), QStringLiteral("folder-new"));
QVERIFY(edit.document()->resource(QTextDocument::ImageResource, QUrl(QStringLiteral("folder-new"))).isValid());
QCOMPARE(edit.composerControler()->composerImages()->embeddedImages().size(), 1);
}