@@ -171,14 +171,16 @@ VibesWindow::processMessage(const QByteArray &msg_data)
171171 // Remove from the list of figures an delete
172172 figures.remove (fig_name);
173173 delete fig;
174+ static_cast <VibesTreeModel*>(ui->treeView ->model ())->forceUpdate ();
174175 }
175- // Create a new figure
176+ // Create a new figure
176177 else if (action == " new" )
177178 {
178179 // Create a new figure (previous with the same name will be destroyed)
179180 fig = newFigure (fig_name);
181+ static_cast <VibesTreeModel*>(ui->treeView ->model ())->forceUpdate ();
180182 }
181- // Clear the contents of a figure
183+ // Clear the contents of a figure
182184 else if (action == " clear" )
183185 {
184186 // Figure has to exist
@@ -293,7 +295,7 @@ VibesWindow::processMessage(const QByteArray &msg_data)
293295 }
294296 }
295297 }
296- // Unknown action
298+ // Unknown action
297299 else
298300 {
299301 return false ;
@@ -324,7 +326,6 @@ VibesWindow::readFile()
324326 ui->statusBar ->showMessage (" Receiving data..." , 200 );
325327
326328 // Read and process data
327- QByteArray message;
328329 while (!file.atEnd ())
329330 {
330331 QByteArray line = file.readLine ();
@@ -333,19 +334,19 @@ VibesWindow::readFile()
333334 {
334335 continue ;
335336 }
336- // Empty new line ("\n\n") is message separator
337- else if (line[0 ] == ' \n ' )
337+ // Empty new line ("\n\n") is message separator
338+ else if (line[0 ] == ' \n ' && message. endsWith ( ' \n ' ) )
338339 {
339340 processMessage (message);
340341 message.clear ();
341342 }
342- // Add this line to the current message
343+ // Add this line to the current message
343344 else
344345 {
345346 message.append (line);
346347 }
347348 }
348349
349- // Program new file-read try in 200 ms.
350- QTimer::singleShot (200 , this , SLOT (readFile ()));
350+ // Program new file-read try in 50 ms.
351+ QTimer::singleShot (50 , this , SLOT (readFile ()));
351352}
0 commit comments