mirror of
				https://github.com/keepassxreboot/keepassxc.git
				synced 2025-10-30 22:19:15 -04:00 
			
		
		
		
	Emit defaultKeyModified() only when the data has actually changed.
This commit is contained in:
		
							parent
							
								
									587a647c11
								
							
						
					
					
						commit
						0b592c69b0
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -46,13 +46,14 @@ void EntryAttributes::set(const QString& key, const QString& value, bool protect | |||
|     bool emitModified = false; | ||||
| 
 | ||||
|     bool addAttribute = !m_attributes.contains(key); | ||||
|     bool changeValue = !addAttribute && (m_attributes.value(key) != value); | ||||
|     bool defaultAttribute = isDefaultAttribute(key); | ||||
| 
 | ||||
|     if (addAttribute && !defaultAttribute) { | ||||
|         Q_EMIT aboutToBeAdded(key); | ||||
|     } | ||||
| 
 | ||||
|     if (addAttribute || m_attributes.value(key) != value) { | ||||
|     if (addAttribute || changeValue) { | ||||
|         m_attributes.insert(key, value); | ||||
|         emitModified = true; | ||||
|     } | ||||
|  | @ -71,7 +72,7 @@ void EntryAttributes::set(const QString& key, const QString& value, bool protect | |||
|         Q_EMIT modified(); | ||||
|     } | ||||
| 
 | ||||
|     if (defaultAttribute) { | ||||
|     if (defaultAttribute && changeValue) { | ||||
|         Q_EMIT defaultKeyModified(); | ||||
|     } | ||||
|     else if (addAttribute) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Felix Geyer
						Felix Geyer