~aacid/unity8/fixLauncherUpDownKeys

« back to all changes in this revision

Viewing changes to plugins/Utils/windowstatestorage.cpp

Protect against loading invalid window geometry (LP: #1674262)

Approved by: Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
    if (!query.first()) {
134
134
        return defaultValue;
135
135
    }
136
 
    return QRect(query.value(QStringLiteral("x")).toInt(), query.value(QStringLiteral("y")).toInt(),
137
 
                 query.value(QStringLiteral("width")).toInt(), query.value(QStringLiteral("height")).toInt());
 
136
 
 
137
    const QRect result(query.value(QStringLiteral("x")).toInt(), query.value(QStringLiteral("y")).toInt(),
 
138
                       query.value(QStringLiteral("width")).toInt(), query.value(QStringLiteral("height")).toInt());
 
139
 
 
140
    if (result.isValid()) {
 
141
        return result;
 
142
    }
 
143
 
 
144
    return defaultValue;
138
145
}
139
146
 
140
147
void WindowStateStorage::initdb()