mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add method for getting the legacy id from the uuid
This commit is contained in:
parent
d25a122b48
commit
851215f12d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user