[Uml-devel] KDE/kdesdk
David Faure
faure at kde.org
Fri May 22 14:10:18 UTC 2009
SVN commit 971486 by dfaure:
Fix compilation with QT_STRICT_ITERATORS.
M +2 -2 kbugbuster/gui/messageeditor.cpp
M +2 -2 kbugbuster/gui/preferencesdialog.cpp
M +2 -2 kbugbuster/gui/severityselectdialog.cpp
M +4 -4 kcachegrind/kcachegrind/configdlg.cpp
M +5 -2 kcachegrind/kcachegrind/toplevel.cpp
M +4 -6 kompare/libdiff2/kompareprocess.cpp
M +14 -7 poxml/parser.cpp
M +5 -5 poxml/split.cpp
M +1 -1 umbrello/umbrello/codegenerators/codegenerator.cpp
M +4 -6 umbrello/umbrello/umlviewimageexportermodel.cpp
--- trunk/KDE/kdesdk/kbugbuster/gui/messageeditor.cpp #971485:971486
@@ -7,7 +7,7 @@
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
- by the membership of KDE e.V.), which shall act as a proxy
+ by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
@@ -83,7 +83,7 @@
mSelectionCombo->clear();
QMap<QString,QString>::ConstIterator it;
- for(it = mMessageButtons.begin();it != mMessageButtons.end();++it) {
+ for(it = mMessageButtons.constBegin();it != mMessageButtons.constEnd();++it) {
mSelectionCombo->addItem(it.key());
}
--- trunk/KDE/kdesdk/kbugbuster/gui/preferencesdialog.cpp #971485:971486
@@ -7,7 +7,7 @@
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
- by the membership of KDE e.V.), which shall act as a proxy
+ by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
@@ -282,7 +282,7 @@
mServerList->clear();
QList<BugServer *> servers = BugSystem::self()->serverList();
QList<BugServer *>::ConstIterator it;
- for( it = servers.begin(); it != servers.end(); ++it ) {
+ for( it = servers.constBegin(); it != servers.constEnd(); ++it ) {
new ServerItem( mServerList, (*it)->serverConfig() );
}
}
--- trunk/KDE/kdesdk/kbugbuster/gui/severityselectdialog.cpp #971485:971486
@@ -7,7 +7,7 @@
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
- by the membership of KDE e.V.), which shall act as a proxy
+ by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
@@ -45,7 +45,7 @@
QList<Bug::Severity> severities = Bug::severities();
QList<Bug::Severity>::ConstIterator it;
QVBoxLayout *vbox = new QVBoxLayout;
- for( it = severities.begin(); it != severities.end(); ++it ) {
+ for( it = severities.constBegin(); it != severities.constEnd(); ++it ) {
QRadioButton *rb = new QRadioButton( Bug::severityToString( *it ), mButtonGroup );
vbox->addWidget( rb );
mSeverities.insert( *it, rb );
--- trunk/KDE/kdesdk/kcachegrind/kcachegrind/configdlg.cpp #971485:971486
@@ -165,8 +165,8 @@
Q3ListViewItem* i = new Q3ListViewItem(dirList, i18n("(always)"));
i->setOpen(true);
- QStringList::const_iterator sit = c->_generalSourceDirs.begin();
- for(; sit != c->_generalSourceDirs.end(); ++sit ) {
+ QStringList::const_iterator sit = c->_generalSourceDirs.constBegin();
+ for(; sit != c->_generalSourceDirs.constEnd(); ++sit ) {
QString d = (*sit);
if (d.isEmpty()) d = "/";
new Q3ListViewItem(i, d);
@@ -180,8 +180,8 @@
QStringList* dirs = c->_objectSourceDirs[n];
if (!dirs) continue;
- sit = dirs->begin();
- for(; sit != dirs->end(); ++sit ) {
+ sit = dirs->constBegin();
+ for(; sit != dirs->constEnd(); ++sit ) {
QString d = (*sit);
if (d.isEmpty()) d = "/";
new Q3ListViewItem(i, d);
--- trunk/KDE/kdesdk/kcachegrind/kcachegrind/toplevel.cpp #971485:971486
@@ -1074,7 +1074,8 @@
if (ct) {
int idx=0;
QStringList l = _saCost->items();
- for (QStringList::const_iterator it = l.begin(); it != l.end(); ++it, ++idx ) {
+ // TODO replace with l.indexOf(ct->longName()) ?
+ for (QStringList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it, ++idx ) {
if (*it == ct->longName())
_saCost->setCurrentItem(idx);
}
@@ -1105,7 +1106,9 @@
int idx=0;
QStringList l = _saCost2->items();
- for (QStringList::const_iterator it = l.begin(); it != l.end(); ++it, ++idx ) {
+
+ // TODO replace with indexOf(longName)?
+ for (QStringList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it, ++idx ) {
if (*it == longName)
_saCost2->setCurrentItem(idx);
}
--- trunk/KDE/kdesdk/kompare/libdiff2/kompareprocess.cpp #971485:971486
@@ -112,11 +112,11 @@
break;
}
- if ( m_diffSettings->m_largeFiles
+ if ( m_diffSettings->m_largeFiles
// default diff does not have -H on OpenBSD
// so don't pass this option unless the user overrode the default program
#if defined(__OpenBSD__)
- && !m_diffSettings->m_diffProgram.isEmpty()
+ && !m_diffSettings->m_diffProgram.isEmpty()
#endif
)
{
@@ -186,11 +186,9 @@
if ( m_diffSettings->m_excludeFilePattern )
{
- QStringList::ConstIterator it = m_diffSettings->m_excludeFilePatternList.begin();
- QStringList::ConstIterator end = m_diffSettings->m_excludeFilePatternList.end();
- for ( ; it != end; ++it )
+ Q_FOREACH(const QString& it, m_diffSettings->m_excludeFilePatternList)
{
- *this << "-x" << *it;
+ *this << "-x" << it;
}
}
--- trunk/KDE/kdesdk/poxml/parser.cpp #971485:971486
@@ -284,7 +284,8 @@
if (msg.msgid.isEmpty())
return true;
- for (int index = 0; msg.msgid.at(index) == ' '; index++, offset++);
+ for (int index = 0; msg.msgid.at(index) == ' '; index++, offset++)
+ ;
stripWhiteSpace( msg.msgid );
// removing starting single tags
@@ -304,7 +305,8 @@
msg.msgid = msg.msgid.mid(strindex + 1);
changed = true;
offset += strindex + 1;
- for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++) ;
+ for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++)
+ ;
stripWhiteSpace( msg.msgid );
}
}
@@ -319,7 +321,8 @@
changed = true;
}
- for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++) ;
+ for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++)
+ ;
stripWhiteSpace( msg.msgid );
while (true) {
@@ -355,7 +358,8 @@
QString attr = msg.msgid.left(strindex);
msg.msgid = msg.msgid.mid(strindex + 1);
offset += strindex + 1;
- for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++) ;
+ for (int index = 0; index < msg.msgid.length() && msg.msgid.at(index) == ' '; index++, offset++)
+ ;
stripWhiteSpace( msg.msgid );
msg.tag = starttag;
@@ -864,17 +868,20 @@
cout << prefix << " \"" << escape(line).utf8().data() << "\"\n";
} else {
cout << prefix << " \"\"\n";
- for (QStringList::ConstIterator it = list.begin(); it != list.end(); it++) {
+ QStringList::ConstIterator last = list.constEnd();
+ if (!list.isEmpty())
+ --last;
+ for (QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); it++) {
line = *it;
if (!line.isEmpty()) {
cout << " \"" << escape(line).utf8().data();
- if (it == list.fromLast())
+ if (it == last)
cout << "\"\n";
else
cout << "\\n\"\n";
} else {
cout << " \"";
- if (it != list.fromLast())
+ if (it != last)
cout << "\\n";
cout << "\"\n";
}
--- trunk/KDE/kdesdk/poxml/split.cpp #971485:971486
@@ -16,11 +16,11 @@
MsgList english = parseXML(argv[1]);
MsgList translated = parseXML(argv[2]);
- QMap<QString, int>::ConstIterator eit2 = english.pc.anchors.begin();
+ QMap<QString, int>::ConstIterator eit2 = english.pc.anchors.constBegin();
QMap<int, QString> errors;
- while (eit2 != english.pc.anchors.end())
+ while (eit2 != english.pc.anchors.constEnd())
{
if (eit2.data() == translated.pc.anchors[eit2.key()]) {
QString key = eit2.key();
@@ -34,7 +34,7 @@
}
if (report_mismatches && errors.count()) {
- for (QMap<int, QString>::ConstIterator it = errors.begin(); it != errors.end(); ++it)
+ for (QMap<int, QString>::ConstIterator it = errors.constBegin(); it != errors.constEnd(); ++it)
{
if (translated.pc.anchors.contains(it.data()))
fprintf(stderr, "id=\"%s\" not in the same paragraphs (%d vs %d)\n", it.data().latin1(),
@@ -66,7 +66,7 @@
{
if ((*it).msgid == "ROLES_OF_TRANSLATORS") {
if ((*it).msgstr.length() && !(*it).msgstr.contains("ROLES_OF_TRANSLATORS")) {
- have_roles_of_translators = true;
+ have_roles_of_translators = true;
}
else {
MsgList::Iterator tmp = it;
@@ -78,7 +78,7 @@
if ((*it).msgid == "CREDIT_FOR_TRANSLATORS") {
if ((*it).msgstr.length() && !(*it).msgstr.contains("CREDIT_FOR_TRANSLATORS")) {
- have_credit_for_translators = true;
+ have_credit_for_translators = true;
}
else {
MsgList::Iterator tmp = it;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegenerator.cpp #971485:971486
@@ -751,7 +751,7 @@
const QString endLine = UMLApp::app()->getCommonPolicy()->getNewLineEndingChars();
QString output;
QStringList lines = text.split(endLine);
- for (QStringList::ConstIterator lit = lines.begin(); lit != lines.end(); ++lit) {
+ for (QStringList::ConstIterator lit = lines.constBegin(); lit != lines.constEnd(); ++lit) {
QString input = *lit;
input.remove( QRegExp("\\s+$") );
if (input.length() < lineWidth) {
--- trunk/KDE/kdesdk/umbrello/umbrello/umlviewimageexportermodel.cpp #971485:971486
@@ -53,10 +53,8 @@
if (!supportedImageTypesList.size()) {
// QT supported formats
QList<QByteArray> qImageFormats = QImageWriter::supportedImageFormats();
- QList<QByteArray>::const_iterator it, it_end;
- it = qImageFormats.begin(); it_end = qImageFormats.end();
- for (; it != it_end; ++it) {
- QString format = QString(*it).toLower();
+ Q_FOREACH(const QByteArray& it, qImageFormats) {
+ const QString format = it.toLower();
if (!supportedImageTypesList.contains(format))
supportedImageTypesList << format;
}
@@ -67,7 +65,7 @@
supportedImageTypesList << "svg";
}
supportedImageTypesList.sort();
-
+
return supportedImageTypesList;
}
@@ -299,7 +297,7 @@
// creates the directory and any needed parent directories
QStringList dirs = url.directory().split(QDir::separator(), QString::SkipEmptyParts );
- for (QStringList::ConstIterator it = dirs.begin() ; it != dirs.end(); ++it) {
+ for (QStringList::ConstIterator it = dirs.constBegin() ; it != dirs.constEnd(); ++it) {
directory.addPath(*it);
if (!KIO::NetAccess::exists(directory, KIO::NetAccess::SourceSide, UMLApp::app())) {
More information about the umbrello-devel
mailing list