From 4d5001d18d6120d582a39468e402a9a47a78faef Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 22 Feb 2010 19:30:36 +0000 Subject: [PATCH] Display more useful information in log window when an I/O error occurs I/O errors are now reported in nox version too --- src/GUI.cpp | 8 ++------ src/bittorrent.cpp | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index bdc1f7923..d37b5dad5 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -307,12 +307,8 @@ void GUI::finishedTorrent(QTorrentHandle& h) const { // Notification when disk is full void GUI::fullDiskError(QTorrentHandle& h, QString msg) const { - if(!h.is_valid()) return; - showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error"), tr("An I/O error occured for torrent %1.\n Reason: %2", "e.g: An error occured for torrent xxx.avi.\n Reason: disk is full.").arg(h.name()).arg(msg)); - // Download will be paused by libtorrent. Updating GUI information accordingly - QString hash = h.hash(); - qDebug("Full disk error, pausing torrent %s", hash.toLocal8Bit().data()); - BTSession->addConsoleMessage(tr("An error occured (full disk?), '%1' paused.", "e.g: An error occured (full disk?), 'xxx.avi' paused.").arg(h.name())); + if(!h.is_valid()) return; showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error"), tr("An I/O error occured for torrent %1.\n Reason: %2", "e.g: An error occured for torrent xxx.avi.\n Reason: disk is full.").arg(h.name()).arg(msg)); + } void GUI::createKeyboardShortcuts() { diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index fa2648c32..206c46dfe 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1964,6 +1964,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { if(h.is_valid()) { h.auto_managed(false); std::cerr << "File Error: " << p->message().c_str() << std::endl; + addConsoleMessage(tr("An I/O error occured, '%1' paused.").arg(h.name())); + addConsoleMessage(tr("Reason: %1").arg(misc::toQString(p->message()))); if(h.is_valid()) { emit fullDiskError(h, misc::toQString(p->message())); h.pause();