mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
Conductor auto numerotation : use function from QET namespace instead of function from this file.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3532 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include "conductor.h"
|
#include "conductor.h"
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "potentialtextsdialog.h"
|
#include "potentialtextsdialog.h"
|
||||||
|
#include "qet.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Constructor
|
*Constructor
|
||||||
@@ -59,7 +60,7 @@ void ConductorAutoNumerotation::checkPotential(Conductor *conductor) {
|
|||||||
foreach (const Conductor *c, c_list) strl<<(c->text());
|
foreach (const Conductor *c, c_list) strl<<(c->text());
|
||||||
|
|
||||||
//check text list, isn't same in potential, ask user what to do
|
//check text list, isn't same in potential, ask user what to do
|
||||||
if (!eachIsEqual(strl)) {
|
if (!QET::eachStrIsEqual(strl)) {
|
||||||
PotentialTextsDialog ptd(conductor, conductor->diagramEditor());
|
PotentialTextsDialog ptd(conductor, conductor->diagramEditor());
|
||||||
if ( ptd.exec() == QDialog::Accepted ) {
|
if ( ptd.exec() == QDialog::Accepted ) {
|
||||||
ConductorAutoNumerotation can(conductor);
|
ConductorAutoNumerotation can(conductor);
|
||||||
@@ -111,7 +112,7 @@ void ConductorAutoNumerotation::numeratePotential() {
|
|||||||
QStringList strl;
|
QStringList strl;
|
||||||
foreach (const Conductor *cc, conductor_list) strl<<(cc->text());
|
foreach (const Conductor *cc, conductor_list) strl<<(cc->text());
|
||||||
//the texts is identicals
|
//the texts is identicals
|
||||||
if (eachIsEqual(strl)) {
|
if (QET::eachStrIsEqual(strl)) {
|
||||||
ConductorProperties cp = conductor_ -> properties();
|
ConductorProperties cp = conductor_ -> properties();
|
||||||
cp.text = strl.at(0);
|
cp.text = strl.at(0);
|
||||||
conductor_ -> setProperties(cp);
|
conductor_ -> setProperties(cp);
|
||||||
@@ -140,13 +141,3 @@ void ConductorAutoNumerotation::numerateNewConductor() {
|
|||||||
applyText(ncc.toRepresentedString());
|
applyText(ncc.toRepresentedString());
|
||||||
m_diagram->project()->addConductorAutoNum(m_diagram -> conductorsAutonumName(), ncc.next());
|
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;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -44,6 +44,4 @@ class ConductorAutoNumerotation {
|
|||||||
QSet <Conductor *> conductor_list;
|
QSet <Conductor *> conductor_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool eachIsEqual (const QStringList &);
|
|
||||||
|
|
||||||
#endif // CONDUCTORAUTONUMEROTATION_H
|
#endif // CONDUCTORAUTONUMEROTATION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user