mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 13:58:51 +03:00
Fix possible crashes. Closes #1814.
This commit is contained in:
parent
397268d4cc
commit
08e14cdc26
2 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTimer>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <libtorrent/version.hpp>
|
#include <libtorrent/version.hpp>
|
||||||
|
|
||||||
|
@ -378,6 +377,8 @@ void AddNewTorrentDialog::renameSelectedFile()
|
||||||
if (selectedIndexes.size() != 1)
|
if (selectedIndexes.size() != 1)
|
||||||
return;
|
return;
|
||||||
const QModelIndex &index = selectedIndexes.first();
|
const QModelIndex &index = selectedIndexes.first();
|
||||||
|
if (!index.isValid())
|
||||||
|
return;
|
||||||
// Ask for new name
|
// Ask for new name
|
||||||
bool ok;
|
bool ok;
|
||||||
const QString new_name_last = AutoExpandableDialog::getText(this, tr("Rename the file"),
|
const QString new_name_last = AutoExpandableDialog::getText(this, tr("Rename the file"),
|
||||||
|
|
|
@ -536,6 +536,8 @@ void PropertiesWidget::renameSelectedFile() {
|
||||||
if (selectedIndexes.size() != 1)
|
if (selectedIndexes.size() != 1)
|
||||||
return;
|
return;
|
||||||
const QModelIndex index = selectedIndexes.first();
|
const QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid())
|
||||||
|
return;
|
||||||
// Ask for new name
|
// Ask for new name
|
||||||
bool ok;
|
bool ok;
|
||||||
QString new_name_last = AutoExpandableDialog::getText(this, tr("Rename the file"),
|
QString new_name_last = AutoExpandableDialog::getText(this, tr("Rename the file"),
|
||||||
|
|
Loading…
Reference in a new issue