Skip to content

Commit

Permalink
dump tool: Print extractor name
Browse files Browse the repository at this point in the history
It's useful not having to guess which extractor it was based solely
on the mimetypes it supported
  • Loading branch information
kbroulik committed Jul 18, 2022
1 parent cb95bf6 commit c665c74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ int main(int argc, char** argv)
out << url << " " << mimetype << "\n";

for (KFileMetaData::Extractor* ex : std::as_const(exList)) {
out << "\tExtractor For: " << ex->mimetypes().join(QLatin1Char(' ')) << "\n";
const QString extractorName = ex->extractorProperties().value(QStringLiteral("Name")).toString();
out << "\t";
if (!extractorName.isEmpty()) {
out << extractorName;
} else {
out << "Extractor";
}
out << " For " << ex->mimetypes().join(QLatin1Char(' ')) << "\n";

KFileMetaData::SimpleExtractionResult result(url, mimetype, extractionLevel);
ex->extract(&result);
Expand Down

0 comments on commit c665c74

Please sign in to comment.