]> www.vanbest.org Git - sasc-ng.git/commitdiff
constcw: fix key compare (2)
authorleslie <unknown>
Mon, 11 Aug 2008 12:06:47 +0000 (20:06 +0800)
committerleslie <unknown>
Mon, 11 Aug 2008 12:06:47 +0000 (20:06 +0800)
data.c
data.h
systems/constcw/constcw.c

diff --git a/data.c b/data.c
index 61a2865d057e4dfa0d8a52e55d9bbf7787708627..4b6e3ef59f17ccee0b5f3556ca9861ac06f56132 100644 (file)
--- a/data.c
+++ b/data.c
@@ -876,13 +876,14 @@ bool cPlainKeys::AddNewKey(cPlainKey *nk, const char *reason)
 {
   cPlainKey *k;
   for(k=0; (k=FindKeyNoTrig(nk->type,nk->id,nk->keynr,-1,k)); )
-    if(k->Cmp(nk)) return false;
+    if(k->CmpExtId(nk) && k->Cmp(nk)) return false;
 
   cPlainKey *ref=0;
   cString ks=nk->ToString(true);
   PRINTF(L_GEN_INFO,"key update for ID %s",*ks);
   ums.Queue("%s %s",tr("Key update"),*ks);
   for(k=0; (k=FindKeyNoTrig(nk->type,nk->id,nk->keynr,nk->Size(),k)); ) {
+    if(!k->CmpExtId(nk)) continue;
     if(nk->CanSupersede()) {
       PRINTF(L_GEN_INFO,"supersedes key: %s",*k->ToString(true));
       DelItem(k,ScSetup.SuperKeys==0);
diff --git a/data.h b/data.h
index 8065f9101876081d4fbfba30fe25081c9d1e419d..1f6c7d341973707a73999c3ccf25bede6bff7335 100644 (file)
--- a/data.h
+++ b/data.h
@@ -263,6 +263,7 @@ protected:
   virtual int IdSize(void);
   virtual cString Print(void)=0;
   virtual cString PrintKeyNr(void);
+  virtual bool CmpExtId(cPlainKey *k) { return true; }
 public:
   int type, id, keynr;
   //
index aa95ee12168118c4ec46a555ab7c5a9d9b42401f..e6c6003366ef1cbba35e2417fabd6ad851d7a014 100644 (file)
@@ -44,9 +44,9 @@ private:
   int freq;
   char pol;
 protected:
-  virtual bool Cmp(cPlainKey *k);
   virtual int IdSize(void) { return 4; }
   virtual cString PrintKeyNr(void);
+  virtual bool CmpExtId(cPlainKey *k);
 public:
   cPlainKeyConstCw(bool Super);
   virtual bool Parse(const char *line);
@@ -61,10 +61,10 @@ cPlainKeyConstCw::cPlainKeyConstCw(bool Super)
   freq=-1;
 }
 
-bool cPlainKeyConstCw::Cmp(cPlainKey *k)
+bool cPlainKeyConstCw::CmpExtId(cPlainKey *k)
 {
   cPlainKeyConstCw *ck=dynamic_cast<cPlainKeyConstCw *>(k); // downcast
-  return ck && prgId==ck->prgId && source==ck->source && freq==ck->freq && pol==ck->pol && cHexKey::Cmp(k);
+  return ck && prgId==ck->prgId && source==ck->source && freq==ck->freq && pol==ck->pol;
 }
 
 bool cPlainKeyConstCw::Matches(const cEcmInfo *ecm)