Const'ify when possible

svn path=/trunk/KDE/kdebase/apps/; revision=862272
This commit is contained in:
Laurent Montel 2008-09-18 11:24:47 +00:00
parent c2d64cdf6f
commit 83d06225d9
22 changed files with 35 additions and 35 deletions

View file

@ -143,7 +143,7 @@ void decorateDirs( QString destDir )
QStringList dirs = KGlobal::dirs()->findAllResources( "data", "kappfinder/apps/*.directory", KStandardDirs::Recursive );
QStringList::Iterator it;
QStringList::const_iterator it;
for ( it = dirs.begin(); it != dirs.end(); ++it ) {
// find out the name of the file to store
QString destName = *it;

View file

@ -48,7 +48,7 @@ int main( int argc, char *argv[] )
QList<AppLnkCache*> appCache;
QStringList::Iterator it;
QStringList::const_iterator it;
for ( it = templates.begin(); it != templates.end(); ++it )
scanDesktopFile( appCache, *it, dir );

View file

@ -169,7 +169,7 @@ void TopLevel::slotScan()
mListView->clear();
QStringList::Iterator it;
QStringList::const_iterator it;
for ( it = mTemplates.begin(); it != mTemplates.end(); ++it ) {
// eye candy
mProgress->setValue( mProgress->value() + 1 );
@ -207,7 +207,7 @@ void TopLevel::slotScan()
QTreeWidgetItem *dirItem = 0;
QString tmpRelPath = QString();
QStringList::Iterator tmpIt;
QStringList::const_iterator tmpIt;
for ( tmpIt = dirList.begin(); tmpIt != dirList.end(); ++tmpIt ) {
dirItem = addGroupItem( dirItem, tmpRelPath, *tmpIt );
tmpRelPath += *tmpIt + '/';

View file

@ -81,14 +81,14 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent)
if ( facesDir.exists() )
{
QStringList picslist = facesDir.entryList( QDir::Files );
for ( QStringList::Iterator it = picslist.begin(); it != picslist.end(); ++it )
for ( QStringList::const_iterator it = picslist.begin(); it != picslist.end(); ++it )
new QListWidgetItem( QIcon( picsdir + *it ), (*it).section(".",0,0), ui.m_FacesWidget );
}
facesDir.setPath( KCFGUserAccount::userFaceDir() );
if ( facesDir.exists() )
{
QStringList picslist = facesDir.entryList( QDir::Files );
for ( QStringList::Iterator it = picslist.begin(); it != picslist.end(); ++it )
for ( QStringList::const_iterator it = picslist.begin(); it != picslist.end(); ++it )
new QListWidgetItem( QIcon( KCFGUserAccount::userFaceDir() + *it ),
'/'+(*it) == KCFGUserAccount::customFaceFile() ?
i18n("(Custom)") : (*it).section(".",0,0),

View file

@ -408,7 +408,7 @@ KEBMacroCommand* DeleteCommand::deleteAll(const KBookmarkGroup & parentGroup) {
for (KBookmark bk = parentGroup.first();
!bk.isNull(); bk = parentGroup.next(bk))
lstToDelete.prepend(bk.address());
for (QStringList::Iterator it = lstToDelete.begin();
for (QStringList::const_iterator it = lstToDelete.begin();
it != lstToDelete.end(); ++it)
cmd->addCommand(new DeleteCommand((*it)));
return cmd;

View file

@ -266,7 +266,7 @@ void XBELImportCommand::doExecute(const KBookmarkGroup &/*bkGroup*/) {
QStringList tags;
for (int i = 0; i < subDoc.attributes().count(); i++)
tags << subDoc.attributes().item(i).toAttr().name();
for (QStringList::Iterator it = tags.begin(); it != tags.end(); ++it)
for (QStringList::const_iterator it = tags.begin(); it != tags.end(); ++it)
subDoc.attributes().removeNamedItem((*it));
subDoc.toElement().setAttribute("icon", m_icon);

View file

@ -419,7 +419,7 @@ void KEBApp::setActionsEnabled(SelcAbilities sa) {
}
}
for ( QStringList::Iterator it = toEnable.begin();
for ( QStringList::const_iterator it = toEnable.begin();
it != toEnable.end(); ++it )
{
//kDebug() <<" enabling action "<<(*it);

View file

@ -143,7 +143,7 @@ void KfindDlg::startSearch()
if(tabWidget->isSearchRecursive() && (dirwatch->internalMethod() == KDirWatch::FAM))
{
QStringList subdirs=getAllSubdirs(query->url().path());
for(QStringList::Iterator it = subdirs.begin(); it != subdirs.end(); ++it)
for(QStringList::const_iterator it = subdirs.begin(); it != subdirs.end(); ++it)
dirwatch->addDir(*it,true);
}
#endif
@ -284,7 +284,7 @@ QStringList KfindDlg::getAllSubdirs(QDir d)
d.setFilter( QDir::Dirs );
dirs = d.entryList();
for(QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it)
for(QStringList::const_iterator it = dirs.begin(); it != dirs.end(); ++it)
{
if((*it==".")||(*it==".."))
continue;

View file

@ -155,8 +155,8 @@ void KQuery::slotListEntries( QStringList list )
metaKeyRx=new QRegExp(m_metainfokey);
metaKeyRx->setPatternSyntax( QRegExp::Wildcard );
QStringList::Iterator it = list.begin();
QStringList::Iterator end = list.end();
QStringList::const_iterator it = list.begin();
QStringList::const_iterator end = list.end();
for (; it != end; ++it)
{
@ -268,7 +268,7 @@ void KQuery::processQuery( const KFileItem &file)
QString strmetakeycontent;
metakeys = metadatas.supportedKeys();
for (QStringList::Iterator it = metakeys.begin(); it != metakeys.end(); ++it )
for (QStringList::const_iterator it = metakeys.begin(); it != metakeys.end(); ++it )
{
if (!metaKeyRx->exactMatch(*it))
continue;

View file

@ -98,7 +98,7 @@ void USBDevice::parseSysDir(int bus, int parent, int level, const QString& dname
dir.setFilter(QDir::Dirs);
QStringList list = dir.entryList();
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it) {
if ((*it).contains(':'))
continue;
@ -206,7 +206,7 @@ QString USBDevice::dump() {
r += i18n("<tr><td><i>Power Consumption</i></td><td>self powered</td></tr>");
r += i18n("<tr><td><i>Attached Devicenodes</i></td><td>%1</td></tr>", _devnodes.at(0));
if ( _devnodes.count() > 1 ) {
QStringList::Iterator it = _devnodes.begin();
QStringList::const_iterator it = _devnodes.begin();
++it;
for (; it != _devnodes.end(); ++it )
r += "<tr><td></td><td>" + *it + "</td></tr>";
@ -276,7 +276,7 @@ bool USBDevice::parseSys(const QString &dname) {
d.setNameFilters(QStringList() << "usb*");
QStringList list = d.entryList();
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it) {
USBDevice* device = new USBDevice();
int bus = 0;

View file

@ -144,7 +144,7 @@ KRemoteEncodingPlugin::updateMenu()
if (!charset.isEmpty())
{
int id = 1;
QStringList::Iterator it;
QStringList::const_iterator it;
for (it = m_encodingDescriptions.begin(); it != m_encodingDescriptions.end(); ++it, ++id)
if ((*it).indexOf(charset) != -1)
break;
@ -213,7 +213,7 @@ KRemoteEncodingPlugin::slotDefault()
partList.erase(partList.begin());
}
for (QStringList::Iterator it = domains.begin(); it != domains.end();
for (QStringList::const_iterator it = domains.begin(); it != domains.end();
++it)
{
kDebug() << "Domain to remove: " << *it;

View file

@ -269,7 +269,7 @@ void KCookiesManagement::getDomains()
}
CookieListViewItem *dom;
for(QStringList::Iterator dIt = domains.begin(); dIt != domains.end(); dIt++)
for(QStringList::const_iterator dIt = domains.begin(); dIt != domains.end(); dIt++)
{
dom = new CookieListViewItem(dlg->lvCookies, *dIt);
dom->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
@ -302,7 +302,7 @@ void KCookiesManagement::getCookies(QTreeWidgetItem *cookieDom)
if(reply.isValid())
{
QStringList fieldVal = reply;
QStringList::Iterator fIt = fieldVal.begin();
QStringList::const_iterator fIt = fieldVal.begin();
while(fIt != fieldVal.end())
{
@ -336,7 +336,7 @@ bool KCookiesManagement::cookieDetails(CookieProp *cookie)
QStringList fieldVal = reply;
QStringList::Iterator c = fieldVal.begin();
QStringList::const_iterator c = fieldVal.begin();
if (c == fieldVal.end()) // empty list, do not crash
return false;
cookie->value = *c++;

View file

@ -94,7 +94,7 @@ KPreviewOptions::KPreviewOptions( QWidget *parent, const QVariantList & )
QStringList protocolList = KProtocolInfo::protocols();
protocolList.sort();
QStringList::Iterator it = protocolList.begin();
QStringList::const_iterator it = protocolList.begin();
KUrl url;
url.setPath("/");

View file

@ -338,7 +338,7 @@ void KAppearanceOptions::updateGUI()
}
int i = 0;
for ( QStringList::Iterator it = encodings.begin(); it != encodings.end(); ++it, ++i )
for ( QStringList::const_iterator it = encodings.begin(); it != encodings.end(); ++it, ++i )
if ( encodingName == *it )
m_pEncoding->setCurrentIndex( i );
if(encodingName.isEmpty())

View file

@ -76,7 +76,7 @@ void addBackEnd::aboutToShowAddMenu()
menu->clear();
int i = 0;
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it, i++ )
for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it, i++ )
{
KDesktopFile confFile( *it );
KConfigGroup desktopGroup = confFile.desktopGroup();
@ -121,7 +121,7 @@ void addBackEnd::doRollBack()
QStringList dirEntries = dir.entryList( QDir::Dirs | QDir::NoSymLinks );
dirEntries.removeAll(".");
dirEntries.removeAll("..");
for ( QStringList::Iterator it = dirEntries.begin(); it != dirEntries.end(); ++it ) {
for ( QStringList::const_iterator it = dirEntries.begin(); it != dirEntries.end(); ++it ) {
if ((*it)!="add")
KIO::NetAccess::del(KUrl( loc+(*it) ), m_parent);
}
@ -323,7 +323,7 @@ void Sidebar_Widget::addWebSideBar(const KUrl& url, const QString& /*name*/) {
// Go through list to see which ones exist. Check them for the URL
QStringList files = QDir(list).entryList("websidebarplugin*.desktop");
for (QStringList::Iterator it = files.begin(); it != files.end(); ++it){
for (QStringList::const_iterator it = files.begin(); it != files.end(); ++it){
KConfig _scf( list + *it, KConfig::SimpleConfig );
KConfigGroup scf(&_scf, "Desktop Entry");
if (scf.readPathEntry("URL", QString()) == url.url()) {
@ -659,7 +659,7 @@ void Sidebar_Widget::createButtons()
kDebug()<<"m_path: "<<m_path;
QDir dir(m_path);
QStringList list=dir.entryList("*.desktop");
for (QStringList::Iterator it=list.begin(); it!=list.end(); ++it)
for (QStringList::const_iterator it=list.begin(); it!=list.end(); ++it)
{
addButton(*it);
}

View file

@ -538,7 +538,7 @@ KonqSidebarBookmarkItem * KonqSidebarBookmarkModule::findByAddress( const QStrin
Q3ListViewItem * item = m_topLevelItem;
// The address is something like /5/10/2
QStringList addresses = address.split('/', QString::SkipEmptyParts);
for ( QStringList::Iterator it = addresses.begin() ; it != addresses.end() ; ++it )
for ( QStringList::const_iterator it = addresses.begin() ; it != addresses.end() ; ++it )
{
uint number = (*it).toUInt();
item = item->firstChild();

View file

@ -165,7 +165,7 @@ void KonqSidebarHistoryModule::slotCreateItems()
KSharedConfig::Ptr kc = KGlobal::config();
KConfigGroup cs( kc, "HistorySettings" );
QStringList openGroups = cs.readEntry("OpenGroups",QStringList());
QStringList::Iterator it2 = openGroups.begin();
QStringList::const_iterator it2 = openGroups.begin();
KonqSidebarHistoryGroupItem *group;
while ( it2 != openGroups.end() ) {
group = m_dict.find( *it2 );

View file

@ -202,7 +202,7 @@ extern "C" {
KUrl url;
url.setProtocol("file");
QStringList paths = KGlobal::dirs()->resourceDirs("websidebardata");
for (QStringList::Iterator i = paths.begin(); i != paths.end(); ++i) {
for (QStringList::const_iterator i = paths.begin(); i != paths.end(); ++i) {
if (QFileInfo(*i + "websidebar.html").exists()) {
url.setPath(*i + "websidebar.html");
break;

View file

@ -1241,7 +1241,7 @@ void KonqViewManager::loadItem( const KConfigGroup &cfg, KonqFrameContainerBase
}
QStringList childList = cfg.readEntry( QString::fromLatin1( "Children" ).prepend( prefix ),QStringList() );
for ( QStringList::Iterator it = childList.begin(); it != childList.end(); ++it )
for ( QStringList::const_iterator it = childList.begin(); it != childList.end(); ++it )
{
loadItem( cfg, tabContainer(), *it, defaultURL, openUrl, forcedUrl );
QWidget* currentPage = m_tabContainer->currentWidget();

View file

@ -383,7 +383,7 @@ void KNewMenu::slotFillTemplates()
// Look into "templates" dirs.
QStringList files = d->m_actionCollection->componentData().dirs()->findAllResources("templates");
QMap<QString, KNewMenuSingleton::Entry> slist; // used for sorting
for ( QStringList::Iterator it = files.begin() ; it != files.end() ; ++it )
for ( QStringList::const_iterator it = files.begin() ; it != files.end() ; ++it )
{
//kDebug(1203) << *it;
if ( (*it)[0] != '.' )

View file

@ -222,7 +222,7 @@ bool PluginPart::openUrl(const KUrl &url)
// handle arguments
QStringList argn, argv;
QStringList::Iterator it = _args.begin();
QStringList::const_iterator it = _args.begin();
for ( ; it != _args.end(); ) {
int equalPos = (*it).indexOf("=");

View file

@ -63,7 +63,7 @@ QStringList getSearchPaths()
// append environment variable NPX_PLUGIN_PATH
QStringList envs = QString( qgetenv("NPX_PLUGIN_PATH") ).split(':');
QStringList::Iterator it;
QStringList::const_iterator it;
for (it = envs.begin(); it != envs.end(); ++it)
searchPaths.append(*it);