diff --git a/src/core/bittorrent/session.cpp b/src/core/bittorrent/session.cpp index dbe301859..51407ded8 100644 --- a/src/core/bittorrent/session.cpp +++ b/src/core/bittorrent/session.cpp @@ -2092,7 +2092,7 @@ void Session::handleAlert(libt::alert *a) } } catch (std::exception &exc) { - qWarning() << "Caught exception in readAlerts(): " << Utils::String::fromStdString(exc.what()); + qWarning() << "Caught exception in " << Q_FUNC_INFO << ": " << Utils::String::fromStdString(exc.what()); } } @@ -2411,7 +2411,7 @@ void torrentQueuePositionUp(const libt::torrent_handle &handle) handle.queue_position_up(); } catch (std::exception &exc) { - qDebug() << "torrent_handle::queue_position_up() fails:" << exc.what(); + qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); } } @@ -2421,7 +2421,7 @@ void torrentQueuePositionDown(const libt::torrent_handle &handle) handle.queue_position_down(); } catch (std::exception &exc) { - qDebug() << "torrent_handle::queue_position_down() fails:" << exc.what(); + qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); } } @@ -2431,7 +2431,7 @@ void torrentQueuePositionTop(const libt::torrent_handle &handle) handle.queue_position_top(); } catch (std::exception &exc) { - qDebug() << "torrent_handle::queue_position_top() fails:" << exc.what(); + qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); } } @@ -2441,6 +2441,6 @@ void torrentQueuePositionBottom(const libt::torrent_handle &handle) handle.queue_position_bottom(); } catch (std::exception &exc) { - qDebug() << "torrent_handle::queue_position_bottom() fails:" << exc.what(); + qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); } } diff --git a/src/core/bittorrent/torrenthandle.cpp b/src/core/bittorrent/torrenthandle.cpp index ce4d22742..2fa9fd0fa 100644 --- a/src/core/bittorrent/torrenthandle.cpp +++ b/src/core/bittorrent/torrenthandle.cpp @@ -148,7 +148,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) m_nativeHandle.func(__VA_ARGS__); \ } \ catch (std::exception &exc) { \ - qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \ + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \ } #define SAFE_CALL_BOOL(func, ...) \ @@ -157,7 +157,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) return true; \ } \ catch (std::exception &exc) { \ - qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \ + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \ return false; \ } @@ -167,7 +167,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) result = m_nativeHandle.func(); \ } \ catch (std::exception &exc) { \ - qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \ + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \ } \ return result; @@ -176,7 +176,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) var = m_nativeHandle.func(__VA_ARGS__); \ } \ catch (std::exception &exc) { \ - qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \ + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \ } const qreal TorrentHandle::USE_GLOBAL_RATIO = -2.; @@ -1186,7 +1186,7 @@ void TorrentHandle::pause() m_nativeHandle.pause(); } catch (std::exception &exc) { - qDebug("torrent_handle method inside TorrentHandleImpl::pause() throws exception: %s", exc.what()); + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); } } @@ -1201,7 +1201,7 @@ void TorrentHandle::resume(bool forced) m_nativeHandle.resume(); } catch (std::exception &exc) { - qDebug("torrent_handle method inside TorrentHandleImpl::resume() throws exception: %s", exc.what()); + qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); } } @@ -1279,13 +1279,13 @@ void TorrentHandle::handleStateUpdate(const libt::torrent_status &nativeStatus) void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p) { if (!isMoveInProgress()) { - qWarning("Unexpected TorrentHandleImpl::handleStorageMoved() call."); + qWarning() << "Unexpected " << Q_FUNC_INFO << " call."; return; } QString newPath = Utils::String::fromStdString(p->path); if (newPath != m_newPath) { - qWarning("TorrentHandleImpl::handleStorageMoved(): New path doesn't match a path in a queue."); + qWarning() << Q_FUNC_INFO << ": New path doesn't match a path in a queue."; return; } @@ -1317,7 +1317,7 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p) void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_failed_alert *p) { if (!isMoveInProgress()) { - qWarning("Unexpected TorrentHandleImpl::handleStorageMovedFailed() call."); + qWarning() << "Unexpected " << Q_FUNC_INFO << " call."; return; } diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 580f39995..cab913a3d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -721,7 +721,7 @@ void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const void MainWindow::on_actionSet_global_upload_limit_triggered() { - qDebug("actionSet_global_upload_limit_triggered"); + qDebug() << Q_FUNC_INFO; bool ok; int cur_limit = BitTorrent::Session::instance()->uploadRateLimit(); const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Upload Speed Limit"), cur_limit); @@ -737,7 +737,7 @@ void MainWindow::on_actionSet_global_upload_limit_triggered() void MainWindow::on_actionSet_global_download_limit_triggered() { - qDebug("actionSet_global_download_limit_triggered"); + qDebug() << Q_FUNC_INFO; bool ok; int cur_limit = BitTorrent::Session::instance()->downloadRateLimit(); const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Download Speed Limit"), cur_limit);