| 74 | } |
| 75 | |
| 76 | QStringList TOPPASVertex::TOPPASFilenames::getSuffixCounts() const |
| 77 | { |
| 78 | // display file type(s) |
| 79 | std::map<QString, Size> suffices; |
| 80 | for (const QString& fn : filenames_) |
| 81 | { |
| 82 | QStringList l = QFileInfo(fn).completeSuffix().split('.'); |
| 83 | QString suf = ((l.size() > 1 && l[l.size() - 2].size() <= 4) ? l[l.size() - 2] + "." : QString()) + l.back(); // take up to two dots as suffix (the first only if its <=4 chars, e.g. we want ".prot.xml" or ".tar.gz", but not "stupid.filename.with.longdots.mzML") |
| 84 | ++suffices[suf]; |
| 85 | } |
| 86 | QStringList text_l; |
| 87 | for (std::map<QString, Size>::const_iterator sit = suffices.begin(); sit != suffices.end(); ++sit) |
| 88 | { |
| 89 | if (suffices.size() > 1) |
| 90 | text_l.push_back("." + sit->first + "(" + String(sit->second).toQString() + ")"); |
| 91 | else |
| 92 | text_l.push_back("." + sit->first); |
| 93 | } |
| 94 | return text_l; |
| 95 | } |
| 96 | |
| 97 | void TOPPASVertex::TOPPASFilenames::check_(const QString& filename) |
| 98 | { |