Commit 466eb796 authored by Laurent Montel's avatar Laurent Montel

Use QStringLiteral

parent 8805760c
......@@ -33,7 +33,7 @@ private:
void AddRemoveAnnotationTest::initTestCase()
{
Okular::SettingsCore::instance( "addannotationtest" );
Okular::SettingsCore::instance( QStringLiteral("addannotationtest") );
m_document = new Okular::Document( 0 );
}
......@@ -59,11 +59,11 @@ void AddRemoveAnnotationTest::testAddAnnotations()
// Create two distinct text annotations
Okular::Annotation *annot1 = new Okular::TextAnnotation();
annot1->setBoundingRectangle( Okular::NormalizedRect( 0.1, 0.1, 0.15, 0.15 ) );
annot1->setContents( "annot contents" );
annot1->setContents( QStringLiteral("annot contents") );
Okular::Annotation *annot2 = new Okular::TextAnnotation();
annot2->setBoundingRectangle( Okular::NormalizedRect( 0.2, 0.2, 0.3, 0.4 ) );
annot2->setContents( "annot contents" );
annot2->setContents( QStringLiteral("annot contents") );
// The two annotations shold have different properties XML strings
QVERIFY( TestingUtils::getAnnotationXml( annot1 ) != TestingUtils::getAnnotationXml( annot2 ) );
......@@ -123,7 +123,7 @@ void AddRemoveAnnotationTest::testAddAnnotationUndoWithRotate_Bug318091()
{
Okular::Annotation *annot = new Okular::TextAnnotation();
annot->setBoundingRectangle( Okular::NormalizedRect( 0.1, 0.1, 0.15, 0.15 ) );
annot->setContents( "annot contents" );
annot->setContents( QStringLiteral("annot contents") );
m_document->addPageAnnotation( 0, annot );
QString origAnnotXml = TestingUtils::getAnnotationXml( annot );
......@@ -149,11 +149,11 @@ void AddRemoveAnnotationTest::testRemoveAnnotations()
// Create two distinct text annotations
Okular::Annotation *annot1 = new Okular::TextAnnotation();
annot1->setBoundingRectangle( Okular::NormalizedRect( 0.1, 0.1, 0.15, 0.15 ) );
annot1->setContents( "annot contents" );
annot1->setContents( QStringLiteral("annot contents") );
Okular::Annotation *annot2 = new Okular::TextAnnotation();
annot2->setBoundingRectangle( Okular::NormalizedRect( 0.2, 0.2, 0.3, 0.4 ) );
annot2->setContents( "annot contents" );
annot2->setContents( QStringLiteral("annot contents") );
// Add annot1 and annot2 to document
m_document->addPageAnnotation( 0, annot1 );
......
......@@ -38,7 +38,7 @@ private:
void AnnotationTest::initTestCase()
{
Okular::SettingsCore::instance( "annotationtest" );
Okular::SettingsCore::instance( QStringLiteral("annotationtest") );
m_document = new Okular::Document( 0 );
const QString testFile = KDESRCDIR "data/file1.pdf";
QMimeDatabase db;
......
......@@ -30,7 +30,7 @@ class DocumentTest
// is enqueued/running
void DocumentTest::testCloseDuringRotationJob()
{
Okular::SettingsCore::instance( "documenttest" );
Okular::SettingsCore::instance( QStringLiteral("documenttest") );
Okular::Document *m_document = new Okular::Document( 0 );
const QString testFile = KDESRCDIR "data/file1.pdf";
QMimeDatabase db;
......
This diff is collapsed.
......@@ -54,7 +54,7 @@ private:
void EditFormsTest::initTestCase()
{
Okular::SettingsCore::instance( "editformstest" );
Okular::SettingsCore::instance( QStringLiteral("editformstest") );
m_document = new Okular::Document( 0 );
}
......@@ -244,21 +244,21 @@ void EditFormsTest::testComboEditForm()
// Initially no choice is selected
QCOMPARE( m_comboEdit->currentChoices().length(), 0 );
QCOMPARE( m_comboEdit->editChoice(), QString( "" ) );
QCOMPARE( m_comboEdit->editChoice(), QLatin1String( "" ) );
// Select first choice
m_document->editFormCombo( 0, m_comboEdit, "combo1", 0, 0, 0);
m_document->editFormCombo( 0, m_comboEdit, QStringLiteral("combo1"), 0, 0, 0);
QCOMPARE( m_comboEdit->currentChoices().length(), 1 );
QCOMPARE( m_comboEdit->currentChoices()[0], 0 );
QCOMPARE( m_comboEdit->editChoice(), QString( "" ) );
QCOMPARE( m_comboEdit->editChoice(), QLatin1String( "" ) );
QVERIFY( m_document->canUndo() );
QVERIFY( !m_document->canRedo() );
// Select third choice
m_document->editFormCombo( 0, m_comboEdit, "combo3", 0, 0, 0);
m_document->editFormCombo( 0, m_comboEdit, QStringLiteral("combo3"), 0, 0, 0);
QCOMPARE( m_comboEdit->currentChoices().length(), 1 );
QCOMPARE( m_comboEdit->currentChoices()[0], 2 );
QCOMPARE( m_comboEdit->editChoice(), QString( "" ) );
QCOMPARE( m_comboEdit->editChoice(), QLatin1String( "" ) );
QVERIFY( m_document->canUndo() );
QVERIFY( !m_document->canRedo() );
......@@ -277,7 +277,7 @@ void EditFormsTest::testComboEditForm()
QVERIFY( !m_document->canRedo() );
// Select a custom choice and verify that no predefined choices are selected
m_document->editFormCombo( 0, m_comboEdit, "comboEdit", 0, 0, 0);
m_document->editFormCombo( 0, m_comboEdit, QStringLiteral("comboEdit"), 0, 0, 0);
QCOMPARE( m_comboEdit->currentChoices().length(), 0 );
QCOMPARE( m_comboEdit->editChoice(), QString( "comboEdit" ) );
QVERIFY( m_document->canUndo() );
......@@ -389,17 +389,17 @@ void EditFormsTest::setRadioButtonStates( bool state1, bool state2, bool state3
void EditFormsTest::verifyTextForm( Okular::FormFieldText* form )
{
// Text in form is initially empty
QCOMPARE( form->text(), QString("") );
QCOMPARE( form->text(), QLatin1String("") );
// Insert the string "Hello" into the form
m_document->editFormText(0, form, QString("Hello"), 5, 0, 0);
m_document->editFormText(0, form, QStringLiteral("Hello"), 5, 0, 0);
QCOMPARE( form->text(), QString("Hello") );
QVERIFY( m_document->canUndo() );
QVERIFY( !m_document->canRedo() );
// Undo the insertion and verify that form is empty again
m_document->undo();
QCOMPARE( form->text(), QString("") );
QCOMPARE( form->text(), QLatin1String("") );
QVERIFY( !m_document->canUndo() );
QVERIFY( m_document->canRedo() );
......@@ -410,12 +410,12 @@ void EditFormsTest::verifyTextForm( Okular::FormFieldText* form )
QVERIFY( !m_document->canRedo() );
// Type "_World" after "Hello"
m_document->editFormText(0, form, QString("Hello_"), 6, 5, 5);
m_document->editFormText(0, form, QString("Hello_W"), 7, 6, 6);
m_document->editFormText(0, form, QString("Hello_Wo"), 8, 7, 7);
m_document->editFormText(0, form, QString("Hello_Wor"), 9, 8, 8);
m_document->editFormText(0, form, QString("Hello_Worl"), 10, 9, 9);
m_document->editFormText(0, form, QString("Hello_World"), 11, 10, 10);
m_document->editFormText(0, form, QStringLiteral("Hello_"), 6, 5, 5);
m_document->editFormText(0, form, QStringLiteral("Hello_W"), 7, 6, 6);
m_document->editFormText(0, form, QStringLiteral("Hello_Wo"), 8, 7, 7);
m_document->editFormText(0, form, QStringLiteral("Hello_Wor"), 9, 8, 8);
m_document->editFormText(0, form, QStringLiteral("Hello_Worl"), 10, 9, 9);
m_document->editFormText(0, form, QStringLiteral("Hello_World"), 11, 10, 10);
// Verify that character insertion operations were merged together into a single undo command
m_document->undo();
......@@ -425,7 +425,7 @@ void EditFormsTest::verifyTextForm( Okular::FormFieldText* form )
// Verify that one more undo gets us back to the original state (empty form)
m_document->undo();
QCOMPARE( form->text(), QString("") );
QCOMPARE( form->text(), QLatin1String("") );
QVERIFY( !m_document->canUndo() );
QVERIFY( m_document->canRedo() );
}
......
......@@ -109,7 +109,7 @@ Shell *findShell(Shell *ignore = 0)
void MainShellTest::initTestCase()
{
// Don't pollute people's okular settings
Okular::Settings::instance( "mainshelltest" );
Okular::Settings::instance( QStringLiteral("mainshelltest") );
// Register in bus as okular
QDBusConnectionInterface *bus = QDBusConnection::sessionBus().interface();
......@@ -134,9 +134,9 @@ void MainShellTest::init()
// Clean docdatas
QList<QUrl> urls;
urls << QUrl::fromUserInput("file://" KDESRCDIR "data/file1.pdf");
urls << QUrl::fromUserInput("file://" KDESRCDIR "data/tocreload.pdf");
urls << QUrl::fromUserInput("file://" KDESRCDIR "data/contents.epub");
urls << QUrl::fromUserInput(QStringLiteral("file://" KDESRCDIR "data/file1.pdf"));
urls << QUrl::fromUserInput(QStringLiteral("file://" KDESRCDIR "data/tocreload.pdf"));
urls << QUrl::fromUserInput(QStringLiteral("file://" KDESRCDIR "data/contents.epub"));
foreach (const QUrl &url, urls)
{
......@@ -176,8 +176,8 @@ void MainShellTest::testShell_data()
file1AndToc << KDESRCDIR "data/tocreload.pdf";
const QString tocReload = KDESRCDIR "data/tocreload.pdf";
const QString optionsPage2 = ShellUtils::serializeOptions(false, false, false, false, "2");
const QString optionsPage2Presentation = ShellUtils::serializeOptions(true, false, false, false, "2");
const QString optionsPage2 = ShellUtils::serializeOptions(false, false, false, false, QStringLiteral("2"));
const QString optionsPage2Presentation = ShellUtils::serializeOptions(true, false, false, false, QStringLiteral("2"));
const QString optionsPrint = ShellUtils::serializeOptions(false, true, false, false, QString());
const QString optionsUnique = ShellUtils::serializeOptions(false, false, true, false, QString());
......@@ -289,7 +289,7 @@ void MainShellTest::testShell()
QStringList args;
args << externalProcessPath;
if (unique)
args << "-unique";
args << QStringLiteral("-unique");
if (externalProcessExpectedPage != 0)
args << QStringLiteral("-page") << QString::number(externalProcessExpectedPage + 1);
if (externalProcessExpectPresentation)
......@@ -375,7 +375,7 @@ void ClosePrintDialogHelper::closePrintDialog()
Shell *s = findShell();
QPrintDialog *dialog = s->findChild<QPrintDialog*>();
if (!dialog) {
QTimer::singleShot(0, this, SLOT(closePrintDialog()));
QTimer::singleShot(0, this, &ClosePrintDialogHelper::closePrintDialog);
return;
}
QVERIFY(dialog);
......@@ -431,7 +431,7 @@ void MainShellTest::testFileRemembersPagePosition()
QStringList args;
args << paths[0];
if (mode == 2)
args << "-unique";
args << QStringLiteral("-unique");
p.start(OKULAR_BINARY, args);
p.waitForStarted();
QCOMPARE(p.state(), QProcess::Running);
......@@ -456,7 +456,7 @@ void MainShellTest::test2FilesError_data()
QTest::newRow("startInPresentation") << ShellUtils::serializeOptions(true, false, false, false, QString());
QTest::newRow("showPrintDialog") << ShellUtils::serializeOptions(false, true, false, false, QString());
QTest::newRow("unique") << ShellUtils::serializeOptions(false, false, true, false, QString());
QTest::newRow("pageNumger") << ShellUtils::serializeOptions(false, false, false, false, "3");
QTest::newRow("pageNumger") << ShellUtils::serializeOptions(false, false, false, false, QStringLiteral("3"));
}
void MainShellTest::test2FilesError()
......@@ -544,7 +544,7 @@ void MainShellTest::testSessionRestore()
// Wait for shells to delete themselves. QTest::qWait doesn't do deferred
// deletions so we'll set up a full event loop to do that.
QEventLoop eventLoop;
QTimer::singleShot( 100, &eventLoop, SLOT(quit()) );
QTimer::singleShot( 100, &eventLoop, &QEventLoop::quit );
eventLoop.exec( QEventLoop::AllEvents );
shells = getShells();
QVERIFY( shells.isEmpty() );
......
......@@ -40,7 +40,7 @@ private:
void ModifyAnnotationPropertiesTest::initTestCase()
{
Okular::SettingsCore::instance( "editannotationcontentstest" );
Okular::SettingsCore::instance( QStringLiteral("editannotationcontentstest") );
m_document = new Okular::Document( 0 );
}
......@@ -63,8 +63,8 @@ void ModifyAnnotationPropertiesTest::init()
// Create two distinct text annotations
m_annot1 = new Okular::TextAnnotation();
m_annot1->setBoundingRectangle( Okular::NormalizedRect( 0.1, 0.1, 0.15, 0.15 ) );
m_annot1->setContents( QString( "Hello, World" ) );
m_annot1->setAuthor( "Jon Mease" );
m_annot1->setContents( QStringLiteral( "Hello, World" ) );
m_annot1->setAuthor( QStringLiteral("Jon Mease") );
m_annot1->style().setColor( RED );
m_annot1->style().setWidth( 4.0 );
m_document->addPageAnnotation( 0, m_annot1 );
......
......@@ -124,14 +124,14 @@ void PartTest::testFowardPDF()
// Create temp dir named like this: ${system temp dir}/${random string}/${dir}
const QTemporaryDir tempDir;
const QDir workDir(QDir(tempDir.path()).filePath(dir));
workDir.mkpath(".");
workDir.mkpath(QStringLiteral("."));
QFile f(KDESRCDIR "data/synctextest.tex");
const QString texDestination = workDir.path() + "/synctextest.tex";
QVERIFY(f.copy(texDestination));
QProcess process;
process.setWorkingDirectory(workDir.path());
process.start("pdflatex", QStringList() << "-synctex=1" << "-interaction=nonstopmode" << texDestination);
process.start(QStringLiteral("pdflatex"), QStringList() << QStringLiteral("-synctex=1") << QStringLiteral("-interaction=nonstopmode") << texDestination);
process.waitForFinished();
const QString pdfResult = workDir.path() + "/synctextest.pdf";
......
......@@ -59,40 +59,40 @@ void ShellTest::testUrlArgs_data()
QTest::newRow( "foo.pdf, exist" )
<< "foo.pdf"
<< true
<< makeUrlFromCwd( "foo.pdf" );
<< makeUrlFromCwd( QStringLiteral("foo.pdf") );
QTest::newRow( "foo.pdf, !exist" )
<< "foo.pdf"
<< false
<< makeUrlFromCwd( "foo.pdf" );
<< makeUrlFromCwd( QStringLiteral("foo.pdf") );
QTest::newRow( "foo#bar.pdf, !exist" )
<< "foo#bar.pdf"
<< false
<< makeUrlFromCwd( "foo#bar.pdf" );
<< makeUrlFromCwd( QStringLiteral("foo#bar.pdf") );
QTest::newRow( "foo.pdf#anchor, !exist" )
<< "foo.pdf#anchor"
<< false
<< makeUrlFromCwd( "foo.pdf", "anchor" );
<< makeUrlFromCwd( QStringLiteral("foo.pdf"), QStringLiteral("anchor") );
QTest::newRow( "#207461" )
<< "file:///tmp/file%20with%20spaces.pdf"
<< true
<< QUrl( "file:///tmp/file%20with%20spaces.pdf" );
<< QUrl( QStringLiteral("file:///tmp/file%20with%20spaces.pdf") );
// non-local files
QTest::newRow( "http://kde.org/foo.pdf" )
<< "http://kde.org/foo.pdf"
<< true
<< QUrl( "http://kde.org/foo.pdf" );
<< QUrl( QStringLiteral("http://kde.org/foo.pdf") );
// make sure we don't have a fragment
QUrl hashInName( "http://kde.org" );
QUrl hashInName( QStringLiteral("http://kde.org") );
QVERIFY( hashInName.path().isEmpty() );
hashInName.setPath( "/foo#bar.pdf" );
hashInName.setPath( QStringLiteral("/foo#bar.pdf") );
QVERIFY( hashInName.fragment().isEmpty() );
QTest::newRow( "http://kde.org/foo#bar.pdf" )
<< "http://kde.org/foo#bar.pdf"
<< true
<< hashInName;
QUrl withAnchor( "http://kde.org/foo.pdf" );
withAnchor.setFragment( "anchor" );
QUrl withAnchor( QStringLiteral("http://kde.org/foo.pdf") );
withAnchor.setFragment( QStringLiteral("anchor") );
QTest::newRow( "http://kde.org/foo.pdf#anchor" )
<< "http://kde.org/foo.pdf#anchor"
<< true
......@@ -100,9 +100,9 @@ void ShellTest::testUrlArgs_data()
QTest::newRow( "#207461" )
<< "http://homepages.inf.ed.ac.uk/mef/file%20with%20spaces.pdf"
<< true
<< QUrl( "http://homepages.inf.ed.ac.uk/mef/file%20with%20spaces.pdf" );
QUrl openOnPage3 = QUrl( "http://itzsimpl.info/lectures/CG/L2-transformations.pdf" );
openOnPage3.setFragment( "3" );
<< QUrl( QStringLiteral("http://homepages.inf.ed.ac.uk/mef/file%20with%20spaces.pdf") );
QUrl openOnPage3 = QUrl( QStringLiteral("http://itzsimpl.info/lectures/CG/L2-transformations.pdf") );
openOnPage3.setFragment( QStringLiteral("3") );
QTest::newRow( "RR124738" )
<< "http://itzsimpl.info/lectures/CG/L2-transformations.pdf#3"
<< true
......
......@@ -66,7 +66,7 @@ private:
void TranslateAnnotationTest::initTestCase()
{
Okular::SettingsCore::instance( "editannotationcontentstest" );
Okular::SettingsCore::instance( QStringLiteral("editannotationcontentstest") );
m_document = new Okular::Document( 0 );
// translate m_annot1
......
......@@ -32,22 +32,22 @@ void UrlDetectTest::testURL_data()
{
QTest::addColumn<QString>( "selectedText" );
QTest::addColumn<QString>( "url" );
QTest::newRow( "1" ) << QString( "asdfhttp://okular.org" ) << QString();
QTest::newRow( "2" ) << QString( "google.com/index.php/" ) << QString();
QTest::newRow( "3" ) << QString( "http://google.com)" ) << QString();
QTest::newRow( "4" ) << QString( "https://okular.org" ) << QString( "https://okular.org" );
QTest::newRow( "5" ) << QString( "www.google.com" ) << QString( "http://www.google.com" );
QTest::newRow( "6" ) << QString( "asdf http://okular.kde.org/" ) << QString( "http://okular.kde.org/" );
QTest::newRow( "7" ) << QString( "http://www.example.com/wpstyle/?p=364" ) << QString( "http://www.example.com/wpstyle/?p=364" );
QTest::newRow( "8" ) << QString( "asdf http://okular.org fdsa" ) << QString( "http://okular.org" );
QTest::newRow( "9" ) << QString( "http://google.com/ø" ) << QString( "http://google.com/ø" );
QTest::newRow( "10" ) << QString( "http://www.wolframalpha.com/input/?i=Plot[%281%2Be^%28-%282%29v%29%29^%28-2%29+%2B+%282%29+%281%2Be^v%29^%28-2%29%2C+{t%2C-0.5%2C+0.5}]" ) << QString( "http://www.wolframalpha.com/input/?i=Plot[%281%2Be^%28-%282%29v%29%29^%28-2%29+%2B+%282%29+%281%2Be^v%29^%28-2%29%2C+{t%2C-0.5%2C+0.5}]" );
QTest::newRow( "11" ) << QString( "http://uid:pass@example.com:8080" ) << QString( "http://uid:pass@example.com:8080" );
QTest::newRow( "12" ) << QString( "www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf" ) << QString( "http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf" );
QTest::newRow( "13" ) << QString( "http://IISServer/nwind?template=<ROOTxmlns:sql=\"urn:schemas-microsoft-com:xml-sql\"><sql:query>SELECTTOP2*FROM[OrderDetails]WHEREUnitPrice%26lt;10FORXMLAUTO</sql:query></ROOT>" ) << QString( "http://IISServer/nwind?template=<ROOTxmlns:sql=\"urn:schemas-microsoft-com:xml-sql\"><sql:query>SELECTTOP2*FROM[OrderDetails]WHEREUnitPrice%26lt;10FORXMLAUTO</sql:query></ROOT>" );
QTest::newRow( "14" ) << QString( "https://www.example.com/foo/?bar=baz&inga=42&quux" ) << QString( "https://www.example.com/foo/?bar=baz&inga=42&quux" );
QTest::newRow( "15" ) << QString( "http://foo.bar/#tag" ) << QString( "http://foo.bar/#tag" );
QTest::newRow( "1" ) << QStringLiteral( "asdfhttp://okular.org" ) << QString();
QTest::newRow( "2" ) << QStringLiteral( "google.com/index.php/" ) << QString();
QTest::newRow( "3" ) << QStringLiteral( "http://google.com)" ) << QString();
QTest::newRow( "4" ) << QStringLiteral( "https://okular.org" ) << QStringLiteral( "https://okular.org" );
QTest::newRow( "5" ) << QStringLiteral( "www.google.com" ) << QStringLiteral( "http://www.google.com" );
QTest::newRow( "6" ) << QStringLiteral( "asdf http://okular.kde.org/" ) << QStringLiteral( "http://okular.kde.org/" );
QTest::newRow( "7" ) << QStringLiteral( "http://www.example.com/wpstyle/?p=364" ) << QStringLiteral( "http://www.example.com/wpstyle/?p=364" );
QTest::newRow( "8" ) << QStringLiteral( "asdf http://okular.org fdsa" ) << QStringLiteral( "http://okular.org" );
QTest::newRow( "9" ) << QStringLiteral( "http://google.com/ø" ) << QStringLiteral( "http://google.com/ø" );
QTest::newRow( "10" ) << QStringLiteral( "http://www.wolframalpha.com/input/?i=Plot[%281%2Be^%28-%282%29v%29%29^%28-2%29+%2B+%282%29+%281%2Be^v%29^%28-2%29%2C+{t%2C-0.5%2C+0.5}]" ) << QStringLiteral( "http://www.wolframalpha.com/input/?i=Plot[%281%2Be^%28-%282%29v%29%29^%28-2%29+%2B+%282%29+%281%2Be^v%29^%28-2%29%2C+{t%2C-0.5%2C+0.5}]" );
QTest::newRow( "11" ) << QStringLiteral( "http://uid:pass@example.com:8080" ) << QStringLiteral( "http://uid:pass@example.com:8080" );
QTest::newRow( "12" ) << QStringLiteral( "www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf" ) << QStringLiteral( "http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf" );
QTest::newRow( "13" ) << QStringLiteral( "http://IISServer/nwind?template=<ROOTxmlns:sql=\"urn:schemas-microsoft-com:xml-sql\"><sql:query>SELECTTOP2*FROM[OrderDetails]WHEREUnitPrice%26lt;10FORXMLAUTO</sql:query></ROOT>" ) << QStringLiteral( "http://IISServer/nwind?template=<ROOTxmlns:sql=\"urn:schemas-microsoft-com:xml-sql\"><sql:query>SELECTTOP2*FROM[OrderDetails]WHEREUnitPrice%26lt;10FORXMLAUTO</sql:query></ROOT>" );
QTest::newRow( "14" ) << QStringLiteral( "https://www.example.com/foo/?bar=baz&inga=42&quux" ) << QStringLiteral( "https://www.example.com/foo/?bar=baz&inga=42&quux" );
QTest::newRow( "15" ) << QStringLiteral( "http://foo.bar/#tag" ) << QStringLiteral( "http://foo.bar/#tag" );
}
}
......
......@@ -22,7 +22,7 @@ DlgAnnotations::DlgAnnotations( QWidget * parent )
WidgetAnnotTools * kcfg_AnnotationTools = new WidgetAnnotTools( dlg.annotToolsGroup );
dlg.annotToolsPlaceholder->addWidget( kcfg_AnnotationTools );
kcfg_AnnotationTools->setObjectName( "kcfg_AnnotationTools" );
kcfg_AnnotationTools->setObjectName( QStringLiteral("kcfg_AnnotationTools") );
KConfigDialogManager::changedMap()->insert( "WidgetAnnotTools" , SIGNAL(changed()) );
KConfigDialogManager::changedMap()->insert( QStringLiteral("WidgetAnnotTools") , SIGNAL(changed()) );
}
......@@ -40,7 +40,7 @@ void DlgGeneral::showEvent( QShowEvent * )
#if OKULAR_FORCE_DRM
m_dlg->kcfg_ObeyDRM->hide();
#else
if ( KAuthorized::authorize( "skip_drm" ) )
if ( KAuthorized::authorize( QStringLiteral("skip_drm") ) )
m_dlg->kcfg_ObeyDRM->show();
else
m_dlg->kcfg_ObeyDRM->hide();
......
......@@ -24,7 +24,7 @@ DlgPerformance::DlgPerformance( QWidget * parent )
labelFont.setBold( true );
m_dlg->descLabel->setFont( labelFont );
m_dlg->cpuLabel->setPixmap( BarIcon( "cpu", 32 ) );
m_dlg->cpuLabel->setPixmap( BarIcon( QStringLiteral("cpu"), 32 ) );
// m_dlg->memoryLabel->setPixmap( BarIcon( "kcmmemory", 32 ) ); // TODO: enable again when proper icon is available
connect(m_dlg->kcfg_MemoryLevel, &KButtonGroup::changed, this, &DlgPerformance::radioGroup_changed);
......
......@@ -27,9 +27,9 @@ DlgPresentation::DlgPresentation( QWidget * parent )
WidgetDrawingTools * kcfg_DrawingTools = new WidgetDrawingTools( m_dlg->annotationToolsGroupBox );
m_dlg->verticalLayout_4->addWidget( kcfg_DrawingTools );
kcfg_DrawingTools->setObjectName( "kcfg_DrawingTools" );
kcfg_DrawingTools->setObjectName( QStringLiteral("kcfg_DrawingTools") );
KConfigDialogManager::changedMap()->insert( "WidgetDrawingTools", SIGNAL(changed()) );
KConfigDialogManager::changedMap()->insert( QStringLiteral("WidgetDrawingTools"), SIGNAL(changed()) );
QStringList choices;
choices.append( i18nc( "@label:listbox The current screen, for the presentation mode", "Current Screen" ) );
......
This diff is collapsed.
......@@ -22,7 +22,7 @@
#include "dlgdebug.h"
PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton, Okular::EmbedMode embedMode )
: KConfigDialog( parent, "preferences", skeleton )
: KConfigDialog( parent, QStringLiteral("preferences"), skeleton )
{
setWindowModality( Qt::ApplicationModal );
......@@ -37,9 +37,9 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
m_debug = new DlgDebug( this );
#endif
addPage( m_general, i18n("General"), "okular", i18n("General Options") );
addPage( m_accessibility, i18n("Accessibility"), "preferences-desktop-accessibility", i18n("Accessibility Reading Aids") );
addPage( m_performance, i18n("Performance"), "preferences-system-performance", i18n("Performance Tuning") );
addPage( m_general, i18n("General"), QStringLiteral("okular"), i18n("General Options") );
addPage( m_accessibility, i18n("Accessibility"), QStringLiteral("preferences-desktop-accessibility"), i18n("Accessibility Reading Aids") );
addPage( m_performance, i18n("Performance"), QStringLiteral("preferences-system-performance"), i18n("Performance Tuning") );
if( embedMode == Okular::ViewerWidgetMode )
{
setWindowTitle( i18n("Configure Viewer") );
......@@ -49,16 +49,16 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
m_presentation = new DlgPresentation( this );
m_annotations = new DlgAnnotations( this );
m_editor = new DlgEditor( this );
addPage( m_presentation, i18n("Presentation"), "view-presentation",
addPage( m_presentation, i18n("Presentation"), QStringLiteral("view-presentation"),
i18n("Options for Presentation Mode") );
m_annotationsPage = addPage( m_annotations, i18n("Annotations"),
"draw-freehand", i18n("Annotation Options") );
addPage( m_editor, i18n("Editor"), "accessories-text-editor", i18n("Editor Options") );
QStringLiteral("draw-freehand"), i18n("Annotation Options") );
addPage( m_editor, i18n("Editor"), QStringLiteral("accessories-text-editor"), i18n("Editor Options") );
}
#ifdef OKULAR_DEBUG_CONFIGPAGE
addPage( m_debug, "Debug", "system-run", "Debug options" );
#endif
setHelp("configure", "okular");
setHelp(QStringLiteral("configure"), QStringLiteral("okular"));
}
void PreferencesDialog::switchToAnnotationsPage()
......
......@@ -58,7 +58,7 @@ QStringList WidgetAnnotTools::tools() const
// Set id
QDomElement toolElement = doc.documentElement();
toolElement.setAttribute( "id", i+1 );
toolElement.setAttribute( QStringLiteral("id"), i+1 );
// Remove old shortcut, if any
QDomNode oldShortcut = toolElement.elementsByTagName( QStringLiteral("shortcut") ).item( 0 );
......
......@@ -46,7 +46,7 @@ Action::~Action()
QString Action::actionTip() const
{
return "";
return QLatin1String("");
}
void Action::setNativeId( const QVariant &id )
......@@ -103,7 +103,7 @@ Action::ActionType GotoAction::actionType() const
QString GotoAction::actionTip() const
{
Q_D( const GotoAction );
return d->m_extFileName.isEmpty() ? ( d->m_vp.isValid() ? i18n( "Go to page %1", d->m_vp.pageNumber + 1 ) : "" ) :
return d->m_extFileName.isEmpty() ? ( d->m_vp.isValid() ? i18n( "Go to page %1", d->m_vp.pageNumber + 1 ) : QLatin1String("") ) :
i18n("Open external file");
}
......
This diff is collapsed.
......@@ -136,13 +136,13 @@ static inline QUrl urlForGroup(const KBookmark &group)
BookmarkManager::BookmarkManager( DocumentPrivate * document )
: QObject( document->m_parent ), d( new Private( this ) )
{
setObjectName( QLatin1String( "Okular::BookmarkManager" ) );
setObjectName( QStringLiteral( "Okular::BookmarkManager" ) );
d->document = document;
d->file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "okular/bookmarks.xml" ;
d->manager = KBookmarkManager::managerForFile( d->file, "okular" );
d->manager = KBookmarkManager::managerForFile( d->file, QStringLiteral("okular") );
d->manager->setEditorOptions( QGuiApplication::applicationDisplayName(), false );
d->manager->setUpdate( true );
connect( d->manager, SIGNAL(changed(QString,QString)),
......@@ -441,9 +441,9 @@ bool BookmarkManager::addBookmark(const QUrl &referurl, const Okular::DocumentVi
// if there's more than one bookmark per page, give the name '#p-n'
// where n is the index of this bookmark among the ones of its page.
if ( count > 0 )
newtitle = QString( "#%1-%2" ).arg( vp.pageNumber + 1 ).arg( count );
newtitle = QStringLiteral( "#%1-%2" ).arg( vp.pageNumber + 1 ).arg( count );
else
newtitle = QString( "#%1" ).arg( vp.pageNumber + 1 );
newtitle = QStringLiteral( "#%1" ).arg( vp.pageNumber + 1 );
}
else
newtitle = title;
......@@ -658,7 +658,7 @@ bool BookmarkManager::setPageBookmark( int page )
vp.pageNumber = page;
QUrl newurl = d->url;
newurl.setFragment(vp.toString(), QUrl::DecodedMode);
thebg.addBookmark( QString::fromLatin1( "#" ) + QString::number( vp.pageNumber + 1 ), newurl, QString() );
thebg.addBookmark( QLatin1String( "#" ) + QString::number( vp.pageNumber + 1 ), newurl, QString() );
added = true;
d->manager->emitChanged( thebg );
}
......
This diff is collapsed.
......@@ -234,21 +234,21 @@ EditTextCommand::EditTextCommand( const QString & newContents,
}
else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
newContentsLeftOfCursor() == oldContentsLeftOfCursor().left(oldContentsLeftOfCursor().length() - 1) &&
oldContentsLeftOfCursor().right(1) != "\n" )
oldContentsLeftOfCursor().right(1) != QLatin1String("\n") )
{
qCDebug(OkularCoreDebug) << "CharBackspace";
m_editType = CharBackspace;
}
else if ( newContentsLeftOfCursor() == oldContentsLeftOfCursor() &&
newContentsRightOfCursor() == oldContentsRightOfCursor().right(oldContentsRightOfCursor().length() - 1) &&
oldContentsRightOfCursor().left(1) != "\n" )
oldContentsRightOfCursor().left(1) != QLatin1String("\n") )
{
qCDebug(OkularCoreDebug) << "CharDelete";
m_editType = CharDelete;
}
else if ( newContentsRightOfCursor() == oldContentsRightOfCursor() &&
newContentsLeftOfCursor().left( newContentsLeftOfCursor().length() - 1) == oldContentsLeftOfCursor() &&
newContentsLeftOfCursor().right(1) != "\n" )
newContentsLeftOfCursor().right(1) != QLatin1String("\n") )
{
qCDebug(OkularCoreDebug) << "CharInsert";
m_editType = CharInsert;
......
This diff is collapsed.
......@@ -211,7 +211,7 @@ class Okular::FormFieldChoicePrivate : public Okular::FormFieldPrivate
{
list.append( QString::number( c ) );
}
return list.join( QLatin1String( ";" ) );
return list.join( QStringLiteral( ";" ) );
}
};
......
......@@ -362,7 +362,7 @@ void Generator::walletDataForFile( const QString &fileName, QString *walletName,
{
*walletKey = fileName.section('/', -1, -1);
*walletName = KWallet::Wallet::NetworkWallet();
*walletFolder = "KPdf";
*walletFolder = QStringLiteral("KPdf");
}
bool Generator::hasFeature( GeneratorFeature feature ) const
......@@ -626,19 +626,19 @@ ExportFormat ExportFormat::standardFormat( StandardExportFormat type )
switch ( type )
{
case PlainText:
return ExportFormat( QIcon::fromTheme( "text-x-generic" ), i18n( "Plain &Text..." ), db.mimeTypeForName( "text/plain" ) );
return ExportFormat( QIcon::fromTheme( QStringLiteral("text-x-generic") ), i18n( "Plain &Text..." ), db.mimeTypeForName( QStringLiteral("text/plain") ) );
break;
case PDF:
return ExportFormat( QIcon::fromTheme( "application-pdf" ), i18n( "PDF" ), db.mimeTypeForName( "application/pdf" ) );
return ExportFormat( QIcon::fromTheme( QStringLiteral("application-pdf") ), i18n( "PDF" ), db.mimeTypeForName( QStringLiteral("application/pdf") ) );
break;
case OpenDocumentText:
return ExportFormat(
QIcon::fromTheme( "application-vnd.oasis.opendocument.text" ),
QIcon::fromTheme( QStringLiteral("application-vnd.oasis.opendocument.text") ),
i18nc( "This is the document format", "OpenDocument Text" ),
db.mimeTypeForName( "application/vnd.oasis.opendocument.text" ) );
db.mimeTypeForName( QStringLiteral("application/vnd.oasis.opendocument.text") ) );
break;
case HTML:
return ExportFormat( QIcon::fromTheme( "text-html" ), i18nc( "This is the document format", "HTML" ), db.mimeTypeForName( "text/html" ) );
return ExportFormat( QIcon::fromTheme( QStringLiteral("text-html") ), i18nc( "This is the document format", "HTML" ), db.mimeTypeForName( QStringLiteral("text/html") ) );
break;
}
return ExportFormat();
......@@ -656,7 +656,7 @@ bool ExportFormat::operator!=( const ExportFormat &other ) const
QDebug operator<<( QDebug str, const Okular::PixmapRequest &req )
{
QString s = QString( "PixmapRequest(#%2, %1, %3x%4, page %6, prio %5)" )
QString s = QStringLiteral( "PixmapRequest(#%2, %1, %3x%4, page %6, prio %5)" )
.arg( QString( req.asynchronous() ? "async" : "sync" ) )
.arg( (qulonglong)req.observer() )
.arg( req.width() )
......
......@@ -64,7 +64,7 @@ Movie::Movie( const QString& fileName, const QByteArray &data )
* GStreamer backend). Storing the data in a temporary file works fine
* though, not to mention, it releases much needed memory. (gamaral)
*/
d->m_tmp = new QTemporaryFile( QString( "%1/okrXXXXXX" ).arg( QDir::tempPath() ) );
d->m_tmp = new QTemporaryFile( QStringLiteral( "%1/okrXXXXXX" ).arg( QDir::tempPath() ) );
if ( d->m_tmp->open() ) {
d-><