implement deletion of entries

This commit is contained in:
2020-09-27 22:28:16 +02:00
vanhempi 84cf8837bd
commit f9eff3b5b2
5 muutettua tiedostoa jossa 20 lisäystä ja 1 poistoa

Näytä tiedosto

@ -295,6 +295,16 @@ void EntryProvider::saveUserEntry(const EntryConfig &config)
}
}
bool EntryProvider::deleteUserEntry(const EntryConfig &config)
{
if(!config.userEntry || config.entryPath.isEmpty())
{
throw std::runtime_error("Only user entries can be saved");
}
QFile file { config.entryPath };
return file.remove();
}
template <class T> void assignIfDestDefault(T &dest, const T &source)
{
if(dest == T())