Browse Source

Make sure !.qB extensions are not shown in the Web UI

adaptive-webui-19844
Christophe Dumez 13 years ago
parent
commit
75a65a5f49
  1. 5
      src/webui/btjson.cpp

5
src/webui/btjson.cpp

@ -330,7 +330,10 @@ QString btjson::getFilesForTorrent(const QString& hash)
h.file_progress(fp); h.file_progress(fp);
for (int i = 0; i < h.num_files(); ++i) { for (int i = 0; i < h.num_files(); ++i) {
JsonDict file_dict; JsonDict file_dict;
file_dict.add(KEY_FILE_NAME, h.filename_at(i)); QString fileName = h.filename_at(i);
if (fileName.endsWith(".!qB", Qt::CaseInsensitive))
fileName.chop(4);
file_dict.add(KEY_FILE_NAME, fileName);
const size_type size = h.filesize_at(i); const size_type size = h.filesize_at(i);
file_dict.add(KEY_FILE_SIZE, misc::friendlyUnit(size)); file_dict.add(KEY_FILE_SIZE, misc::friendlyUnit(size));
file_dict.add(KEY_FILE_PROGRESS, (size > 0) ? (fp[i] / (double) size) : 1.); file_dict.add(KEY_FILE_PROGRESS, (size > 0) ? (fp[i] / (double) size) : 1.);

Loading…
Cancel
Save