Index: trunk/BNC/src/rinex/bncpostprocess.cpp
===================================================================
--- trunk/BNC/src/rinex/bncpostprocess.cpp	(revision 4748)
+++ trunk/BNC/src/rinex/bncpostprocess.cpp	(revision 5066)
@@ -98,5 +98,5 @@
   }
   else {
-    ((bncApp*) qApp)->slotMessage(msg, false);
+    PGM_CORE->slotMessage(msg, false);
   }
 }
@@ -222,7 +222,6 @@
   }
 
-  bncApp* app = (bncApp*) qApp;
-  if ( app->mode() != bncApp::interactive) {
-    app->exit(0);
+  if (PGM_CORE->mode() != t_pgmCore::interactive) {
+    qApp->exit(0);
   }
   else {
Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 4748)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 5066)
@@ -101,7 +101,6 @@
   delete _log;     _log     = 0;
   delete _logFile; _logFile = 0;
-  bncApp* app = (bncApp*) qApp;
-  if ( app->mode() != bncApp::interactive) {
-    app->exit(0);
+  if (PGM_CORE->mode() != t_pgmCore::interactive) {
+    qApp->exit(0);
   }
 }
@@ -117,6 +116,5 @@
                                    double maxValue) {
 
-  bncApp* app = dynamic_cast<bncApp*>(qApp);
-  if (app->GUIenabled()) {
+  if (PGM_CORE->GUIenabled()) {
 
     if (maxValue == 0.0) {
@@ -144,5 +142,5 @@
     if (data1) {
       t_polarPlot* plot1 = new t_polarPlot(QwtText(title1), scaleInterval,
-                                          app->mainWindow());
+                                          PGM_CORE->mainWindow());
       plot1->addCurve(data1);
       plots << plot1;
@@ -150,5 +148,5 @@
     if (data2) {
       t_polarPlot* plot2 = new t_polarPlot(QwtText(title2), scaleInterval,
-                                           app->mainWindow());
+                                           PGM_CORE->mainWindow());
       plot2->addCurve(data2);
       plots << plot2;
@@ -298,5 +296,5 @@
   // Show the plots
   // --------------
-  if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) {
+  if (PGM_CORE->GUIenabled()) {
     QFileInfo  fileInfo(obsFile->fileName());
     QByteArray title = fileInfo.fileName().toAscii();
@@ -653,5 +651,5 @@
                                      const QByteArray& title) {
 
-  if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) {
+  if (PGM_CORE->GUIenabled()) {
     t_availPlot* plotA = new t_availPlot(0, &_availDataMap);
     plotA->setTitle(title);
Index: trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcedit.cpp	(revision 4748)
+++ trunk/BNC/src/rinex/reqcedit.cpp	(revision 5066)
@@ -103,6 +103,4 @@
   // ---------------
   if (_log) {
-    bncApp* app = (bncApp*) qApp;
-
     *_log << QByteArray(78, '-') << endl;
     *_log << "Concatenation of RINEX Observation and/or Navigation Files\n";
@@ -110,7 +108,7 @@
 
     *_log << QByteArray("Program").leftJustified(15) << ": "
-          << app->pgmName() << endl;
+          << PGM_CORE->pgmName() << endl;
     *_log << QByteArray("Run by").leftJustified(15) << ": "
-          << app->userName() << endl;
+          << PGM_CORE->userName() << endl;
     *_log << QByteArray("Date").leftJustified(15) << ": "
           << QDateTime::currentDateTime().toUTC().toString("yyyy-MM-dd hh:mm:ss") << endl;
@@ -148,7 +146,6 @@
   // Exit (thread)
   // -------------
-  bncApp* app = (bncApp*) qApp;
-  if ( app->mode() != bncApp::interactive) {
-    app->exit(0);
+  if (PGM_CORE->mode() != t_pgmCore::interactive) {
+    qApp->exit(0);
   }
   else {
Index: trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 4748)
+++ trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 5066)
@@ -241,7 +241,5 @@
 void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap) {
 
-  bncApp* app = (bncApp*) qApp;
-
-  QString     runBy = app->userName();
+  QString     runBy = PGM_CORE->userName();
   QStringList comments;
 
@@ -277,5 +275,5 @@
                                             : "yyyyMMdd hhmmss UTC";
   *_stream << QString("%1%2%3")
-    .arg(app->pgmName(), -20)
+    .arg(PGM_CORE->pgmName(), -20)
     .arg(runBy.trimmed().left(20), -20)
     .arg(QDateTime::currentDateTime().toUTC().toString(fmtDate), -20)
Index: trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 4748)
+++ trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 5066)
@@ -212,8 +212,6 @@
                            const QMap<QString, QString>* txtMap) const {
 
-  bncApp* app = (bncApp*) qApp;
-
   QStringList newComments;
-  QString     runBy = app->userName();
+  QString     runBy = PGM_CORE->userName();
 
   if (txtMap) {
@@ -238,5 +236,5 @@
                                                   : "yyyyMMdd hhmmss UTC";
   *stream << QString("%1%2%3")
-    .arg(app->pgmName(), -20)
+    .arg(PGM_CORE->pgmName(), -20)
     .arg(runBy.trimmed().left(20), -20)
     .arg(QDateTime::currentDateTime().toUTC().toString(fmtDate), -20)
