some tuning, specializations, basic testing
This commit is contained in:
parent
5f90a21fe6
commit
047f96b54a
17 changed files with 370 additions and 508 deletions
20
database.cpp
20
database.cpp
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue