Fix build without implicit cast to/from ascii

See the previous commits for details. This is the last part.
parent f05d42ea
......@@ -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 ); \
}
......
......@@ -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;
......
......@@ -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(") }") );
}
}
......
......@@ -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<DocumentItem>(uri, 2, 0, "DocumentItem");
qmlRegisterType<PageItem>(uri, 2, 0, "PageItem");
qmlRegisterType<ThumbnailItem>(uri, 2, 0, "ThumbnailItem");
......
......@@ -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() )
......
......@@ -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() );
}
}
......
Markdown is supported
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