Delete and don't read old icon metastream when new one is available

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@212 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 17 years ago
parent d34b93f62d
commit 455e68ff60
  1. 13
      src/Kdb3Database.cpp
  2. 1
      src/Kdb3Database.h

@ -100,7 +100,8 @@ bool Kdb3Database::parseMetaStream(const StdEntry& entry){
return true; return true;
} }
else if(entry.Comment=="KPX_CUSTOM_ICONS_3"){ else if(entry.Comment=="KPX_CUSTOM_ICONS_3"){
parseCustomIconsMetaStreamV3(entry.Binary); if (!hasV4IconMetaStream)
parseCustomIconsMetaStreamV3(entry.Binary);
return true; return true;
} }
else if(entry.Comment=="KPX_CUSTOM_ICONS_2"){ else if(entry.Comment=="KPX_CUSTOM_ICONS_2"){
@ -674,9 +675,17 @@ if(!createGroupTree(Levels)){
delete [] buffer; delete [] buffer;
hasV4IconMetaStream = false;
for(int i=0;i<Entries.size();i++){
if(isMetaStream(Entries[i]) && Entries[i].Comment=="KPX_CUSTOM_ICONS_4"){
hasV4IconMetaStream = true;
break;
}
}
//Remove the metastreams from the entry list //Remove the metastreams from the entry list
for(int i=0;i<Entries.size();i++){ for(int i=0;i<Entries.size();i++){
if(isMetaStream(Entries[i])==true){ if(isMetaStream(Entries[i])){
if(!parseMetaStream(Entries[i])) if(!parseMetaStream(Entries[i]))
UnknownMetaStreams << Entries[i]; UnknownMetaStreams << Entries[i];
Entries.removeAt(i); Entries.removeAt(i);

@ -250,6 +250,7 @@ private:
quint8 RawMasterKey[32]; quint8 RawMasterKey[32];
quint8 RawMasterKey_Latin1[32]; quint8 RawMasterKey_Latin1[32];
quint8 MasterKey[32]; quint8 MasterKey[32];
bool hasV4IconMetaStream;
}; };
class KeyTransform : public QThread{ class KeyTransform : public QThread{