From 67e7ada3117a43ffae831e172b5b061888da0e4e Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Mon, 11 Jul 2016 22:11:43 +0200 Subject: [PATCH] Fix build without implicit cast to/from ascii See the previous commits for details. This is the last part. --- conf/dlgdebug.cpp | 4 ++-- conf/editannottooldialog.cpp | 2 +- extensions.cpp | 10 +++++----- mobile/components/okularplugin.cpp | 2 +- part.cpp | 6 +++--- shell/shellutils.cpp | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/conf/dlgdebug.cpp b/conf/dlgdebug.cpp index b5b66b179..af1acc50f 100644 --- a/conf/dlgdebug.cpp +++ b/conf/dlgdebug.cpp @@ -14,8 +14,8 @@ #define DEBUG_SIMPLE_BOOL( cfgname, layout ) \ { \ - QCheckBox * foo = new QCheckBox( cfgname, this ); \ - foo->setObjectName( "kcfg_" cfgname ); \ + QCheckBox * foo = new QCheckBox( QStringLiteral(cfgname), this ); \ + foo->setObjectName( QStringLiteral("kcfg_" cfgname) ); \ layout->addWidget( foo ); \ } diff --git a/conf/editannottooldialog.cpp b/conf/editannottooldialog.cpp index 87429383e..a6c6f7747 100644 --- a/conf/editannottooldialog.cpp +++ b/conf/editannottooldialog.cpp @@ -259,7 +259,7 @@ QDomDocument EditAnnotToolDialog::toolXml() const annotationElement.setAttribute( QStringLiteral("icon"), sa->stampIconName() ); } - if ( opacity != "1" ) + if ( opacity != QStringLiteral("1") ) annotationElement.setAttribute( QStringLiteral("opacity"), opacity ); return doc; diff --git a/extensions.cpp b/extensions.cpp index c5c0714d1..3c0d8a8f0 100644 --- a/extensions.cpp +++ b/extensions.cpp @@ -109,12 +109,12 @@ void OkularLiveConnectExtension::postMessage( const QStringList &args ) Q_FOREACH ( const QString &arg, args ) { QString newarg = arg; - newarg.replace( '\'', QLatin1String("\\'") ); - arrayargs.append( "\"" + newarg + "\"" ); + newarg.replace( QLatin1Char('\''), QLatin1String("\\'") ); + arrayargs.append( QLatin1Char('"') + newarg + QLatin1Char('"') ); } - const QString arrayarg = '[' + arrayargs.join( QStringLiteral(", ") ) + ']'; - eval( "if (this.messageHandler && typeof this.messageHandler.onMessage == 'function') " - "{ this.messageHandler.onMessage(" + arrayarg + ") }" ); + const QString arrayarg = QLatin1Char('[') + arrayargs.join( QStringLiteral(", ") ) + QLatin1Char(']'); + eval( QStringLiteral("if (this.messageHandler && typeof this.messageHandler.onMessage == 'function') " + "{ this.messageHandler.onMessage(") + arrayarg + QStringLiteral(") }") ); } } diff --git a/mobile/components/okularplugin.cpp b/mobile/components/okularplugin.cpp index d124622f8..93d491e68 100644 --- a/mobile/components/okularplugin.cpp +++ b/mobile/components/okularplugin.cpp @@ -28,7 +28,7 @@ void OkularPlugin::registerTypes(const char *uri) { - Q_ASSERT(uri == QLatin1String("org.kde.okular")); + Q_ASSERT(QString::fromLocal8Bit(uri) == QLatin1String("org.kde.okular")); qmlRegisterType(uri, 2, 0, "DocumentItem"); qmlRegisterType(uri, 2, 0, "PageItem"); qmlRegisterType(uri, 2, 0, "ThumbnailItem"); diff --git a/part.cpp b/part.cpp index 0dd663d9e..5c938ddb1 100644 --- a/part.cpp +++ b/part.cpp @@ -366,7 +366,7 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW // [left toolbox: Table of Contents] | [] m_toc = new TOC( 0, m_document ); connect( m_toc.data(), &TOC::hasTOC, this, &Part::enableTOC ); - m_sidebar->addItem( m_toc, QIcon::fromTheme(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") ); + m_sidebar->addItem( m_toc, QIcon::fromTheme(QApplication::isLeftToRight() ? QStringLiteral("format-justify-left") : QStringLiteral("format-justify-right")), i18n("Contents") ); enableTOC( false ); // [left toolbox: Layers] | [] @@ -1028,7 +1028,7 @@ void Part::slotJobStarted(KIO::Job *job) if (job) { QStringList supportedMimeTypes = m_document->supportedMimeTypes(); - job->addMetaData(QStringLiteral("accept"), supportedMimeTypes.join(QStringLiteral(", ")) + ", */*;q=0.5"); + job->addMetaData(QStringLiteral("accept"), supportedMimeTypes.join(QStringLiteral(", ")) + QStringLiteral(", */*;q=0.5")); connect(job, &KJob::result, this, &Part::slotJobFinished); } @@ -2277,7 +2277,7 @@ void Part::slotSaveCopyAs() if ( m_embedMode == PrintPreviewMode ) return; - QUrl saveUrl = KFileDialog::getSaveUrl( QUrl("kfiledialog:///okular/" + url().fileName()), + QUrl saveUrl = KFileDialog::getSaveUrl( QUrl(QStringLiteral("kfiledialog:///okular/") + url().fileName()), QString(), widget(), QString(), KFileDialog::ConfirmOverwrite ); if ( saveUrl.isValid() && !saveUrl.isEmpty() ) diff --git a/shell/shellutils.cpp b/shell/shellutils.cpp index 296a758d7..9debb2b91 100644 --- a/shell/shellutils.cpp +++ b/shell/shellutils.cpp @@ -66,7 +66,7 @@ QUrl urlFromArg( const QString& _arg, FileExistFunc exist_func, const QString& p // make sure something like http://example.org/foo#bar.pdf is treated as a path name // but something like http://example.org/foo.pdf#bar is foo.pdf plus an anchor "bar" if ( url.fragment().contains( QLatin1Char( '.' ) ) ) { - url.setPath( url.path() + '#' + url.fragment() ); + url.setPath( url.path() + QLatin1Char ( '#' ) + url.fragment() ); url.setFragment( QString() ); } }