mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
Replace foreach function by for, please try and report problem
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4900 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -98,7 +98,7 @@ QETProject *TitleBlockTemplatesCollection::parentProject() {
|
||||
*/
|
||||
QList<TitleBlockTemplateLocation> TitleBlockTemplatesCollection::templatesLocations() {
|
||||
QList<TitleBlockTemplateLocation> locations;
|
||||
foreach (QString template_name, templates()) {
|
||||
for (QString template_name: templates()) {
|
||||
locations << location(template_name);
|
||||
}
|
||||
return(locations);
|
||||
@@ -320,7 +320,7 @@ bool TitleBlockTemplatesProjectCollection::isReadOnly(const QString &template_na
|
||||
@param xml_element XML element to be parsed to load title block templates
|
||||
*/
|
||||
void TitleBlockTemplatesProjectCollection::fromXml(const QDomElement &xml_element) {
|
||||
foreach (QDomElement e, QET::findInDomElement(xml_element, "titleblocktemplates", "titleblocktemplate")) {
|
||||
for (QDomElement e: QET::findInDomElement(xml_element, "titleblocktemplates", "titleblocktemplate")) {
|
||||
// each titleblock template must have a name
|
||||
if (!e.hasAttribute("name")) continue;
|
||||
QString titleblock_template_name = e.attribute("name");
|
||||
@@ -340,7 +340,7 @@ void TitleBlockTemplatesProjectCollection::fromXml(const QDomElement &xml_elemen
|
||||
void TitleBlockTemplatesProjectCollection::deleteUnusedTitleBlocKTemplates() {
|
||||
if (!project_) return;
|
||||
|
||||
foreach (QString template_name, templates()) {
|
||||
for (QString template_name: templates()) {
|
||||
if (!project_ -> usesTitleBlockTemplate(location(template_name))) {
|
||||
removeTemplate(template_name);
|
||||
}
|
||||
@@ -390,7 +390,7 @@ QString TitleBlockTemplatesFilesCollection::path(const QString &template_name) c
|
||||
QStringList TitleBlockTemplatesFilesCollection::templates() {
|
||||
QStringList templates_names;
|
||||
QRegExp replace_regexp(QString("%1$").arg(TITLEBLOCKS_FILE_EXTENSION));
|
||||
foreach(QString name, dir_.entryList()) {
|
||||
for (QString name: dir_.entryList()) {
|
||||
templates_names << name.replace(replace_regexp, "");
|
||||
}
|
||||
return(templates_names);
|
||||
|
||||
Reference in New Issue
Block a user