Commit 34a61be2 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

DocumentManager: Reduce scope of variable

Detected by CppCheck run.

Change-Id: I2fb506b76757d2bd0a7a1c220a9cbe1d7f63a468
Reviewed-by: default avatarEike Ziller <>
parent d3126c50
......@@ -679,8 +679,8 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa
// Mime database creates filter strings like this: Anything here (*.foo *.bar)
QRegExp regExp(QLatin1String(".*\\s+\\((.*)\\)$"));
const int index = regExp.lastIndexIn(*selectedFilter);
bool suffixOk = false;
if (index != -1) {
bool suffixOk = false;
const QStringList &suffixes = regExp.cap(1).remove(QLatin1Char('*')).split(QLatin1Char(' '));
foreach (const QString &suffix, suffixes)
if (fileName.endsWith(suffix)) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment