i) For single-char .section calls - using 'x' rather than "x" as an argument.

ii) ++i rather than i++ where applicable.


svn path=/trunk/KDE/kdebase/apps/; revision=930643
This commit is contained in:
Andrew Coles 2009-02-23 23:03:13 +00:00
parent 1a93cd06ac
commit f6b08347e1
2 changed files with 7 additions and 7 deletions

View file

@ -82,7 +82,7 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent)
{
const QStringList picslist = facesDir.entryList( QDir::Files );
for ( QStringList::const_iterator it = picslist.constBegin(); it != picslist.constEnd(); ++it )
new QListWidgetItem( QIcon( picsdir + *it ), (*it).section(".",0,0), ui.m_FacesWidget );
new QListWidgetItem( QIcon( picsdir + *it ), (*it).section('.',0,0), ui.m_FacesWidget );
}
facesDir.setPath( KCFGUserAccount::userFaceDir() );
if ( facesDir.exists() )
@ -91,7 +91,7 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent)
for ( QStringList::const_iterator it = picslist.constBegin(); it != picslist.constEnd(); ++it )
new QListWidgetItem( QIcon( KCFGUserAccount::userFaceDir() + *it ),
'/'+(*it) == KCFGUserAccount::customFaceFile() ?
i18n("(Custom)") : (*it).section(".",0,0),
i18n("(Custom)") : (*it).section('.',0,0),
ui.m_FacesWidget );
}
@ -125,14 +125,14 @@ void ChFaceDlg::addCustomPixmap( const QString &imPath, bool saveCopy )
userfaces.mkdir( userfaces.absolutePath() );
pix.save( userfaces.absolutePath() + "/.userinfo-tmp" , "PNG" );
KonqOperations::copy( this, KonqOperations::COPY, KUrl::List( KUrl( userfaces.absolutePath() + "/.userinfo-tmp" ) ), KUrl( userfaces.absolutePath() + '/' + QFileInfo(imPath).fileName().section(".",0,0) ) );
KonqOperations::copy( this, KonqOperations::COPY, KUrl::List( KUrl( userfaces.absolutePath() + "/.userinfo-tmp" ) ), KUrl( userfaces.absolutePath() + '/' + QFileInfo(imPath).fileName().section('.',0,0) ) );
#if 0
if ( !pix.save( userfaces.absolutePath() + '/' + imPath , "PNG" ) )
KMessageBox::sorry(this, i18n("There was an error saving the image:\n%1", userfaces.absolutePath() ) );
#endif
}
QListWidgetItem* newface = new QListWidgetItem( QIcon(QPixmap::fromImage(pix)), QFileInfo(imPath).fileName().section(".",0,0), ui.m_FacesWidget );
QListWidgetItem* newface = new QListWidgetItem( QIcon(QPixmap::fromImage(pix)), QFileInfo(imPath).fileName().section('.',0,0), ui.m_FacesWidget );
ui.m_FacesWidget->scrollToItem( newface );
ui.m_FacesWidget->setCurrentItem( newface );
}

View file

@ -279,15 +279,15 @@ bool PasswdProcess::isPrompt(const QByteArray &line, const char *word)
{
unsigned i, j, colon;
unsigned int lineLength(line.length());
for (i=0,j=0,colon=0; i<lineLength; i++)
for (i=0,j=0,colon=0; i<lineLength; ++i)
{
if (line[i] == ':')
{
j = i; colon++;
j = i; ++colon;
continue;
}
if (!isspace(line[i]))
j++;
++j;
}
if ((colon != 1) || (line[j] != ':'))