Pārlūkot izejas kodu

Call to publishSelectedData must be queued because it calls hosted app

Ivo Wolf 12 gadi atpakaļ
vecāks
revīzija
7397577987

+ 1 - 1
Applications/ctkDICOMHost/ctkDICOMHostMainLogic.cpp

@@ -32,7 +32,7 @@ ctkDICOMHostMainLogic::ctkDICOMHostMainLogic(ctkHostedAppPlaceholderWidget* plac
 
   disconnect(this->Host,SIGNAL(startProgress()),this->Host,SLOT(onStartProgress()));
   connect(this->Host,SIGNAL(appReady()),this,SLOT(onAppReady()), Qt::QueuedConnection);
-  connect(this->Host,SIGNAL(startProgress()),this,SLOT(publishSelectedData()));
+  connect(this->Host,SIGNAL(startProgress()),this,SLOT(publishSelectedData()), Qt::QueuedConnection);
   connect(this->PlaceHolderForHostedApp,SIGNAL(resized()),this,SLOT(placeHolderResized()));
 
   QTreeView * treeview = dicomAppWidget->findChild<QTreeView*>("TreeView");

+ 3 - 7
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppLogic.cpp

@@ -230,9 +230,9 @@ void ctkCommandLineModuleAppLogic::onDataAvailable()
   ui.LoadDataButton->setEnabled(true);
 
   //FIX: still does not work here: need to postpone onDataAvailable even further (not just via QueuedConnection)
-  //QStringList preferredProtocols;
-  //preferredProtocols.append("file:");
-  //OutputLocation = getHostInterface()->getOutputLocation(preferredProtocols);
+  QStringList preferredProtocols;
+  preferredProtocols.append("file:");
+  OutputLocation = getHostInterface()->getOutputLocation(preferredProtocols);
 }
 
 
@@ -251,10 +251,6 @@ void ctkCommandLineModuleAppLogic::onLoadDataClicked()
   locators = getHostInterface()->getData(uuidlist, transfersyntaxlist, false);
   qDebug() << "got locators! " << QString().setNum(locators.count());
 
-  QStringList preferredProtocols;
-  preferredProtocols.append("file:");
-  OutputLocation = getHostInterface()->getOutputLocation(preferredProtocols);
-
   QString s;
   s=s+" loc.count:"+QString().setNum(locators.count());
   if(locators.count()>0)