From b4d8a8b7f7b59c281bcaabfadb69ed37f1c827e3 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 10 May 2021 08:02:06 +0000 Subject: library: fixed table cleanup git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@10000 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/library/library.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/General/library/library.cpp b/src/plugins/General/library/library.cpp index f9ac5d9ed..83ff8c0ed 100644 --- a/src/plugins/General/library/library.cpp +++ b/src/plugins/General/library/library.cpp @@ -84,11 +84,13 @@ Library::Library(QPointer *libraryWidget, QObject *parent) : if(settings.value("Library/recreate_db", false).toBool()) { settings.setValue("Library/recreate_db", false); - { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", CONNECTION_NAME); + db.setDatabaseName(Qmmp::configDir() + "/" + "library.sqlite"); db.open(); db.exec("DELETE FROM track_library"); + db.exec("REINDEX track_library"); + db.exec("VACUUM"); db.close(); } QSqlDatabase::removeDatabase(CONNECTION_NAME); -- cgit v1.2.3-13-gbd6f