D15368: [Comic Thumbnailer] support more image formats

Elvis Angelaccio noreply at phabricator.kde.org
Sat Nov 24 10:58:52 GMT 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181124/0d2cde10/attachment.html>


More information about the Kde-frameworks-devel mailing list