Changeset 260 in flair-src for trunk/tools
- Timestamp:
- Jul 26, 2018, 2:44:42 PM (6 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r258 r260 16 16 17 17 ConnectionLayout::~ConnectionLayout() { 18 } 19 20 void ConnectionLayout::udtSocketDestroyed(QObject *obj){ 21 socket=NULL; 18 22 } 19 23 … … 66 70 void ConnectionLayout::XmlToSend(QDomDocument doc) { 67 71 //fprintf(stderr,"xml to send\n%s\n",doc.toString().toLocal8Bit().constData()); 72 if(!socket) return; 68 73 69 74 // xml to send a mettre dans le manager -
trunk/tools/FlairGCS/src/ConnectionLayout.h
r248 r260 33 33 private slots: 34 34 void receive(char *buf, int size); 35 void udtSocketDestroyed(QObject *obj); 35 36 36 37 signals: -
trunk/tools/FlairGCS/src/Manager.cpp
r255 r260 154 154 connect(newLayout, SIGNAL(destroyed(QObject *)), this, SLOT(layoutDestroyed(QObject *))); 155 155 connect(udtSocket, SIGNAL(destroyed(QObject *)), this, SLOT(udtSocketDestroyed(QObject *))); 156 connect(udtSocket, SIGNAL(destroyed(QObject *)), newLayout, SLOT(udtSocketDestroyed(QObject *))); 156 157 157 158 // widget … … 187 188 void Manager::udtSocketDestroyed(QObject *obj) { 188 189 //mark socket as not valid, it can be a connection lost 189 //in this case we keep the layout for reading, and mark it as problematic 190 //in this case we keep the layout for reading, and mark it as problematic (socket=NULL) 190 191 for(int i=0;i<connections.count();i++) { 191 192 if(connections.at(i).socket==(UdtSocket *)obj) { … … 391 392 void Manager::send(void) { 392 393 for (int i = 0; i < connections.count(); i++) { 393 QDomDocument doc("remote_ui_xml"); 394 connections.at(i).layout->GetUpdateXml((QDomElement *)&doc); 395 // fprintf(stderr,"merge\n%s\n",doc.toString().toLocal8Bit().constData()); 396 397 connections.at(i).layout->XmlToSend(doc); 394 if(connections.at(i).socket!=NULL) { 395 QDomDocument doc("remote_ui_xml"); 396 connections.at(i).layout->GetUpdateXml((QDomElement *)&doc); 397 // fprintf(stderr,"merge\n%s\n",doc.toString().toLocal8Bit().constData()); 398 399 connections.at(i).layout->XmlToSend(doc); 400 } 398 401 } 399 402 }
Note:
See TracChangeset
for help on using the changeset viewer.