diff --git a/src/core/http/requestparser.cpp b/src/core/http/requestparser.cpp index 4a766a900..8c20df0d2 100644 --- a/src/core/http/requestparser.cpp +++ b/src/core/http/requestparser.cpp @@ -79,9 +79,8 @@ RequestParser::ErrorCode RequestParser::parseHttpRequest(const QByteArray& data, } // Parse HTTP request message - int content_length = 0; if (m_request.headers.contains("content-length")) { - content_length = m_request.headers["content-length"].toInt(); + int content_length = m_request.headers["content-length"].toInt(); if (content_length > static_cast(m_maxContentLength)) { qWarning() << Q_FUNC_INFO << "bad request: message too long"; return BadRequest; diff --git a/src/core/misc.cpp b/src/core/misc.cpp index 57bcd8254..42414d8f6 100644 --- a/src/core/misc.cpp +++ b/src/core/misc.cpp @@ -183,9 +183,7 @@ void misc::shutdownComputer(shutDownAction action) AppleEvent eventReply = {typeNull, NULL}; AppleEvent appleEventToSend = {typeNull, NULL}; - OSStatus error = noErr; - - error = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess, + OSStatus error = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess, sizeof(kPSNOfSystemProcess), &targetDesc); if (error != noErr) diff --git a/src/core/qtlibtorrent/qbtsession.cpp b/src/core/qtlibtorrent/qbtsession.cpp index fc42aa6da..f77fc9d2e 100644 --- a/src/core/qtlibtorrent/qbtsession.cpp +++ b/src/core/qtlibtorrent/qbtsession.cpp @@ -1253,9 +1253,9 @@ void QBtSession::loadTorrentTempData(QTorrentHandle &h, QString savePath, bool m // Update file names const QStringList files_path = TorrentTempData::getFilesPath(hash); - bool force_recheck = false; QDir base_dir(h.save_path()); if (files_path.size() == h.num_files()) { + bool force_recheck = false; for (int i=0; ishutdownWhenDownloadsComplete() || - pref->shutdownqBTWhenDownloadsComplete() || - pref->suspendWhenDownloadsComplete() || - pref->hibernateWhenDownloadsComplete()) - && !hasDownloadingTorrents(); -#else - bool will_shutdown = false; -#endif + // AutoRun program if (pref->isAutoRunEnabled()) autoRunExternalProgram(h); @@ -2227,8 +2219,15 @@ void QBtSession::handleTorrentFinishedAlert(libtorrent::torrent_finished_alert* // Mail notification if (pref->isMailNotificationEnabled()) sendNotificationEmail(h); + #ifndef DISABLE_GUI // Auto-Shutdown + bool will_shutdown = (pref->shutdownWhenDownloadsComplete() || + pref->shutdownqBTWhenDownloadsComplete() || + pref->suspendWhenDownloadsComplete() || + pref->hibernateWhenDownloadsComplete()) + && !hasDownloadingTorrents(); + if (will_shutdown) { bool suspend = pref->suspendWhenDownloadsComplete(); bool hibernate = pref->hibernateWhenDownloadsComplete(); diff --git a/src/gui/rss/rssfeed.cpp b/src/gui/rss/rssfeed.cpp index 63b23e92f..fb061f42a 100644 --- a/src/gui/rss/rssfeed.cpp +++ b/src/gui/rss/rssfeed.cpp @@ -117,7 +117,6 @@ void RssFeed::loadItemsFromDisk() } void RssFeed::addArticle(const RssArticlePtr& article) { - int lbIndex = -1; int max_articles = Preferences::instance()->getRSSMaxArticlesPerFeed(); if (!m_articles.contains(article->guid())) { @@ -131,7 +130,7 @@ void RssFeed::addArticle(const RssArticlePtr& article) { // Insertion sort RssArticleList::Iterator lowerBound = qLowerBound(m_articlesByDate.begin(), m_articlesByDate.end(), article, rssArticleDateRecentThan); m_articlesByDate.insert(lowerBound, article); - lbIndex = m_articlesByDate.indexOf(article); + int lbIndex = m_articlesByDate.indexOf(article); if (m_articlesByDate.size() > max_articles) { RssArticlePtr oldestArticle = m_articlesByDate.takeLast(); m_articles.remove(oldestArticle->guid());