some tuning, specializations, basic testing

This commit is contained in:
Blue 2022-09-16 00:34:39 +03:00
parent 5f90a21fe6
commit 047f96b54a
Signed by: blue
GPG key ID: 9B203B252A63EE38
17 changed files with 370 additions and 508 deletions

View file

@ -82,9 +82,29 @@ void DataBase::open()
}
}
bool DataBase::removeDirectory()
{
if (opened) {
throw Opened(name, "");
}
QString path(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
path += "/" + getName();
QDir cache(path);
if (cache.exists()) {
return cache.removeRecursively();
} else {
return true;
}
}
QString DataBase::getName() const
{
return QString::fromStdString(name);
}
bool DataBase::ready() const
{
return opened;
}