settings" selected.
#include "trace.h"
#include "settings.h"
#include "toolbuttonbox.h"
+#include "bookdb.h"
DevTools::DevTools(QWidget *parent): Dyalog(parent, false)
{
"application will be restarted. Continue?"),
QMessageBox::Yes | QMessageBox::No)) {
QSettings().clear();
+ BookDb::instance()->removeAll();
QApplication::exit(1000);
}
}
void BookDb::remove(const QString &book)
{
- // FIXME
- Q_UNUSED(book);
+ Trace t("BookDb::remove");
+ qDebug() << book;
+ QSqlQuery query("delete from book where name = ?");
+ query.bindValue(0, book);
+ if (!query.exec()) {
+ qCritical() << "Query failed:" << query.lastError().text();
+ }
}
QStringList BookDb::books()
qDebug() << ret;
return ret;
}
+
+void BookDb::removeAll()
+{
+ foreach (QString book, books()) {
+ remove(book);
+ }
+}
QVariantHash load(const QString &book);
void save(const QString &book, const QVariantHash &data);
void remove(const QString &book);
+ void removeAll();
QStringList books();
private:
* Fix sorting of library
* Fix book view kinetic scrolling on Symbian
- * Failed attempt to add kinetic scrolling to lists on Symbian
* Fix database creation on Symbian
* Bookmarks to have notes
+ * Actually delete books from database
-- Akos Polster <akos@pipacs.com> Sat, 10 Oct 2010 02:00:00 +0200