HelpPlugin: Modernize

modernize-use-*

Change-Id: Ie0058675c1336377326089dbc093436130f1fe03
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2018-11-11 10:08:29 +01:00
parent 644110f6e0
commit 901b2be036
16 changed files with 81 additions and 98 deletions

View File

@@ -78,8 +78,7 @@ static ExtensionMap extensionMap[] = {
{".xhtml", "application/xhtml+xml"},
{".wml", "text/vnd.wap.wml"},
{".wmlc", "application/vnd.wap.wmlc"},
{"about:blank", nullptr},
{nullptr, nullptr}
{"about:blank", nullptr}
};
HelpViewer::HelpViewer(QWidget *parent)
@@ -122,11 +121,9 @@ QString HelpViewer::mimeFromUrl(const QUrl &url)
const int index = path.lastIndexOf(QLatin1Char('.'));
const QByteArray &ext = path.mid(index).toUtf8().toLower();
const ExtensionMap *e = extensionMap;
while (e->extension) {
if (ext == e->extension)
return QLatin1String(e->mimeType);
++e;
for (const auto &e : extensionMap) {
if (ext == e.extension)
return QLatin1String(e.mimeType);
}
return QString();
}