Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 6393)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 6394)
@@ -79,12 +79,38 @@
 void bncEphUser::slotNewEphGPS(gpsephemeris gpseph) {
   QMutexLocker locker(&_mutex);
+  t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph);
+  newEphHlp(eNew);
+}
 
-  t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph);
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::slotNewEphGlonass(glonassephemeris gloeph) {
+  QMutexLocker locker(&_mutex);
+  t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);
+  newEphHlp(eNew);
+}
 
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::slotNewEphGalileo(galileoephemeris galeph) {
+  QMutexLocker locker(&_mutex);
+  t_ephGal* eNew = new t_ephGal(); eNew->set(&galeph);
+  newEphHlp(eNew);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::slotNewEphSBAS(sbasephemeris sbaseph) {
+  QMutexLocker locker(&_mutex);
+  t_ephSBAS* eNew = new t_ephSBAS(); eNew->set(&sbaseph);
+  newEphHlp(eNew);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::newEphHlp(t_eph* eNew) {
   QString prn(eNew->prn().toString().c_str());
-
   if (_eph.contains(prn)) {
-    t_ephGPS* eLast = static_cast<t_ephGPS*>(_eph.value(prn)->last);
-    if (eNew->isNewerThan(eLast)) {
+    if (eNew->isNewerThan(_eph.value(prn)->last)) {
       delete _eph.value(prn)->prev;
       _eph.value(prn)->prev = _eph.value(prn)->last;
@@ -100,56 +126,4 @@
     ephBufferChanged();
   }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncEphUser::slotNewEphGlonass(glonassephemeris gloeph) {
-  QMutexLocker locker(&_mutex);
-
-  t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);
-
-  QString prn(eNew->prn().toString().c_str());
-
-  if (_eph.contains(prn)) {
-    t_ephGlo* eLast = static_cast<t_ephGlo*>(_eph.value(prn)->last);
-    if (eNew->isNewerThan(eLast)) {
-      delete _eph.value(prn)->prev;
-      _eph.value(prn)->prev = _eph.value(prn)->last;
-      _eph.value(prn)->last = eNew;
-      ephBufferChanged();
-    }
-    else {
-      delete eNew;
-    }
-  }
-  else {
-    _eph.insert(prn, new t_ephPair(eNew));
-    ephBufferChanged();
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncEphUser::slotNewEphGalileo(galileoephemeris galeph) {
-  QMutexLocker locker(&_mutex);
-
-  QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
-
-  if (_eph.contains(prn)) {
-    t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
-    bncTime toc(galeph.Week, galeph.TOC);
-    if (eLast->TOC() < toc) {
-      delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
-      _eph.value(prn)->prev = _eph.value(prn)->last;
-      _eph.value(prn)->last = new t_ephGal();
-      static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
-    }
-  }
-  else {
-    t_ephGal* eLast = new t_ephGal();
-    eLast->set(&galeph);
-    _eph.insert(prn, new t_ephPair(eLast));
-  }
-  ephBufferChanged();
 }
 
@@ -188,28 +162,2 @@
   return irc;
 }
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncEphUser::slotNewEphSBAS(sbasephemeris sbaseph) {
-  QMutexLocker locker(&_mutex);
-
-  t_ephSBAS* eNew = new t_ephSBAS(); eNew->set(&sbaseph);
-  QString    prn  = QString(eNew->prn().toString().c_str());
-
-  if (_eph.contains(prn)) {
-    if (eNew->isNewerThan(_eph.value(prn)->last)) {
-      delete _eph.value(prn)->prev;
-      _eph.value(prn)->prev = _eph.value(prn)->last;
-      _eph.value(prn)->last = eNew;
-    }
-    else {
-      delete eNew;
-      return;
-    }
-  }
-  else {
-    _eph.insert(prn, new t_ephPair(eNew));
-  }
-  ephBufferChanged();
-}
-
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 6393)
+++ /trunk/BNC/src/bncephuser.h	(revision 6394)
@@ -75,4 +75,7 @@
   void slotNewEphSBAS(sbasephemeris sbaseph);
 
+ private:
+  void newEphHlp(t_eph* eNew);
+
  protected:
   virtual void ephBufferChanged() {}
