[Kstars-devel] KDE/kdeedu/kstars/kstars

Jasem Mutlaq mutlaqja at ikarustech.com
Fri Jan 21 09:22:12 CET 2011


SVN commit 1216077 by mutlaqja:

Comply with INDI wire protocol for sending enableBLOB. Delete temp files are fitsviewer shows them. Thank Gerry for reporting this!

CCMAIL:kstars-devel at kde.org
CCMAIL:gerryr at rozeware.com



 M  +5 -1      fitsviewer/fitsviewer.cpp  
 M  +11 -7     indi/devicemanager.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/fitsviewer/fitsviewer.cpp #1216076:1216077
@@ -151,11 +151,15 @@
 bool FITSViewer::initFITS()
 {
     /* Display image in the central widget */
-    if (image->loadFits(currentURL.path()) == -1) {
+    if (image->loadFits(currentURL.path()) == -1)
+    {
+        QFile::remove(currentURL.path());
         close();
         return false;
     }
 
+    QFile::remove(currentURL.path());
+
     /* Clear history */
     history->clear();
     /* Set new file caption */
--- trunk/KDE/kdeedu/kstars/kstars/indi/devicemanager.cpp #1216076:1216077
@@ -133,21 +133,25 @@
     QTextStream serverFP(&serverSocket);
     QString openTag;
 
-    if (device.isEmpty() == false)
-    {
+    if (device.isEmpty())
+        return;
+
         if (property.isEmpty() == false)
             openTag = QString("<enableBLOB device='%1' name='%2'>").arg(device).arg(property);
         else
             openTag = QString("<enableBLOB device='%1'>").arg(device);
-    }
-    else
-        openTag = QString("<enableBLOB>");
 
     if (enable)
+    {
         serverFP << QString("%1Also</enableBLOB>\n").arg(openTag);
+        kDebug() << QString("%1Also</enableBLOB>\n").arg(openTag);
+    }
     else
+    {
         serverFP << QString("%1Never</enableBLOB>\n").arg(openTag);
+        kDebug() << QString("%1Never</enableBLOB>\n").arg(openTag);
 }
+}
 
 void DeviceManager::connectionSuccess()
 {
@@ -157,8 +161,6 @@
         delLilXML(XMLParser);
     XMLParser = newLilXML();
 
-    enableBLOB(true);
-
     serverFP << QString("<getProperties version='%1'/>\n").arg(INDIVERSION);
 }
 
@@ -381,6 +383,8 @@
 	indi_dev.append(dp);
 	emit newDevice(dp);
 
+        enableBLOB(true, device_name);
+
 	connect(dp->stdDev, SIGNAL(newTelescope()), parent->ksw->indiDriver(), SLOT(newTelescopeDiscovered()), Qt::QueuedConnection);
 
     	/* ok */


More information about the Kstars-devel mailing list