From 7d98a162d67a943f191a9cd6b010b8f5424f9759 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 22 Feb 2014 15:23:46 +0100 Subject: [PATCH] [Code] Fixed cppcheck issues --- src/lib/app/mainapplication.cpp | 3 ++- src/lib/navigation/completer/locationcompletermodel.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index d93c37029..81f60411f 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -320,11 +320,12 @@ MainApplication::MainApplication(int &argc, char** argv) if (!m_isPrivateSession) { Settings settings; 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(); settings.setValue("SessionRestore/isRunning", true); #ifndef DISABLE_UPDATES_CHECK + bool checkUpdates = settings.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool(); + if (checkUpdates) { new Updater(qupzilla); } diff --git a/src/lib/navigation/completer/locationcompletermodel.cpp b/src/lib/navigation/completer/locationcompletermodel.cpp index a41a62348..66e9f0dfb 100644 --- a/src/lib/navigation/completer/locationcompletermodel.cpp +++ b/src/lib/navigation/completer/locationcompletermodel.cpp @@ -61,13 +61,12 @@ void LocationCompleterModel::refreshCompletions(const QString &string) clear(); - const int bookmarksLimit = 10; - const int historyLimit = 20; QList urlList; QList itemList; Type showType = (Type) qzSettings->showLocationSuggestions; if (showType == HistoryAndBookmarks || showType == Bookmarks) { + const int bookmarksLimit = 10; QList bookmarks = mApp->bookmarks()->searchBookmarks(string, bookmarksLimit); foreach (BookmarkItem* bookmark, bookmarks) { @@ -92,6 +91,7 @@ void LocationCompleterModel::refreshCompletions(const QString &string) } if (showType == HistoryAndBookmarks || showType == History) { + const int historyLimit = 20; QSqlQuery query = createQuery(string, historyLimit); query.exec();