Browse Source

Display more useful information in log window when an I/O error occurs

I/O errors are now reported in nox version too
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
4d5001d18d
  1. 8
      src/GUI.cpp
  2. 2
      src/bittorrent.cpp

8
src/GUI.cpp

@ -307,12 +307,8 @@ void GUI::finishedTorrent(QTorrentHandle& h) const {
// Notification when disk is full // Notification when disk is full
void GUI::fullDiskError(QTorrentHandle& h, QString msg) const { void GUI::fullDiskError(QTorrentHandle& h, QString msg) const {
if(!h.is_valid()) return; 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));
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()));
} }
void GUI::createKeyboardShortcuts() { void GUI::createKeyboardShortcuts() {

2
src/bittorrent.cpp

@ -1964,6 +1964,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
if(h.is_valid()) { if(h.is_valid()) {
h.auto_managed(false); h.auto_managed(false);
std::cerr << "File Error: " << p->message().c_str() << std::endl; 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()) { if(h.is_valid()) {
emit fullDiskError(h, misc::toQString(p->message())); emit fullDiskError(h, misc::toQString(p->message()));
h.pause(); h.pause();

Loading…
Cancel
Save