Discussion:
D15368: [Comic Thumbnailer] support more image formats
Florian Léger
2018-11-23 07:26:27 UTC
Permalink
fleger added reviewers: broulik, Frameworks.
Herald added projects: Dolphin, Frameworks.
Herald added subscribers: kfm-devel, kde-frameworks-devel.

REPOSITORY
R320 KIO Extras

REVISION DETAIL
https://phabricator.kde.org/D15368

To: fleger, broulik, #frameworks
Cc: kde-frameworks-devel, kfm-devel, alexde, sourabhboss, feverfew, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
Elvis Angelaccio
2018-11-24 10:58:52 UTC
Permalink
elvisangelaccio added inline comments.

INLINE COMMENTS
comiccreator.cpp:101
QMap<QString, QString> entryMap;
- Q_FOREACH(const QString& entry, entries) {
- if (entry.endsWith(QLatin1String(".gif"), Qt::CaseInsensitive) ||
- entry.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive) ||
- entry.endsWith(QLatin1String(".jpeg"), Qt::CaseInsensitive) ||
- entry.endsWith(QLatin1String(".png"), Qt::CaseInsensitive)) {
- entryMap.insert(entry.toLower(), entry);
+ QVector<QRegExp> nameFilters;
+ QMimeDatabase db;
`QRegExp` shouldn't be used in new code.

Can you try to use `QRegularExpression` instead?
comiccreator.cpp:105
+ const QMimeType mime = db.mimeTypeForName(mimeTypeName);
+ Q_FOREACH (const QString& globPattern, mime.globPatterns())
+ {
Please consider using the C++11 `for` loop instead.

See https://lists.qt-project.org/pipermail/development/2016-May/025843.html
comiccreator.cpp:106
+ Q_FOREACH (const QString& globPattern, mime.globPatterns())
+ {
+ nameFilters.append(QRegExp(globPattern, Qt::CaseInsensitive, QRegExp::Wildcard));
Coding style: opening brace should start at the end of previous line.

REPOSITORY
R320 KIO Extras

REVISION DETAIL
https://phabricator.kde.org/D15368

To: fleger, broulik, #frameworks
Cc: elvisangelaccio, kde-frameworks-devel, kfm-devel, alexde, sourabhboss, feverfew, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
Elvis Angelaccio
2018-11-24 10:58:59 UTC
Permalink
elvisangelaccio requested changes to this revision.
This revision now requires changes to proceed.

REPOSITORY
R320 KIO Extras

REVISION DETAIL
https://phabricator.kde.org/D15368

To: fleger, broulik, #frameworks, elvisangelaccio
Cc: elvisangelaccio, kde-frameworks-devel, kfm-devel, alexde, sourabhboss, feverfew, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
Loading...