Commit 3dccd031 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Merge branch 'Applications/16.04'

parents 4a80c659 0d16e7d0
...@@ -224,15 +224,20 @@ void MainWindow::openArchive() ...@@ -224,15 +224,20 @@ void MainWindow::openArchive()
Q_UNUSED(iface); Q_UNUSED(iface);
Kerfuffle::PluginManager pluginManager; Kerfuffle::PluginManager pluginManager;
QPointer<QFileDialog> dlg = new QFileDialog(this, i18nc("to open an archive", "Open Archive")); auto dlg = new QFileDialog(this, i18nc("to open an archive", "Open Archive"));
dlg->setMimeTypeFilters(pluginManager.supportedMimeTypes());
dlg->setMimeTypeFilters(pluginManager.supportedMimeTypes());
dlg->setFileMode(QFileDialog::ExistingFile); dlg->setFileMode(QFileDialog::ExistingFile);
dlg->setAcceptMode(QFileDialog::AcceptOpen); dlg->setAcceptMode(QFileDialog::AcceptOpen);
if (dlg->exec() == QDialog::Accepted) {
openUrl(dlg->selectedUrls().first()); connect(dlg, &QDialog::finished, this, [this, dlg](int result) {
} if (result == QDialog::Accepted) {
delete dlg; openUrl(dlg->selectedUrls().first());
}
dlg->deleteLater();
});
dlg->open();
} }
void MainWindow::openUrl(const QUrl& url) void MainWindow::openUrl(const QUrl& url)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment