diff options
author | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-15 10:48:54 (GMT) |
---|---|---|
committer | Mateusz Piekos <mateuszpiekos@gmail.com> | 2012-06-15 10:48:54 (GMT) |
commit | 1dc6b7f7a3d96df848edad85c0d07d99340e3a3e (patch) | |
tree | db68d9c342293b18ce982a1eccbebde307ad0773 /Swift/QtUI | |
parent | 70de68383506430c297056cd3389595fc696df1e (diff) | |
download | swift-contrib-1dc6b7f7a3d96df848edad85c0d07d99340e3a3e.zip swift-contrib-1dc6b7f7a3d96df848edad85c0d07d99340e3a3e.tar.bz2 |
Moved serialization of elements to WhiteboardSerializer
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp index 3ea09ef..80c4447 100644 --- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp +++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp @@ -9,9 +9,11 @@ #include <iostream> #include <boost/bind.hpp> +#include <boost/smart_ptr/make_shared.hpp> #include <Swiften/Whiteboard/WhiteboardSession.h> #include <Swiften/Elements/WhiteboardPayload.h> +#include <Swiften/Whiteboard/Elements/WhiteboardLineElement.h> #include <QMessageBox> using namespace std; @@ -245,10 +247,13 @@ namespace Swift { QGraphicsLineItem* lineItem = qgraphicsitem_cast<QGraphicsLineItem*>(item); if (lineItem != 0) { QLine line = lineItem->line().toLine(); - std::stringstream stream; +/* std::stringstream stream; stream << "L"; stream << line.x1() << "," << line.y1() << "," << line.x2() << "," << line.y2(); - stream >> serialized; + stream >> serialized;*/ + WhiteboardLineElement::ref element = boost::make_shared<WhiteboardLineElement>(line.x1(), line.y1(), line.x2(), line.y2()); + whiteboardSession_->sendElement(element); + } FreehandLineItem* freehandLineItem = qgraphicsitem_cast<FreehandLineItem*>(item); if (freehandLineItem != 0) { |