From cf975b31760d9103429ec9a8a8e5d3fad2c168a3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 18 Sep 2015 19:48:10 +0200 Subject: [PATCH] GUI: merge: fix infinite loop adding new settings after dropping files --- src/mkvtoolnix-gui/merge/input.cpp | 5 +++++ src/mkvtoolnix-gui/merge/tab.h | 1 + src/mkvtoolnix-gui/merge/tool.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mkvtoolnix-gui/merge/input.cpp b/src/mkvtoolnix-gui/merge/input.cpp index b245bb426..2a6b7a142 100644 --- a/src/mkvtoolnix-gui/merge/input.cpp +++ b/src/mkvtoolnix-gui/merge/input.cpp @@ -788,6 +788,11 @@ Tab::addOrAppendFiles(bool append) { addOrAppendFiles(append, fileNames, selectedSourceFile()); } +void +Tab::addFiles(QStringList const &fileNames) { + addOrAppendFiles(false, fileNames, QModelIndex{}); +} + void Tab::addOrAppendFiles(bool append, QStringList const &fileNames, diff --git a/src/mkvtoolnix-gui/merge/tab.h b/src/mkvtoolnix-gui/merge/tab.h index ad21fb28a..5fbe48a74 100644 --- a/src/mkvtoolnix-gui/merge/tab.h +++ b/src/mkvtoolnix-gui/merge/tab.h @@ -63,6 +63,7 @@ public: virtual QString title() const; virtual void load(QString const &fileName); virtual void cloneConfig(MuxConfig const &config); + virtual void addFiles(QStringList const &fileNames); signals: void removeThisTab(); diff --git a/src/mkvtoolnix-gui/merge/tool.cpp b/src/mkvtoolnix-gui/merge/tool.cpp index 642c91de8..af82e9f69 100644 --- a/src/mkvtoolnix-gui/merge/tool.cpp +++ b/src/mkvtoolnix-gui/merge/tool.cpp @@ -329,7 +329,7 @@ Tool::addMultipleFilesToNewSettings(QStringList const &fileNames, auto tab = currentTab(); Q_ASSERT(!!tab); - tab->addFilesToBeAddedOrAppendedDelayed(fileNamesToAdd); + tab->addFiles(fileNamesToAdd); } }