mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Add convenience method for getting the new uuid from the legacy id
This commit is contained in:
parent
9e05f8ea6e
commit
b4951fcb1a
@ -111,6 +111,12 @@ QList<YACReaderLibrary> YACReaderLibraries::getLibraries() const
|
||||
return libraries;
|
||||
}
|
||||
|
||||
QUuid YACReaderLibraries::getLibraryIdFromLegacyId(int legacyId) const
|
||||
{
|
||||
auto library = std::find_if(libraries.cbegin(), libraries.cend(), [legacyId](const YACReaderLibrary &library) { return library.getLegacyId() == legacyId; });
|
||||
return library != libraries.cend() ? library->getId() : QUuid();
|
||||
}
|
||||
|
||||
void YACReaderLibraries::addLibrary(const QString &name, const QString &path)
|
||||
{
|
||||
int legacyId = 0;
|
||||
|
@ -25,6 +25,7 @@ public:
|
||||
int getId(const QString &name);
|
||||
YACReaderLibraries &operator=(const YACReaderLibraries &source);
|
||||
QList<YACReaderLibrary> getLibraries() const;
|
||||
QUuid getLibraryIdFromLegacyId(int legacyId) const;
|
||||
public slots:
|
||||
void addLibrary(const QString &name, const QString &path);
|
||||
void load();
|
||||
|
Loading…
Reference in New Issue
Block a user