MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getSuffixCounts

Method getSuffixCounts

src/openms_gui/source/VISUAL/TOPPASVertex.cpp:76–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

paintMethod · 0.80
paintMethod · 0.80

Calls 9

backMethod · 0.80
QStringClass · 0.50
StringClass · 0.50
splitMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
toQStringMethod · 0.45

Tested by

no test coverage detected