Browse Source

Merge pull request #4553 from glassez/fixes

Fix some bugs (reported by Coverity Scan for the most part)
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
909fc3fa50
  1. 2
      src/base/bittorrent/session.cpp
  2. 13
      src/base/net/downloadmanager.cpp
  3. 1
      src/base/rss/rssdownloadrule.cpp
  4. 3
      src/gui/search/searchwidget.cpp

2
src/base/bittorrent/session.cpp

@ -576,7 +576,7 @@ void Session::configure()
m_nativeSession->set_pe_settings(encryptionSettings); m_nativeSession->set_pe_settings(encryptionSettings);
// * Add trackers // * Add trackers
m_additionalTrackers.empty(); m_additionalTrackers.clear();
if (pref->isAddTrackersEnabled()) { if (pref->isAddTrackersEnabled()) {
foreach (QString tracker, pref->getTrackersList().split("\n")) { foreach (QString tracker, pref->getTrackersList().split("\n")) {
tracker = tracker.trimmed(); tracker = tracker.trimmed();

13
src/base/net/downloadmanager.cpp

@ -79,8 +79,19 @@ namespace
virtual bool deleteCookie(const QNetworkCookie &cookie) virtual bool deleteCookie(const QNetworkCookie &cookie)
{ {
auto myCookies = allCookies(); auto myCookies = allCookies();
myCookies.removeAll(cookie);
QList<QNetworkCookie>::Iterator it;
for (it = myCookies.begin(); it != myCookies.end(); ++it) {
if ((it->name() == cookie.name())
&& (it->domain() == cookie.domain())
&& (it->path() == cookie.path())) {
myCookies.erase(it);
setAllCookies(myCookies); setAllCookies(myCookies);
return true;
}
}
return false;
} }
#endif #endif

1
src/base/rss/rssdownloadrule.cpp

@ -44,6 +44,7 @@ DownloadRule::DownloadRule()
: m_enabled(false) : m_enabled(false)
, m_useRegex(false) , m_useRegex(false)
, m_apstate(USE_GLOBAL) , m_apstate(USE_GLOBAL)
, m_ignoreDays(0)
{ {
} }

3
src/gui/search/searchwidget.cpp

@ -72,6 +72,9 @@
SearchWidget::SearchWidget(MainWindow *mainWindow) SearchWidget::SearchWidget(MainWindow *mainWindow)
: QWidget(mainWindow) : QWidget(mainWindow)
, m_mainWindow(mainWindow) , m_mainWindow(mainWindow)
, m_isNewQueryString(false)
, m_noSearchResults(true)
, m_nbSearchResults(0)
{ {
setupUi(this); setupUi(this);

Loading…
Cancel
Save