mirror of
https://github.com/transmission/transmission
synced 2025-02-22 06:00:41 +00:00
(trunk qt) #5514 'enhanced network status' -- reset the torrent model when we reconnect to the transmission session after a network failure
This commit is contained in:
parent
4fd7408d4b
commit
2be080f48e
1 changed files with 16 additions and 5 deletions
|
@ -723,7 +723,11 @@ TrMainWindow :: refreshTrayIcon ()
|
|||
|
||||
myModel.getTransferSpeed (upSpeed, upCount, downSpeed, downCount);
|
||||
|
||||
if (!upCount && !downCount)
|
||||
if (myNetworkError)
|
||||
{
|
||||
tip = tr ("Network Error");
|
||||
}
|
||||
else if (!upCount && !downCount)
|
||||
{
|
||||
tip = tr ("Idle");
|
||||
}
|
||||
|
@ -1408,10 +1412,17 @@ TrMainWindow :: dataSendProgress ()
|
|||
void
|
||||
TrMainWindow :: onError (QNetworkReply::NetworkError code)
|
||||
{
|
||||
if (code != QNetworkReply::NoError)
|
||||
myNetworkError = true;
|
||||
else
|
||||
myNetworkError = false;
|
||||
const bool hadError = myNetworkError;
|
||||
const bool haveError = code != QNetworkReply::NoError;
|
||||
|
||||
myNetworkError = haveError;
|
||||
refreshTrayIconSoon();
|
||||
updateNetworkIcon();
|
||||
|
||||
// Refresh our model if we've just gotten a clean connection to the session.
|
||||
// That way we can rebuild after a restart of transmission-daemon
|
||||
if (hadError && !haveError)
|
||||
myModel.clear();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue