| 15 | } |
| 16 | |
| 17 | std::vector<Engine::SubtitleItem> Parser::parseFile(QFile &f, |
| 18 | QString encoding) { |
| 19 | for (ParserInterface *p : Parser::parsers) { |
| 20 | bool ok = false; |
| 21 | for (QString ext : p->getExtensions()) { |
| 22 | ok = ok || f.fileName().endsWith(ext, Qt::CaseInsensitive); |
| 23 | } |
| 24 | if (ok) |
| 25 | return p->parseFile(f, encoding); |
| 26 | } |
| 27 | return std::vector<Engine::SubtitleItem>(); |
| 28 | } |
| 29 | |
| 30 | QStringList Parser::getExtensions() { |
| 31 | QStringList list; |