mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
QsLog
YACReader
YACReaderLibrary
YACReaderLibraryServer
YACReaderLibraryServer.pro
console_ui_library_creator.cpp
console_ui_library_creator.h
headless_config.pri
images.qrc
libraries_updater.cpp
libraries_updater.h
main.cpp
systemd_instructions.txt
yacreaderlibraryserver.service
ci
common
compressed_archive
custom_widgets
dependencies
files
images
release
shortcuts_management
tests
.clang-format
.editorconfig
.gitattributes
.gitignore
CHANGELOG.md
COPYING.txt
INSTALL.md
README.md
YACReader.1
YACReader.desktop
YACReader.pro
YACReader.svg
YACReaderLibrary.1
YACReaderLibrary.desktop
YACReaderLibrary.svg
azure-pipelines-build-number.yml
azure-pipelines-windows-template.yml
azure-pipelines.yml
background.png
background@2x.png
cleanOSX.sh
compileOSX.sh
config.pri
dmg.json
icon.icns
mktarball.sh
signapps.sh
34 lines
876 B
C++
34 lines
876 B
C++
#include "libraries_updater.h"
|
|
|
|
#include "yacreader_libraries.h"
|
|
#include "data_base_management.h"
|
|
|
|
LibrariesUpdater::LibrariesUpdater()
|
|
{
|
|
}
|
|
|
|
void LibrariesUpdater::updateIfNeeded()
|
|
{
|
|
YACReaderLibraries libraries;
|
|
|
|
libraries.load();
|
|
|
|
foreach (QString name, libraries.getNames()) {
|
|
QString path = libraries.getPath(name) + "/.yacreaderlibrary";
|
|
|
|
QDir d;
|
|
|
|
QString dbVersion;
|
|
if (d.exists(path) && d.exists(path + "/library.ydb") && (dbVersion = DataBaseManagement::checkValidDB(path + "/library.ydb")) != "") {
|
|
int comparation = DataBaseManagement::compareVersions(dbVersion, VERSION);
|
|
|
|
if (comparation < 0) {
|
|
bool updated = DataBaseManagement::updateToCurrentVersion(path);
|
|
if (!updated) {
|
|
//TODO log error
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|