Don't display warning when folder named stayed the same.

Copy some code from AddNewTorrent dialog and beautify a bit.
Closes #4970.
This commit is contained in:
sledgehammer999 2016-03-18 00:54:10 +02:00
parent 7794502324
commit 2bb76bf781
2 changed files with 27 additions and 22 deletions

View file

@ -501,6 +501,10 @@ void AddNewTorrentDialog::renameSelectedFile()
path_items.removeLast();
path_items << new_name_last;
QString new_path = path_items.join("/");
if (Utils::Fs::sameFileNames(old_path, new_path)) {
qDebug("Name did not change");
return;
}
if (!new_path.endsWith("/")) new_path += "/";
// Check for overwriting
for (int i = 0; i < m_torrentInfo.filesCount(); ++i) {