mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-29 19:18:42 -07:00
Fix possible crash when changing the save path in torrent addition dialog
This commit is contained in:
parent
69661406a0
commit
3d7bf26f85
1 changed files with 5 additions and 1 deletions
|
@ -120,9 +120,13 @@ void torrentAdditionDialog::saveSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
void torrentAdditionDialog::renameTorrentNameInModel(QString file_path) {
|
||||||
|
file_path = file_path.trimmed();
|
||||||
|
if(file_path.isEmpty()) return;
|
||||||
file_path = file_path.replace("\\", "/");
|
file_path = file_path.replace("\\", "/");
|
||||||
// Rename in torrent files model too
|
// Rename in torrent files model too
|
||||||
PropListModel->setData(PropListModel->index(0, 0), file_path.split("/", QString::SkipEmptyParts).last());
|
QStringList parts = file_path.split("/", QString::SkipEmptyParts);
|
||||||
|
if(!parts.empty())
|
||||||
|
PropListModel->setData(PropListModel->index(0, 0), parts.last());
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrentAdditionDialog::limitDialogWidth() {
|
void torrentAdditionDialog::limitDialogWidth() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue