Core: Use ModuleIO in MainWindow::loadUrls

This commit is contained in:
wmayer
2024-10-22 22:41:38 -05:00
committed by Chris Hennes
parent 6df7231cfb
commit 25bfdc92c8
+2 -6
View File
@@ -92,6 +92,7 @@
#include "DownloadManager.h"
#include "FileDialog.h"
#include "MenuManager.h"
#include "ModuleIO.h"
#include "NotificationArea.h"
#include "OverlayManager.h"
#include "ProgressBar.h"
@@ -2428,12 +2429,7 @@ void MainWindow::loadUrls(App::Document* doc, const QList<QUrl>& urls)
}
QByteArray docName = doc ? QByteArray(doc->getName()) : qApp->translate("StdCmdNew","Unnamed").toUtf8();
SelectModule::Dict dict = SelectModule::importHandler(files);
// load the files with the associated modules
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
// if the passed document name doesn't exist the module should create it, if needed
Application::Instance->importFrom(it.key().toUtf8(), docName, it.value().toLatin1());
}
ModuleIO::importFiles(files, docName);
}
void MainWindow::changeEvent(QEvent *e)