1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

[Code] Fixed cppcheck issues

This commit is contained in:
nowrep 2014-02-22 15:23:46 +01:00
parent 5cf7d0b9a9
commit 7d98a162d6
2 changed files with 4 additions and 3 deletions

View File

@ -320,11 +320,12 @@ MainApplication::MainApplication(int &argc, char** argv)
if (!m_isPrivateSession) { if (!m_isPrivateSession) {
Settings settings; Settings settings;
m_startingAfterCrash = settings.value("SessionRestore/isRunning", false).toBool(); m_startingAfterCrash = settings.value("SessionRestore/isRunning", false).toBool();
bool checkUpdates = settings.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool();
int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 3).toInt(); int afterLaunch = settings.value("Web-URL-Settings/afterLaunch", 3).toInt();
settings.setValue("SessionRestore/isRunning", true); settings.setValue("SessionRestore/isRunning", true);
#ifndef DISABLE_UPDATES_CHECK #ifndef DISABLE_UPDATES_CHECK
bool checkUpdates = settings.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool();
if (checkUpdates) { if (checkUpdates) {
new Updater(qupzilla); new Updater(qupzilla);
} }

View File

@ -61,13 +61,12 @@ void LocationCompleterModel::refreshCompletions(const QString &string)
clear(); clear();
const int bookmarksLimit = 10;
const int historyLimit = 20;
QList<QUrl> urlList; QList<QUrl> urlList;
QList<QStandardItem*> itemList; QList<QStandardItem*> itemList;
Type showType = (Type) qzSettings->showLocationSuggestions; Type showType = (Type) qzSettings->showLocationSuggestions;
if (showType == HistoryAndBookmarks || showType == Bookmarks) { if (showType == HistoryAndBookmarks || showType == Bookmarks) {
const int bookmarksLimit = 10;
QList<BookmarkItem*> bookmarks = mApp->bookmarks()->searchBookmarks(string, bookmarksLimit); QList<BookmarkItem*> bookmarks = mApp->bookmarks()->searchBookmarks(string, bookmarksLimit);
foreach (BookmarkItem* bookmark, bookmarks) { foreach (BookmarkItem* bookmark, bookmarks) {
@ -92,6 +91,7 @@ void LocationCompleterModel::refreshCompletions(const QString &string)
} }
if (showType == HistoryAndBookmarks || showType == History) { if (showType == HistoryAndBookmarks || showType == History) {
const int historyLimit = 20;
QSqlQuery query = createQuery(string, historyLimit); QSqlQuery query = createQuery(string, historyLimit);
query.exec(); query.exec();