From 3feda2eb202d0591f759817086bbee6517397d23 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 21 Mar 2021 17:48:11 +0000 Subject: library: fixed regression git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9774 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/library/library.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/General/library/library.cpp b/src/plugins/General/library/library.cpp index a833e4b32..788c82811 100644 --- a/src/plugins/General/library/library.cpp +++ b/src/plugins/General/library/library.cpp @@ -72,13 +72,13 @@ Library::Library(QPointer *libraryWidget, QObject *parent) : UiHelper::instance()->addAction(refreshAction, UiHelper::TOOLS_MENU); connect(refreshAction, SIGNAL(triggered()), SLOT(startDirectoryScanning())); - connect(this, &QThread::finished, [=] { + connect(this, &QThread::finished, this, [=] { if(!m_libraryWidget->isNull()) { m_libraryWidget->data()->setBusyMode(false); m_libraryWidget->data()->refresh(); } - }); + }, Qt::QueuedConnection); if(settings.value("Library/recreate_db", false).toBool()) { @@ -246,7 +246,6 @@ bool Library::scanDirectories(const QStringList &paths) { m_stopped = false; - while(!m_stopped) { QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", CONNECTION_NAME); db.setDatabaseName(Qmmp::configDir() + "/" + "library.sqlite"); @@ -260,13 +259,12 @@ bool Library::scanDirectories(const QStringList &paths) { addDirectory(path); if(m_stopped) - { - db.close(); break; - } } - removeMissingFiles(paths); + if(!m_stopped) + removeMissingFiles(paths); + db.close(); } -- cgit v1.2.3-13-gbd6f