[qet] [3532] Conductor auto numerotation : use function from QET namespace instead of function from this file.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3532
Author:   blacksun
Date:     2014-12-05 00:25:49 +0100 (Fri, 05 Dec 2014)
Log Message:
-----------
Conductor auto numerotation : use function from QET namespace instead of function from this file.

Modified Paths:
--------------
    trunk/sources/conductorautonumerotation.cpp
    trunk/sources/conductorautonumerotation.h

Modified: trunk/sources/conductorautonumerotation.cpp
===================================================================
--- trunk/sources/conductorautonumerotation.cpp	2014-12-04 23:14:20 UTC (rev 3531)
+++ trunk/sources/conductorautonumerotation.cpp	2014-12-04 23:25:49 UTC (rev 3532)
@@ -22,6 +22,7 @@
 #include "conductor.h"
 #include "diagram.h"
 #include "potentialtextsdialog.h"
+#include "qet.h"
 
 /**
  *Constructor
@@ -51,15 +52,15 @@
  * A conductor of the potential to check.
  */
 void ConductorAutoNumerotation::checkPotential(Conductor *conductor) {
-	//fill list of potential
+		//fill list of potential
 	QSet <Conductor *> c_list = conductor->relatedPotentialConductors();
 	c_list << conductor;
-	//fill list of text
+		//fill list of text
 	QStringList strl;
 	foreach (const Conductor *c, c_list) strl<<(c->text());
 
-	//check text list, isn't same in potential, ask user what to do
-	if (!eachIsEqual(strl)) {
+		//check text list, isn't same in potential, ask user what to do
+	if (!QET::eachStrIsEqual(strl)) {
 		PotentialTextsDialog ptd(conductor, conductor->diagramEditor());
 		if ( ptd.exec() == QDialog::Accepted ) {
 			ConductorAutoNumerotation can(conductor);
@@ -110,8 +111,8 @@
 void ConductorAutoNumerotation::numeratePotential() {
 	QStringList strl;
 	foreach (const Conductor *cc, conductor_list) strl<<(cc->text());
-	//the texts is identicals
-	if (eachIsEqual(strl)) {
+		//the texts is identicals
+	if (QET::eachStrIsEqual(strl)) {
 		ConductorProperties cp = conductor_ -> properties();
 		cp.text = strl.at(0);
 		conductor_ -> setProperties(cp);
@@ -140,13 +141,3 @@
 	applyText(ncc.toRepresentedString());
 	m_diagram->project()->addConductorAutoNum(m_diagram -> conductorsAutonumName(), ncc.next());
 }
-
-/**
- * @return true if every text of qsl is identical, else false.
- */
-bool eachIsEqual (const QStringList &qsl) {
-	foreach (const QString t, qsl) {
-		if (qsl.at(0) != t) return false;
-	}
-	return true;
-}

Modified: trunk/sources/conductorautonumerotation.h
===================================================================
--- trunk/sources/conductorautonumerotation.h	2014-12-04 23:14:20 UTC (rev 3531)
+++ trunk/sources/conductorautonumerotation.h	2014-12-04 23:25:49 UTC (rev 3532)
@@ -44,6 +44,4 @@
 	QSet <Conductor *> conductor_list;
 };
 
-bool eachIsEqual (const QStringList &);
-
 #endif // CONDUCTORAUTONUMEROTATION_H


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/