Browse Source

Constify exception references

adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
6738cdd715
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/app/main.cpp
  2. 10
      src/base/bittorrent/private/filterparserthread.cpp
  3. 16
      src/base/bittorrent/session.cpp

2
src/app/main.cpp

@ -261,7 +261,7 @@ int main(int argc, char *argv[])
return app->exec(params.paramList()); return app->exec(params.paramList());
} }
catch (CommandLineParameterError &er) { catch (const CommandLineParameterError &er) {
displayBadArgMessage(er.messageForUser()); displayBadArgMessage(er.messageForUser());
return EXIT_FAILURE; return EXIT_FAILURE;
} }

10
src/base/bittorrent/private/filterparserthread.cpp

@ -245,7 +245,7 @@ int FilterParserThread::parseDATFilterFile()
m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked); m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked);
++ruleCount; ++ruleCount;
} }
catch (std::exception &e) { catch (const std::exception &e) {
++parseErrorCount; ++parseErrorCount;
addLog(tr("IP filter exception thrown for line %1. Exception is: %2") addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
.arg(nbLine).arg(QString::fromLocal8Bit(e.what()))); .arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
@ -383,7 +383,7 @@ int FilterParserThread::parseP2PFilterFile()
m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked); m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked);
++ruleCount; ++ruleCount;
} }
catch (std::exception &e) { catch (const std::exception &e) {
++parseErrorCount; ++parseErrorCount;
addLog(tr("IP filter exception thrown for line %1. Exception is: %2") addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
.arg(nbLine).arg(QString::fromLocal8Bit(e.what()))); .arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
@ -468,7 +468,7 @@ int FilterParserThread::parseP2BFilterFile()
m_filter.add_rule(first, last, lt::ip_filter::blocked); m_filter.add_rule(first, last, lt::ip_filter::blocked);
++ruleCount; ++ruleCount;
} }
catch (std::exception &) {} catch (const std::exception &) {}
} }
} }
else if (version == 3) { else if (version == 3) {
@ -518,7 +518,7 @@ int FilterParserThread::parseP2BFilterFile()
m_filter.add_rule(first, last, lt::ip_filter::blocked); m_filter.add_rule(first, last, lt::ip_filter::blocked);
++ruleCount; ++ruleCount;
} }
catch (std::exception &) {} catch (const std::exception &) {}
if (m_abort) return ruleCount; if (m_abort) return ruleCount;
} }
@ -577,7 +577,7 @@ void FilterParserThread::run()
try { try {
emit IPFilterParsed(ruleCount); emit IPFilterParsed(ruleCount);
} }
catch (std::exception &) { catch (const std::exception &) {
emit IPFilterError(); emit IPFilterError();
} }

16
src/base/bittorrent/session.cpp

@ -1400,7 +1400,7 @@ void Session::configurePeerClasses()
, lt::address_v6::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") , lt::address_v6::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
, 1 << lt::session::global_peer_class_id); , 1 << lt::session::global_peer_class_id);
} }
catch (std::exception &) {} catch (const std::exception &) {}
#endif // TORRENT_USE_IPV6 #endif // TORRENT_USE_IPV6
if (ignoreLimitsOnLAN()) { if (ignoreLimitsOnLAN()) {
// local networks // local networks
@ -1439,7 +1439,7 @@ void Session::configurePeerClasses()
, lt::address_v6::from_string("::1") , lt::address_v6::from_string("::1")
, 1 << lt::session::local_peer_class_id); , 1 << lt::session::local_peer_class_id);
} }
catch (std::exception &) {} catch (const std::exception &) {}
#endif // TORRENT_USE_IPV6 #endif // TORRENT_USE_IPV6
} }
m_nativeSession->set_peer_class_filter(f); m_nativeSession->set_peer_class_filter(f);
@ -1870,7 +1870,7 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
#endif #endif
handle.pause(); handle.pause();
} }
catch (std::exception &) {} catch (const std::exception &) {}
adjustLimits(); adjustLimits();
@ -3856,7 +3856,7 @@ void Session::handleAlert(const lt::alert *a)
break; break;
} }
} }
catch (std::exception &exc) { catch (const std::exception &exc) {
qWarning() << "Caught exception in " << Q_FUNC_INFO << ": " << QString::fromStdString(exc.what()); qWarning() << "Caught exception in " << Q_FUNC_INFO << ": " << QString::fromStdString(exc.what());
} }
} }
@ -4374,7 +4374,7 @@ namespace
try { try {
handle.queue_position_up(); handle.queue_position_up();
} }
catch (std::exception &exc) { catch (const std::exception &exc) {
qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
} }
} }
@ -4384,7 +4384,7 @@ namespace
try { try {
handle.queue_position_down(); handle.queue_position_down();
} }
catch (std::exception &exc) { catch (const std::exception &exc) {
qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
} }
} }
@ -4394,7 +4394,7 @@ namespace
try { try {
handle.queue_position_top(); handle.queue_position_top();
} }
catch (std::exception &exc) { catch (const std::exception &exc) {
qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
} }
} }
@ -4404,7 +4404,7 @@ namespace
try { try {
handle.queue_position_bottom(); handle.queue_position_bottom();
} }
catch (std::exception &exc) { catch (const std::exception &exc) {
qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
} }
} }

Loading…
Cancel
Save