mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
Add static methods to get the data paths in a library
This commit is contained in:
@ -228,7 +228,7 @@ QString YACReaderLibrary::getPath() const
|
||||
|
||||
QString YACReaderLibrary::getDBPath() const
|
||||
{
|
||||
return path + "/.yacreaderlibrary";
|
||||
return YACReaderLibrary::libraryDataPath(path);
|
||||
}
|
||||
|
||||
int YACReaderLibrary::getLegacyId() const
|
||||
@ -251,6 +251,21 @@ bool YACReaderLibrary::operator!=(const YACReaderLibrary &other) const
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
QString YACReaderLibrary::libraryDataPath(const QString &libraryPath)
|
||||
{
|
||||
return QDir(libraryPath).filePath(".yacreaderlibrary");
|
||||
}
|
||||
|
||||
QString YACReaderLibrary::libraryDatabasePath(const QString &libraryPath)
|
||||
{
|
||||
return QDir(YACReaderLibrary::libraryDataPath(libraryPath)).filePath("library.ydb");
|
||||
}
|
||||
|
||||
QString YACReaderLibrary::libraryCoversFolderPath(const QString &libraryPath)
|
||||
{
|
||||
return QDir(YACReaderLibrary::libraryDataPath(libraryPath)).filePath("covers");
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const YACReaderLibrary &library)
|
||||
{
|
||||
out << library.name << library.path << library.legacyId << library.id;
|
||||
|
Reference in New Issue
Block a user