diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 48211621e..d484e9f6b 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -964,7 +964,7 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed, bool f // Adding torrent to Bittorrent session try { h = QTorrentHandle(s->add_torrent(p)); - }catch(std::exception e) { + }catch(std::exception &e) { qDebug("Error: %s", e.what()); } // Check if it worked @@ -1153,7 +1153,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr // Adding torrent to Bittorrent session try { h = QTorrentHandle(s->add_torrent(p)); - }catch(std::exception e) { + }catch(std::exception &e) { qDebug("Error: %s", e.what()); } // Check if it worked @@ -1539,7 +1539,7 @@ bool QBtSession::enableDHT(bool b) { s->add_dht_router(std::make_pair(std::string("dht.aelitis.com"), 6881)); // Vuze DHTEnabled = true; qDebug("DHT enabled"); - }catch(std::exception e) { + }catch(std::exception &e) { qDebug("Could not enable DHT, reason: %s", e.what()); return false; } @@ -1594,7 +1594,7 @@ void QBtSession::saveTempFastResumeData() { if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking || h.has_error()) continue; qDebug("Saving fastresume data for %s", qPrintable(h.name())); h.save_resume_data(); - }catch(std::exception e) {} + }catch(std::exception &e) {} } } diff --git a/src/qtlibtorrent/qtorrenthandle.cpp b/src/qtlibtorrent/qtorrenthandle.cpp index fdd214a44..f69995940 100644 --- a/src/qtlibtorrent/qtorrenthandle.cpp +++ b/src/qtlibtorrent/qtorrenthandle.cpp @@ -257,7 +257,7 @@ QStringList QTorrentHandle::url_seeds() const { qDebug("URL Seed: %s", it->c_str()); res << misc::toQString(*it); } - } catch(std::exception e) { + } catch(std::exception &e) { std::cout << "ERROR: Failed to convert the URL seed" << std::endl; } return res; diff --git a/src/rss/rssdownloadrule.cpp b/src/rss/rssdownloadrule.cpp index dc6971780..27f0bdb18 100644 --- a/src/rss/rssdownloadrule.cpp +++ b/src/rss/rssdownloadrule.cpp @@ -106,7 +106,7 @@ QVariantHash RssDownloadRule::toVariantHash() const return hash; } -bool RssDownloadRule::operator==(const RssDownloadRule &other) { +bool RssDownloadRule::operator==(const RssDownloadRule &other) const { return m_name == other.name(); } diff --git a/src/rss/rssdownloadrule.h b/src/rss/rssdownloadrule.h index 5df462a22..c01022af2 100644 --- a/src/rss/rssdownloadrule.h +++ b/src/rss/rssdownloadrule.h @@ -67,7 +67,7 @@ public: inline void setUseRegex(bool enabled) { m_useRegex = enabled; } QStringList findMatchingArticles(const RssFeedPtr& feed) const; // Operators - bool operator==(const RssDownloadRule &other); + bool operator==(const RssDownloadRule &other) const; private: QString m_name; diff --git a/src/smtp.cpp b/src/smtp.cpp index 1b3bd8bca..ff38b5754 100644 --- a/src/smtp.cpp +++ b/src/smtp.cpp @@ -272,10 +272,9 @@ QByteArray Smtp::encode_mime_header(const QString& key, const QString& value, QT // The text cannot be losslessly encoded as Latin-1. Therefore, we // must use base64 encoding. QByteArray utf8 = value.toUtf8(); - int ct = utf8.length(); // Use base64 encoding QByteArray base64 = utf8.toBase64(); - ct = base64.length(); + int ct = base64.length(); line += "=?utf-8?b?"; for (int i = 0; i < ct; i += 4) { /*if (line.length() > 72) {