mirror of
				https://github.com/YACReader/yacreader
				synced 2025-10-31 08:14:29 -04:00 
			
		
		
		
	Add method for getting the legacy id from the uuid
This commit is contained in:
		| @ -100,6 +100,12 @@ int YACReaderLibraries::getId(const QString &name) | ||||
|     return library != libraries.cend() ? library->getLegacyId() : -1; | ||||
| } | ||||
|  | ||||
| int YACReaderLibraries::getIdFromUuid(const QUuid &uuid) | ||||
| { | ||||
|     auto library = std::find_if(libraries.cbegin(), libraries.cend(), [uuid](const YACReaderLibrary &library) { return library.getId() == uuid; }); | ||||
|     return library != libraries.cend() ? library->getLegacyId() : -1; | ||||
| } | ||||
|  | ||||
| YACReaderLibraries &YACReaderLibraries::operator=(const YACReaderLibraries &source) | ||||
| { | ||||
|     libraries = source.libraries; | ||||
|  | ||||
| @ -23,6 +23,7 @@ public: | ||||
|     void remove(const QString &name); | ||||
|     void rename(const QString &oldName, const QString &newName); | ||||
|     int getId(const QString &name); | ||||
|     int getIdFromUuid(const QUuid &uuid); | ||||
|     YACReaderLibraries &operator=(const YACReaderLibraries &source); | ||||
|     QList<YACReaderLibrary> getLibraries() const; | ||||
|     QUuid getLibraryIdFromLegacyId(int legacyId) const; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user