Index: /trunk/BNC/src/bnccore.cpp
===================================================================
--- /trunk/BNC/src/bnccore.cpp	(revision 6519)
+++ /trunk/BNC/src/bnccore.cpp	(revision 6520)
@@ -204,18 +204,23 @@
 }
 
+// 
+////////////////////////////////////////////////////////////////////////////
+t_irc t_bncCore::checkPrintEph(t_eph* eph) {
+  QMutexLocker locker(&_mutex);
+  t_irc ircPut = _ephUser.putNewEph(eph, true);
+  if (eph->checkState() == t_eph::bad) {
+    return failure;
+  }
+  printEphHeader();
+  printEph(*eph, (ircPut == success));
+  return success;
+}
+
 // New GPS Ephemeris 
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGPSEph(t_ephGPS eph) {
-  QMutexLocker locker(&_mutex);
-
-  t_irc irc = _ephUser.putNewEph(&eph, true);
-  if (eph.checkState() == t_eph::bad) {
-    return;
-  }
-
-  emit newGPSEph(eph);
-
-  printEphHeader();
-  printEph(eph, (irc == success));
+  if (checkPrintEph(&eph) == success) {
+    emit newGPSEph(eph);
+  }
 }
     
@@ -223,15 +228,7 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGlonassEph(t_ephGlo eph) {
-  QMutexLocker locker(&_mutex);
-
-  t_irc irc = _ephUser.putNewEph(&eph, true);
-  if (eph.checkState() == t_eph::bad) {
-    return;
-  }
-
-  emit newGlonassEph(eph);
-
-  printEphHeader();
-  printEph(eph, (irc == success));
+  if (checkPrintEph(&eph) == success) {
+    emit newGlonassEph(eph);
+  }
 }
 
@@ -239,15 +236,7 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGalileoEph(t_ephGal eph) {
-  QMutexLocker locker(&_mutex);
-
-  t_irc irc = _ephUser.putNewEph(&eph, true);
-  if (eph.checkState() == t_eph::bad) {
-    return;
-  }
-
-  emit newGalileoEph(eph);
-
-  printEphHeader();
-  printEph(eph, (irc == success));
+  if (checkPrintEph(&eph) == success) {
+    emit newGalileoEph(eph);
+  }
 }
 
@@ -255,15 +244,7 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewSBASEph(t_ephSBAS eph) {
-  QMutexLocker locker(&_mutex);
-
-  t_irc irc = _ephUser.putNewEph(&eph, true);
-  if (eph.checkState() == t_eph::bad) {
-    return;
-  }
-
-  emit newSBASEph(eph);
-
-  printEphHeader();
-  printEph(eph, (irc == success));
+  if (checkPrintEph(&eph) == success) {
+    emit newSBASEph(eph);
+  }
 }
 
Index: /trunk/BNC/src/bnccore.h
===================================================================
--- /trunk/BNC/src/bnccore.h	(revision 6519)
+++ /trunk/BNC/src/bnccore.h	(revision 6520)
@@ -111,9 +111,10 @@
 
  private:
-  void printEphHeader();
-  void printEph(const t_eph& eph, bool printFile);
-  void printOutputEph(bool printFile, QTextStream* stream, 
-                      const QString& strV2, const QString& strV3);
-  void messagePrivate(const QByteArray& msg);
+  t_irc checkPrintEph(t_eph* eph);
+  void  printEphHeader();
+  void  printEph(const t_eph& eph, bool printFile);
+  void  printOutputEph(bool printFile, QTextStream* stream, 
+                       const QString& strV2, const QString& strV3);
+  void  messagePrivate(const QByteArray& msg);
 
   QSettings::SettingsMap _settings;
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 6519)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 6520)
@@ -185,3 +185,4 @@
     return;
   }
+
 }
