foreach (int row, rowList) { bool ok; int id = this->item(row, 0)->text().toInt(&ok); if (!ok) continue; QString fileName, hashName; QDateTime dateAdded; MetadataEngine::getInstance().getContentFile(id, fileName, hashName, dateAdded); QString filePath = fm.getFilesDirectory() + hashName; if (filePath.isEmpty()) continue; fileList.append(filePath); }