~michael-sheldon/ubuntu-download-manager/fix-1557771

« back to all changes in this revision

Viewing changes to src/common/priv/ubuntu/transfers/queue.cpp

  • Committer: CI Train Bot
  • Author(s): Michael Sheldon
  • Date: 2016-01-12 10:05:38 UTC
  • mfrom: (344.1.2 fix-1531118)
  • Revision ID: ci-train-bot@canonical.com-20160112100538-p5u3mrfs8kki65lh
Fix queue handling for finished downloads when transitioning from uncollected state Fixes: #1531118
Approved by: PS Jenkins bot, Scott Sweeny

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
                remove(transfer->path());
127
127
            break;
128
128
        case Transfer::ERROR:
129
 
        case Transfer::FINISH:
130
129
        case Transfer::UNCOLLECTED:
131
130
            // remove the registered object in dbus, remove the transfer
132
131
            // and the adapter from the list
133
132
            if (!_current.isEmpty() && _current == transfer->path())
134
133
                updateCurrentTransfer();
135
134
            break;
 
135
        case Transfer::FINISH:
 
136
            if (!_current.isEmpty() && _current == transfer->path()) {
 
137
                updateCurrentTransfer();
 
138
            } else {
 
139
                // Remove from the queue even if it wasn't the current transfer
 
140
                // (finished signals can be received for downloads that completed
 
141
                // previously but were left in an uncollected state)
 
142
                remove(transfer->path());
 
143
            }
 
144
            break;
136
145
        default:
137
146
            // do nothing
138
147
            break;