Index: /trunk/BNC/bnccaster.cpp
===================================================================
--- /trunk/BNC/bnccaster.cpp	(revision 190)
+++ /trunk/BNC/bnccaster.cpp	(revision 191)
@@ -72,5 +72,5 @@
     thread->terminate();
     thread->wait();
-    delete thread;
+    ////    delete thread;
   }
   delete _out;
Index: /trunk/BNC/bnctabledlg.cpp
===================================================================
--- /trunk/BNC/bnctabledlg.cpp	(revision 190)
+++ /trunk/BNC/bnctabledlg.cpp	(revision 191)
@@ -84,11 +84,14 @@
 }
 
-// Read Table from Caster
-////////////////////////////////////////////////////////////////////////////
-void bncTableDlg::slotGetTable() {
+// Read Table the caster (static)
+////////////////////////////////////////////////////////////////////////////
+t_irc bncTableDlg::getFullTable(const QString& casterHost, 
+                                int casterPort, QStringList& allLines) {
+
+  allLines.clear();
 
   QUrl url;
-  url.setHost(_casterHostLineEdit->text());
-  url.setPort(_casterPortLineEdit->text().toInt());
+  url.setHost(casterHost);
+  url.setPort(casterPort);
 
   // Send the Request
@@ -99,19 +102,17 @@
 
   if (!socket) {
-    QMessageBox::warning(0, "BNC", msg);
-    return;
+    return failure;
   }
 
   // Read Caster Response
   // --------------------
-  QStringList allLines;
   bool first = true;
   while (true) {
     if (socket->canReadLine()) {
       QString line = socket->readLine();
+      allLines.push_back(line);
       if (first) {
         first = false;
         if (line.indexOf("SOURCETABLE 200 OK") != 0) {
-	  QMessageBox::warning(0, "BNC", "Wrong Caster Response:\n" + line);
           break;
         }
@@ -121,7 +122,4 @@
           break;
         }
-        if (line.indexOf("STR") == 0) {
-          allLines.push_back(line);
-        }
       }
     }
@@ -132,5 +130,4 @@
       }
       else {
-	QMessageBox::warning(0, "BNC", "Data Timeout");
         break;
       }
@@ -138,4 +135,29 @@
   }
   delete socket;
+
+  return success;
+}
+
+// Read Table from Caster
+////////////////////////////////////////////////////////////////////////////
+void bncTableDlg::slotGetTable() {
+
+  QStringList allLines;
+
+  if ( getFullTable(_casterHostLineEdit->text(),
+                    _casterPortLineEdit->text().toInt(),
+                    allLines) != success ) {
+    QMessageBox::warning(0, "BNC", "Cannot retrieve table of data");
+    return;
+  }
+
+  QStringList lines;
+  QStringListIterator it(allLines);
+  while (it.hasNext()) {
+    QString line = it.next();
+    if (line.indexOf("STR") == 0) {
+      lines.push_back(line);
+    }
+  }
 
   static const QStringList labels = QString("mountpoint,identifier,format,"
@@ -144,13 +166,13 @@
     "misc").split(",");
 
-  if (allLines.size() > 0) {
+  if (lines.size() > 0) {
     _table->setSelectionMode(QAbstractItemView::ExtendedSelection);
     _table->setSelectionBehavior(QAbstractItemView::SelectRows);
 
-    QStringList hlp = allLines[0].split(";");
+    QStringList hlp = lines[0].split(";");
     _table->setColumnCount(hlp.size()-1);
-    _table->setRowCount(allLines.size());
-
-    QListIterator<QString> it(allLines);
+    _table->setRowCount(lines.size());
+
+    QListIterator<QString> it(lines);
     int nRow = -1;
     while (it.hasNext()) {
Index: /trunk/BNC/bnctabledlg.h
===================================================================
--- /trunk/BNC/bnctabledlg.h	(revision 190)
+++ /trunk/BNC/bnctabledlg.h	(revision 191)
@@ -3,5 +3,8 @@
 #define BNCTABLEDLG_H
 
+#include <QtCore>
 #include <QtGui>
+
+#include "bncconst.h"
 
 class bncTableDlg : public QDialog {
@@ -11,8 +14,10 @@
     bncTableDlg(QWidget* parent);
     ~bncTableDlg();
+    static t_irc getFullTable(const QString& casterHost, int casterPort,
+                              QStringList& allLines);
 
   signals:
     void newMountPoints(QStringList* mountPoints);
- 
+
   private slots:
     virtual void accept();
