Fixed: custom icons get lost on restart (Closes #1995561)
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@208 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
		
							parent
							
								
									90d515f6e7
								
							
						
					
					
						commit
						dc43c39ece
					
				| 
						 | 
					@ -93,11 +93,13 @@ bool Kdb3Database::parseMetaStream(const StdEntry& entry){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(entry.Comment=="KPX_GROUP_TREE_STATE"){
 | 
						if(entry.Comment=="KPX_GROUP_TREE_STATE"){
 | 
				
			||||||
		parseGroupTreeStateMetaStream(entry.Binary);
 | 
							parseGroupTreeStateMetaStream(entry.Binary);
 | 
				
			||||||
		return true;}
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(entry.Comment=="KPX_CUSTOM_ICONS_3"){
 | 
						if(entry.Comment=="KPX_CUSTOM_ICONS_3"){
 | 
				
			||||||
		parseCustomIconsMetaStream(entry.Binary);
 | 
							parseCustomIconsMetaStream(entry.Binary);
 | 
				
			||||||
		return true;}
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(entry.Comment=="KPX_CUSTOM_ICONS_2")
 | 
						if(entry.Comment=="KPX_CUSTOM_ICONS_2")
 | 
				
			||||||
		return parseCustomIconsMetaStreamV2(entry.Binary);
 | 
							return parseCustomIconsMetaStreamV2(entry.Binary);
 | 
				
			||||||
| 
						 | 
					@ -1156,10 +1158,12 @@ bool Kdb3Database::save(){
 | 
				
			||||||
	-----------------------------------------------------------------------------------*/
 | 
						-----------------------------------------------------------------------------------*/
 | 
				
			||||||
	for(int i=0;i<Groups.size();i++){
 | 
						for(int i=0;i<Groups.size();i++){
 | 
				
			||||||
		if(Groups[i].Image<builtinIcons())
 | 
							if(Groups[i].Image<builtinIcons())
 | 
				
			||||||
			Groups[i].OldImage=Groups[i].Image;}
 | 
								Groups[i].OldImage=Groups[i].Image;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	for(int i=0;i<Entries.size();i++){
 | 
						for(int i=0;i<Entries.size();i++){
 | 
				
			||||||
		if(Entries[i].Image<builtinIcons())
 | 
							if(Entries[i].Image<builtinIcons())
 | 
				
			||||||
				Entries[i].OldImage=Entries[i].Image;}
 | 
									Entries[i].OldImage=Entries[i].Image;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
/*  ----------------------------------------------------------------------------------*/
 | 
					/*  ----------------------------------------------------------------------------------*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned int FileSize;
 | 
						unsigned int FileSize;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,6 +220,7 @@ void CEditEntryDlg::OnButtonOK()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// MX-COMMENT: Should not this line go inside the if(Modflag) block?
 | 
						// MX-COMMENT: Should not this line go inside the if(Modflag) block?
 | 
				
			||||||
	entry->setImage(IconIndex);
 | 
						entry->setImage(IconIndex);
 | 
				
			||||||
 | 
						entry->setOldImage(IconIndex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(ModFlag&&EntryMoved)done(2);
 | 
						if(ModFlag&&EntryMoved)done(2);
 | 
				
			||||||
	else if(ModFlag)done(1);
 | 
						else if(ModFlag)done(1);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue