From f46962686a0648abe06bea699365740546107a70 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 16 Jan 2021 22:06:20 +0100 Subject: Fix drag&drop in manual installer after drag&drop of download/external archive in mod list. --- src/modlistview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index cb1d2842..526e9c33 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -829,13 +829,16 @@ void ModListView::setup(OrganizerCore& core, CategoryFactory& factory, MainWindo // prevent the name-column from being hidden header()->setSectionHidden(ModList::COL_NAME, false); - connect(m_core->modList(), &ModList::downloadArchiveDropped, [=](int row, int priority) { + // we need QueuedConnection for the download/archive dropped otherwise the + // installation starts within the drop-event and it's not possible to drag&drop + // in the manual installer + connect(m_core->modList(), &ModList::downloadArchiveDropped, this, [=](int row, int priority) { m_core->installDownload(row, priority); - }); - connect(m_core->modList(), &ModList::externalArchiveDropped, [=](const QUrl& url, int priority) { + }, Qt::QueuedConnection); + connect(m_core->modList(), &ModList::externalArchiveDropped, this, [=](const QUrl& url, int priority) { setWindowState(Qt::WindowActive); m_core->installArchive(url.toLocalFile(), priority, false, nullptr); - }); + }, Qt::QueuedConnection); connect(m_core->modList(), &ModList::externalFolderDropped, this, &ModListView::onExternalFolderDropped); connect(selectionModel(), &QItemSelectionModel::selectionChanged, [=] { m_refreshMarkersTimer.start(); }); -- cgit v1.3.1