From 11cc09a637c1bcdcd59089a0b7797f3ac531b34d Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Sun, 8 Apr 2018 04:05:18 +0000 Subject: [PATCH] Backport commit 5307, 5311, 5312 Update changelog git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5314 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- ChangeLog | 16 ++++++++ .../10_allpole/114_connections/combine.elmt | 28 +++++++------ .../10_allpole/114_connections/corner.elmt | 24 ++++++----- .../10_allpole/114_connections/cross.elmt | 30 ++++++++------ .../10_allpole/114_connections/jump.elmt | 24 ++++++----- .../10_allpole/114_connections/qet_directory | 1 - .../10_allpole/114_connections/splice.elmt | 28 +++++++------ .../10_allpole/114_connections/thruleft.elmt | 28 +++++++------ .../10_allpole/114_connections/thruright.elmt | 30 ++++++++------ sources/qetgraphicsitem/conductor.cpp | 40 +++++++++++-------- sources/qetgraphicsitem/terminal.cpp | 29 ++++++++------ sources/qetgraphicsitem/terminal.h | 2 +- 12 files changed, 167 insertions(+), 113 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76a04b10c..7f6d94a77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +====== ChangeLog from 0.6 to 0.61 ====== + +* Backport HiDPI fix. +* Backport commit 5284 : Fix bug N° 157. +* Backport commit 5307 : Function for search conductor at the same potential. +When the search function is searching in a terminal element, they search only for the first terminal found, no matter if the terminal element have more than two terminals. +So the list of conductors at the same potential is missing some conductors. +This commit fix it, now the search function search for every terminals of a terminal element +* Backport commit 5311, 5312 : elements connections change propertie to terminal, fixed by commit svn 5307 + + + + + + + ====== ChangeLog from 0.5 to 0.6 ====== In the official collection, there are now 4106 elements, and 539 categoris for a total of 4645 files diff --git a/elements/10_electric/10_allpole/114_connections/combine.elmt b/elements/10_electric/10_allpole/114_connections/combine.elmt index 611367db4..7703f14f8 100644 --- a/elements/10_electric/10_allpole/114_connections/combine.elmt +++ b/elements/10_electric/10_allpole/114_connections/combine.elmt @@ -1,21 +1,25 @@ - - + + - Collegamento Combine - Соединение - Połączenie 1 Jonction + Unión + Collegamento + Połączenie 1 + وصلة + Соединение Spoj - Unión + - - - - - - + + + _ + + + + + diff --git a/elements/10_electric/10_allpole/114_connections/corner.elmt b/elements/10_electric/10_allpole/114_connections/corner.elmt index e5049f509..163198203 100644 --- a/elements/10_electric/10_allpole/114_connections/corner.elmt +++ b/elements/10_electric/10_allpole/114_connections/corner.elmt @@ -1,18 +1,22 @@ - - + + + Esquina Corner - Angolo - Угол - Coin - Narożnik Roh - Esquina + Coin + Угол + Narożnik + ركن + Angolo + - - - + + _ + + + diff --git a/elements/10_electric/10_allpole/114_connections/cross.elmt b/elements/10_electric/10_allpole/114_connections/cross.elmt index 55cd74343..ad64f968e 100644 --- a/elements/10_electric/10_allpole/114_connections/cross.elmt +++ b/elements/10_electric/10_allpole/114_connections/cross.elmt @@ -1,21 +1,25 @@ - - + + - Cross - Croce Пересечение - Croix - Połączenie 2 Kříž - Cruzar + Połączenie 2 + Croce + Cruzar + Cross + صليب + Croix + - - - - - - + + + _ + + + + + diff --git a/elements/10_electric/10_allpole/114_connections/jump.elmt b/elements/10_electric/10_allpole/114_connections/jump.elmt index c06b82216..6fdcccef2 100644 --- a/elements/10_electric/10_allpole/114_connections/jump.elmt +++ b/elements/10_electric/10_allpole/114_connections/jump.elmt @@ -1,19 +1,23 @@ - - + + Jump - Salto - Перемычка Saut - Brak połączenia + قفز Skok - Puente + Salto + Brak połączenia + Перемычка + Puente + - - - - + + + _ + + + diff --git a/elements/10_electric/10_allpole/114_connections/qet_directory b/elements/10_electric/10_allpole/114_connections/qet_directory index 98c1849ef..402fb54fc 100644 --- a/elements/10_electric/10_allpole/114_connections/qet_directory +++ b/elements/10_electric/10_allpole/114_connections/qet_directory @@ -3,7 +3,6 @@ Соединения Verbindungen Connections - Conexiones Connections Collegamenti Połączenia diff --git a/elements/10_electric/10_allpole/114_connections/splice.elmt b/elements/10_electric/10_allpole/114_connections/splice.elmt index 88d688c3d..a2fe69ab3 100644 --- a/elements/10_electric/10_allpole/114_connections/splice.elmt +++ b/elements/10_electric/10_allpole/114_connections/splice.elmt @@ -1,21 +1,25 @@ - - + + - Splice - Spaziatura - Сращивание Epissure Połączenie 3 Spojka - Empalme + Splice + Spaziatura + Сращивание + Empalme + - - - - - - + + + label + + + + + + diff --git a/elements/10_electric/10_allpole/114_connections/thruleft.elmt b/elements/10_electric/10_allpole/114_connections/thruleft.elmt index 60223dd5a..51dbb1c6e 100644 --- a/elements/10_electric/10_allpole/114_connections/thruleft.elmt +++ b/elements/10_electric/10_allpole/114_connections/thruleft.elmt @@ -1,21 +1,25 @@ - - + + - Thru left - Collegamento sinistro + Levé spojení Справа налево Liaison gauche + Thru left + ربط يسار + Collegamento sinistro Połączenie 4 - Levé spojení - A la izquierda + A la izquierda + - - - - - - + + _ + + + + + + diff --git a/elements/10_electric/10_allpole/114_connections/thruright.elmt b/elements/10_electric/10_allpole/114_connections/thruright.elmt index a2097371d..7f92ac331 100644 --- a/elements/10_electric/10_allpole/114_connections/thruright.elmt +++ b/elements/10_electric/10_allpole/114_connections/thruright.elmt @@ -1,22 +1,26 @@ - - + + Thru right - Collegamento destro Слева направо - Liaison droite - Połączenie 5 Pravé spojení - A la derecha + Liaison droite + Collegamento destro + A la derecha + ربط يمين + Połączenie 5 + - - - - - - - + + _ + + + + + + + diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index a0050da1d..0f5b9e820 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1517,12 +1517,14 @@ void Conductor::displayedTextChanged() * part of the returned QSet. * @param all_diagram : if true search in all diagram of the project, * false search only in the parent diagram of this conductor - * @param t_list, a list of terminal already cheched for the serach of potential. + * @param t_list, a list of terminal already found for this potential. * @return a QSet of conductor at the same potential. */ -QSet Conductor::relatedPotentialConductors(const bool all_diagram, QList *t_list) { +QSet Conductor::relatedPotentialConductors(const bool all_diagram, QList *t_list) +{ bool declar_t_list = false; - if (t_list == 0) { + if (t_list == nullptr) + { declar_t_list = true; t_list = new QList ; } @@ -1531,23 +1533,29 @@ QSet Conductor::relatedPotentialConductors(const bool all_diagram, QList this_terminal; this_terminal << terminal1 << terminal2; - // Return all conductor of terminal 1 and 2 - foreach (Terminal *terminal, this_terminal) { - if (!t_list -> contains(terminal)) { - t_list -> append(terminal); - QList other_conductors_list_t = terminal -> conductors(); + // Return all conductors of terminal 1 and 2 + for (Terminal *terminal : this_terminal) + { + if (!t_list->contains(terminal)) + { + t_list->append(terminal); + QList other_conductors_list_t = terminal->conductors(); - //get terminal share the same potential of @terminal, of parent element - Terminal *t1_bis = relatedPotentialTerminal(terminal, all_diagram); - if (t1_bis && !t_list->contains(t1_bis)) { - t_list -> append(t1_bis); - other_conductors_list_t += t1_bis->conductors(); + //Get the other terminals of the parent element of @terminal, who share the same potential + //This is use for element type "folio report" and "terminal element" + for (Terminal *t : relatedPotentialTerminal(terminal, all_diagram)) + { + if (!t_list->contains(t)) + { + t_list -> append(t); + other_conductors_list_t += t->conductors(); + } } other_conductors_list_t.removeAll(this); - // Research the conductors connected to conductors already found - foreach (Conductor *c, other_conductors_list_t) { - other_conductors += c -> relatedPotentialConductors(all_diagram, t_list); + //Get the conductors at the same potential for each conductors of other_conductors_list_t + for (Conductor *c : other_conductors_list_t) { + other_conductors += c->relatedPotentialConductors(all_diagram, t_list); } other_conductors += other_conductors_list_t.toSet(); } diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp index 28535ed43..0513e4828 100644 --- a/sources/qetgraphicsitem/terminal.cpp +++ b/sources/qetgraphicsitem/terminal.cpp @@ -765,24 +765,27 @@ Element *Terminal::parentElement() const { * @param t terminal to start search * @param all_diagram :if true return all related terminal, * false return only terminal in the same diagram of @t - * @return + * @return the list of terminal at the same potential */ -Terminal * relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram) { - // If terminal parent element is a folio report. - if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport) { +QList relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram) +{ + // If terminal parent element is a folio report. + if (all_diagram && terminal -> parentElement() -> linkType() & Element::AllReport) + { QList elmt_list = terminal -> parentElement() -> linkedElements(); - if (!elmt_list.isEmpty()) { - return (elmt_list.first() -> terminals().first()); + if (!elmt_list.isEmpty()) + { + return (elmt_list.first()->terminals()); } } - // If terminal parent element is a Terminal element. - else if (terminal -> parentElement() -> linkType() & Element::Terminale) { - QList terminals = terminal -> parentElement() -> terminals(); - terminals.removeAll(const_cast (terminal)); - if (!terminals.isEmpty()) - return terminals.first(); + // If terminal parent element is a Terminal element. + else if (terminal -> parentElement() -> linkType() & Element::Terminale) + { + QList terminals = terminal->parentElement()->terminals(); + terminals.removeAll(const_cast(terminal)); + return terminals; } - return nullptr; + return QList(); } diff --git a/sources/qetgraphicsitem/terminal.h b/sources/qetgraphicsitem/terminal.h index f3e94a548..095cb543a 100644 --- a/sources/qetgraphicsitem/terminal.h +++ b/sources/qetgraphicsitem/terminal.h @@ -169,6 +169,6 @@ inline QString Terminal::name() const { return(name_terminal_); } -Terminal * relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram = true); +QList relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram = true); #endif