Commit a23a2206 authored by Albert Astals Cid's avatar Albert Astals Cid

const & in foreach variables

svn path=/trunk/koffice/; revision=890858
parent bc3fce19
......@@ -123,7 +123,7 @@ KoScriptManagerAddFileWidget::KoScriptManagerAddFileWidget(KoScriptManagerAddWiz
d->filewidget = new KFileWidget(KUrl(startDirOrVariable), this);
QStringList mimetypes;
foreach(QString interpretername, Kross::Manager::self().interpreters()) {
foreach(const QString &interpretername, Kross::Manager::self().interpreters()) {
Kross::InterpreterInfo* info = Kross::Manager::self().interpreterInfo(interpretername);
Q_ASSERT( info );
mimetypes.append( info->mimeTypes().join(" ").trimmed() );
......
......@@ -136,7 +136,7 @@ void dumpElem(KoXmlElement elem, int level=0) {
QString prefix="";
for(int i = 0; i < level; ++i) prefix+=" ";
qDebug()<<QString("%1 %2").arg(prefix).arg(elem.tagName());
foreach(QString s,elem.attributeNames()) qDebug()<<QString("%1 %2 = %3").arg(prefix).arg(s).arg(elem.attribute(s));
foreach(const QString &s,elem.attributeNames()) qDebug()<<QString("%1 %2 = %3").arg(prefix).arg(s).arg(elem.attribute(s));
level++;
KoXmlElement e;
forEachElement(e, elem) dumpElem(e,level);
......
......@@ -100,7 +100,7 @@ KoScriptingPart::KoScriptingPart(KoScriptingModule* const module, const QStringL
if( QFileInfo(file).exists() )
Kross::Manager::self().actionCollection()->readXmlFile(file);
else
foreach(QString f, files)
foreach(const QString &f, files)
Kross::Manager::self().actionCollection()->readXmlFile(f);
}
......@@ -142,7 +142,7 @@ KoScriptingModule* KoScriptingPart::module() const
bool KoScriptingPart::showExecuteScriptFile()
{
QStringList mimetypes;
foreach(QString interpretername, Kross::Manager::self().interpreters()) {
foreach(const QString &interpretername, Kross::Manager::self().interpreters()) {
Kross::InterpreterInfo* info = Kross::Manager::self().interpreterInfo(interpretername);
Q_ASSERT( info );
mimetypes.append( info->mimeTypes().join(" ").trimmed() );
......@@ -174,7 +174,7 @@ void addMenu(QMenu* menu, Kross::ActionCollection* collection)
{
foreach(Kross::Action* a, collection->actions())
menu->addAction(a);
foreach(QString collectionname, collection->collections()) {
foreach(const QString &collectionname, collection->collections()) {
Kross::ActionCollection* c = collection->collection(collectionname);
if( c->isEnabled() )
addMenu(menu->addMenu( c->text() ), c);
......
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