Browse Source

Merge pull request #3234 from glassez/openfile

Fix crash when cancel open file dialog.
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
061fbeff56
  1. 2
      src/gui/mainwindow.cpp

2
src/gui/mainwindow.cpp

@ -1028,6 +1028,7 @@ void MainWindow::on_actionOpen_triggered()
QFileDialog::getOpenFileNames(0, tr("Open Torrent Files"), pref->getMainLastDir(), QFileDialog::getOpenFileNames(0, tr("Open Torrent Files"), pref->getMainLastDir(),
tr("Torrent Files") + QString::fromUtf8(" (*.torrent)")); tr("Torrent Files") + QString::fromUtf8(" (*.torrent)"));
const bool useTorrentAdditionDialog = Preferences::instance()->useAdditionDialog(); const bool useTorrentAdditionDialog = Preferences::instance()->useAdditionDialog();
if (!pathsList.isEmpty()) {
foreach (QString file, pathsList) { foreach (QString file, pathsList) {
qDebug("Dropped file %s on download list", qPrintable(file)); qDebug("Dropped file %s on download list", qPrintable(file));
if (useTorrentAdditionDialog) if (useTorrentAdditionDialog)
@ -1041,6 +1042,7 @@ void MainWindow::on_actionOpen_triggered()
top_dir.removeLast(); top_dir.removeLast();
pref->setMainLastDir(Utils::Fs::fromNativePath(top_dir.join("/"))); pref->setMainLastDir(Utils::Fs::fromNativePath(top_dir.join("/")));
} }
}
void MainWindow::activate() void MainWindow::activate()
{ {

Loading…
Cancel
Save