From 660c7493c083f3df2419a4eaec1616a441294248 Mon Sep 17 00:00:00 2001 From: blacksun Date: Thu, 21 Mar 2019 19:42:16 +0000 Subject: [PATCH] Minor : remove unused variable git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5806 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/diagram.h | 1 - sources/diagramcommands.cpp | 5 +---- sources/diagramview.cpp | 20 +++++++++----------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/sources/diagram.h b/sources/diagram.h index 28464f8cd..3cedd53df 100644 --- a/sources/diagram.h +++ b/sources/diagram.h @@ -97,7 +97,6 @@ class Diagram : public QGraphicsScene QHash m_cnd_unitfolio_max; QHash m_cnd_tenfolio_max; QHash m_cnd_hundredfolio_max; - bool item_paste; private: QGraphicsLineItem *conductor_setter_; diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp index 6b3879c56..1f08f7c79 100644 --- a/sources/diagramcommands.cpp +++ b/sources/diagramcommands.cpp @@ -124,11 +124,8 @@ void PasteDiagramCommand::redo() else { const QList qgis_list = content.items(filter); - for (QGraphicsItem *item : qgis_list) - { - diagram->item_paste = true; + for (QGraphicsItem *item : qgis_list) { diagram->addItem(item); - diagram->item_paste = false; } } diff --git a/sources/diagramview.cpp b/sources/diagramview.cpp index 70434060c..aeea40390 100644 --- a/sources/diagramview.cpp +++ b/sources/diagramview.cpp @@ -358,11 +358,11 @@ void DiagramView::copy() { } /** - Importe les elements contenus dans le presse-papier dans le schema - @param pos coin superieur gauche (en coordonnees de la scene) du rectangle - englobant le contenu colle - @param clipboard_mode Type de presse-papier a prendre en compte -*/ + * @brief DiagramView::paste + * Import the element stored in the clipboard to the diagram. + * @param pos : top left corner of the bounding rect of imported elements + * @param clipboard_mode + */ void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) { if (!isInteractive() || m_diagram -> isReadOnly()) return; @@ -372,18 +372,16 @@ void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) { QDomDocument document_xml; if (!document_xml.setContent(texte_presse_papier)) return; - // objet pour recuperer le contenu ajoute au schema par le coller DiagramContent content_pasted; - this->diagram()->item_paste = true; - m_diagram -> fromXml(document_xml, pos, false, &content_pasted); + m_diagram->fromXml(document_xml, pos, false, &content_pasted); - // si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation - if (content_pasted.count()) { + //If something was really added to diagram, we create an undo object. + if (content_pasted.count()) + { m_diagram -> clearSelection(); m_diagram -> undoStack().push(new PasteDiagramCommand(m_diagram, content_pasted)); adjustSceneRect(); } - this->diagram()->item_paste = false; } /**