Krazy: Check single-char QString operations for efficiency.

svn path=/trunk/KDE/kdegraphics/okular/; revision=1110335
This commit is contained in:
Glen Kaukola 2010-04-02 19:07:36 +00:00
parent 824a620d7a
commit 122fab0eee
6 changed files with 9 additions and 9 deletions

View File

@ -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];
}
}

View File

@ -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 );
}

View File

@ -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 ) ) {

View File

@ -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 );

View File

@ -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();

View File

@ -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;
}