mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-04 06:59:32 +00:00
Krazy: Check single-char QString operations for efficiency.
svn path=/trunk/KDE/kdegraphics/okular/; revision=1110335
This commit is contained in:
parent
824a620d7a
commit
122fab0eee
|
@ -601,7 +601,7 @@ QStringList FilePrinter::optionCupsProperties( QPrinter &printer )
|
|||
if ( dialogOptions[i+1].isEmpty() ) {
|
||||
cupsOptions << "-o" << dialogOptions[i];
|
||||
} else {
|
||||
cupsOptions << "-o" << dialogOptions[i] + "=" + dialogOptions[i+1];
|
||||
cupsOptions << "-o" << dialogOptions[i] + '=' + dialogOptions[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void imagesInArchive( const QString &prefix, const KArchiveDirectory* dir
|
|||
Q_FOREACH ( const QString &entry, dir->entries() ) {
|
||||
const KArchiveEntry *e = dir->entry( entry );
|
||||
if ( e->isDirectory() ) {
|
||||
imagesInArchive( prefix + entry + "/", static_cast<const KArchiveDirectory*>( e ), entries );
|
||||
imagesInArchive( prefix + entry + '/', static_cast<const KArchiveDirectory*>( e ), entries );
|
||||
} else if ( e->isFile() ) {
|
||||
entries->append( prefix + entry );
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ static UnrarFlavour* detectUnrar( const QString &unrarPath )
|
|||
proc.start( unrarPath, QStringList() << "--version" );
|
||||
bool ok = proc.waitForFinished( -1 );
|
||||
Q_UNUSED( ok )
|
||||
const QStringList lines = QString::fromLocal8Bit( proc.readAllStandardOutput() ).split( "\n", QString::SkipEmptyParts );
|
||||
const QStringList lines = QString::fromLocal8Bit( proc.readAllStandardOutput() ).split( '\n', QString::SkipEmptyParts );
|
||||
if ( !lines.isEmpty() )
|
||||
{
|
||||
if ( lines.first().startsWith( "UNRAR " ) )
|
||||
|
@ -131,7 +131,7 @@ QStringList Unrar::list()
|
|||
|
||||
startSyncProcess( QStringList() << "lb" << mFileName );
|
||||
|
||||
const QStringList listFiles = helper->kind->processListing( QString::fromLocal8Bit( mStdOutData ).split( "\n", QString::SkipEmptyParts ) );
|
||||
const QStringList listFiles = helper->kind->processListing( QString::fromLocal8Bit( mStdOutData ).split( '\n', QString::SkipEmptyParts ) );
|
||||
QStringList newList;
|
||||
Q_FOREACH ( const QString &f, listFiles ) {
|
||||
if ( QFile::exists( mTempDir->name() + f ) ) {
|
||||
|
|
|
@ -552,7 +552,7 @@ static const KZipFileEntry* loadFile( KZip *archive, const QString &fileName, Qt
|
|||
path = fileName.left( index );
|
||||
entryName = fileName.mid( index + 1 );
|
||||
} else {
|
||||
path = "/";
|
||||
path = '/';
|
||||
entryName = fileName;
|
||||
}
|
||||
const KArchiveEntry * newEntry = archive->directory()->entry( path );
|
||||
|
@ -885,10 +885,10 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
|
|||
att = node.attributes.value( "Indices" );
|
||||
QList<qreal> advanceWidths;
|
||||
if ( ! att.isEmpty() ) {
|
||||
QStringList indicesElements = att.split( ";" );
|
||||
QStringList indicesElements = att.split( ';' );
|
||||
for( int i = 0; i < indicesElements.size(); ++i ) {
|
||||
if ( indicesElements.at(i).contains( "," ) ) {
|
||||
QStringList parts = indicesElements.at(i).split( "," );
|
||||
QStringList parts = indicesElements.at(i).split( ',' );
|
||||
if (parts.size() == 2 ) {
|
||||
// regular advance case, no offsets
|
||||
advanceWidths.append( parts.at(1).toDouble() * fontSize / 100.0 );
|
||||
|
|
|
@ -24,7 +24,7 @@ char* toString( const KUrl& url )
|
|||
|
||||
static const KUrl makeUrlFromCwd( const QString& u, const QString& ref = QString() )
|
||||
{
|
||||
KUrl url( KUrl( QDir::currentPath() + "/" ), u );
|
||||
KUrl url( KUrl( QDir::currentPath() + '/' ), u );
|
||||
if ( !ref.isEmpty() )
|
||||
url.setRef( ref );
|
||||
url.cleanPath();
|
||||
|
|
|
@ -141,7 +141,7 @@ QString contents( const Okular::Annotation * ann )
|
|||
QString contentsHtml( const Okular::Annotation * ann )
|
||||
{
|
||||
QString text = Qt::escape( contents( ann ) );
|
||||
text.replace( "\n", "<br>" );
|
||||
text.replace( '\n', "<br>" );
|
||||
return text;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue