Browse Source

Simplify code

This version saves an `if` conditional.
adaptive-webui-19844
Chocobo1 3 years ago committed by sledgehammer999
parent
commit
bf9516d164
  1. 7
      src/gui/addnewtorrentdialog.cpp

7
src/gui/addnewtorrentdialog.cpp

@ -153,11 +153,10 @@ namespace
auto pathList = settings()->loadValue<QStringList>(settingsKey); auto pathList = settings()->loadValue<QStringList>(settingsKey);
const int selectedSavePathIndex = pathList.indexOf(path); const int selectedSavePathIndex = pathList.indexOf(path);
if (selectedSavePathIndex > 0) if (selectedSavePathIndex > -1)
pathList.removeAt(selectedSavePathIndex); pathList.move(selectedSavePathIndex, 0);
if (selectedSavePathIndex != 0) else
pathList.prepend(path); pathList.prepend(path);
settings()->storeValue(settingsKey, QStringList(pathList.mid(0, maxLength))); settings()->storeValue(settingsKey, QStringList(pathList.mid(0, maxLength)));
} }
} }

Loading…
Cancel
Save