mirror of https://github.com/procxx/kepka.git
				
				
				
			Fix saving cache from InMemoryLocation.
This commit is contained in:
		
							parent
							
								
									74ef8104a7
								
							
						
					
					
						commit
						b35b6c4449
					
				| 
						 | 
					@ -31,7 +31,7 @@ void UpdateCloudFile(
 | 
				
			||||||
	if (!update) {
 | 
						if (!update) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	const auto cacheBytes = !data.bytes.isEmpty()
 | 
						auto cacheBytes = !data.bytes.isEmpty()
 | 
				
			||||||
		? data.bytes
 | 
							? data.bytes
 | 
				
			||||||
		: file.location.file().data.is<InMemoryLocation>()
 | 
							: file.location.file().data.is<InMemoryLocation>()
 | 
				
			||||||
		? file.location.file().data.get_unchecked<InMemoryLocation>().bytes
 | 
							? file.location.file().data.get_unchecked<InMemoryLocation>().bytes
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@ void UpdateCloudFile(
 | 
				
			||||||
			cache.putIfEmpty(
 | 
								cache.putIfEmpty(
 | 
				
			||||||
				cacheKey,
 | 
									cacheKey,
 | 
				
			||||||
				Storage::Cache::Database::TaggedValue(
 | 
									Storage::Cache::Database::TaggedValue(
 | 
				
			||||||
					base::duplicate(data.bytes),
 | 
										std::move(cacheBytes),
 | 
				
			||||||
					Data::kImageCacheTag));
 | 
										Data::kImageCacheTag));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -378,8 +378,6 @@ struct PlainUrlLocation {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct InMemoryLocation {
 | 
					struct InMemoryLocation {
 | 
				
			||||||
	~InMemoryLocation() = default;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	QByteArray bytes;
 | 
						QByteArray bytes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	friend inline bool operator==(
 | 
						friend inline bool operator==(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue