Index: trunk/BNS/bns.cpp
===================================================================
--- trunk/BNS/bns.cpp	(revision 756)
+++ trunk/BNS/bns.cpp	(revision 756)
@@ -0,0 +1,45 @@
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Server
+ * -------------------------------------------------------------------------
+ *
+ * Class:      bns
+ *
+ * Purpose:    This class implements the main application behaviour
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Mar-2008
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "bns.h" 
+
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+bns::bns(QObject* parent) : QThread(parent) {
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+bns::~bns() {
+}
+
+// Write a Program Message
+////////////////////////////////////////////////////////////////////////////
+void bns::slotMessage(const QByteArray msg) {
+  QMutexLocker locker(&_mutex);
+  cout << msg.data() << endl;
+}
+
+// Start 
+////////////////////////////////////////////////////////////////////////////
+void bns::run() {
+  slotMessage("============ Start BNS ============");
+}
+
Index: trunk/BNS/bns.h
===================================================================
--- trunk/BNS/bns.h	(revision 756)
+++ trunk/BNS/bns.h	(revision 756)
@@ -0,0 +1,25 @@
+#ifndef BNS_H
+#define BNS_H
+
+#include <QApplication>
+#include <QThread>
+#include <QMutex>
+
+class bns : public QThread {
+  Q_OBJECT
+ public:
+  bns(QObject* parent = 0);
+  virtual ~bns();  
+  virtual void run();  
+
+ protected:
+
+ public slots:
+  void slotMessage(const QByteArray msg);
+    
+ private slots:
+ 
+ private:
+  QMutex _mutex;
+};
+#endif
Index: trunk/BNS/bns.pro
===================================================================
--- trunk/BNS/bns.pro	(revision 755)
+++ trunk/BNS/bns.pro	(revision 756)
@@ -21,7 +21,7 @@
 release:MOC_DIR=.moc/release
 
-HEADERS =             bnsapp.h   bnswindow.h   bnshlpdlg.h   bnshtml.h
+HEADERS =             bns.h   bnswindow.h   bnshlpdlg.h   bnshtml.h
 
-SOURCES = bnsmain.cpp bnsapp.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp
+SOURCES = bnsmain.cpp bns.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp
 
 RC_FILE = bns.rc
Index: trunk/BNS/bnsmain.cpp
===================================================================
--- trunk/BNS/bnsmain.cpp	(revision 755)
+++ trunk/BNS/bnsmain.cpp	(revision 756)
@@ -15,17 +15,10 @@
  * -----------------------------------------------------------------------*/
 
-#include <unistd.h>
-#include <signal.h>
 #include <iostream>
 
-#include "bnsapp.h"
+#include "bns.h"
 #include "bnswindow.h"
 
 using namespace std;
-
-void catch_signal(int) {
-  cout << "Program Interrupted by Ctrl-C" << endl;
-  ((bnsApp*)qApp)->slotQuit();
-}
 
 // Main Program
@@ -41,15 +34,9 @@
   }
 
-  QCoreApplication::setOrganizationName("BKG");
-  QCoreApplication::setOrganizationDomain("www.bkg.bund.de");
-  QCoreApplication::setApplicationName("BKG_NTRIP_Server");
+  QApplication app(argc, argv, GUIenabled);
 
-  // Default Settings
-  // ----------------
-  QSettings settings;
-  if (settings.allKeys().size() == 0) {
-  }
-
-  bnsApp app(argc, argv, GUIenabled);
+  app.setOrganizationName("BKG");
+  app.setOrganizationDomain("www.bkg.bund.de");
+  app.setApplicationName("BKG_NTRIP_Server");
 
   // Interactive Mode - open the main window
@@ -63,10 +50,7 @@
   // ----------------------------
   else {
-    cerr << "non-interactive mode not yet implemented" << endl;
-    exit(0);
+
   }
 
-  // Start the application
-  // ---------------------
   return app.exec();
 }
Index: trunk/BNS/bnswindow.cpp
===================================================================
--- trunk/BNS/bnswindow.cpp	(revision 755)
+++ trunk/BNS/bnswindow.cpp	(revision 756)
@@ -19,5 +19,4 @@
 
 #include "bnswindow.h" 
-#include "bnsapp.h" 
 #include "bnshlpdlg.h" 
 
@@ -271,6 +270,4 @@
 void bnsWindow::slotMessage(const QByteArray msg) {
 
-  ((bnsApp*)qApp)->slotMessage(msg);
-
   const int maxBufferSize = 10000;
  
@@ -290,5 +287,4 @@
     _actStart->setEnabled(true);
     _actStop->setEnabled(false);
-    ((bnsApp*)qApp)->stop();
   }
 }
@@ -304,4 +300,3 @@
   slotMessage("============ Start BNS ============");
 
-  ((bnsApp*)qApp)->start();
-}
+}
