summaryrefslogtreecommitdiffstats
path: root/src/plugins/viewers/generic/genericviewer.cpp
diff options
context:
space:
mode:
authorMattV <[email protected]>2009-04-03 10:18:23 +1000
committerMattV <[email protected]>2009-04-03 10:18:23 +1000
commitf4892d2e0675ea1094c3463cbedffb4362e95a18 (patch)
treed6e73ed9352b5569b3f97e918f03616591b92f6b /src/plugins/viewers/generic/genericviewer.cpp
parent21956800f38b8a90b0dda7e8dc6d441b84617494 (diff)
Progressively download text/plain messages and parts.
Diffstat (limited to 'src/plugins/viewers/generic/genericviewer.cpp')
-rw-r--r--src/plugins/viewers/generic/genericviewer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/viewers/generic/genericviewer.cpp b/src/plugins/viewers/generic/genericviewer.cpp
index c008e475..a9473822 100644
--- a/src/plugins/viewers/generic/genericviewer.cpp
+++ b/src/plugins/viewers/generic/genericviewer.cpp
@@ -150,14 +150,23 @@ void GenericViewer::linkClicked(const QUrl& link)
attachmentDialog->setAttachment(message->partAt(partLocation));
connect(attachmentDialog, SIGNAL(retrieve(QMailMessagePart)), this, SIGNAL(retrieveMessagePart(QMailMessagePart)));
+ connect(attachmentDialog, SIGNAL(retrievePortion(QMailMessagePart, uint)), this, SIGNAL(retrieveMessagePartPortion(QMailMessagePart, uint)));
connect(attachmentDialog, SIGNAL(finished(int)), this, SLOT(dialogFinished(int)));
attachmentDialog->exec();
return;
}
}
- } else if (command == "download") {
- emit completeMessage();
+ } else if (command.startsWith("download")) {
+ QRegExp splitter("download(?:;(\\d+))?");
+ if (splitter.exactMatch(command)) {
+ QString bytes = splitter.cap(1);
+ if (!bytes.isEmpty()) {
+ emit retrieveMessagePortion(bytes.toUInt());
+ } else {
+ emit retrieveMessage();
+ }
+ }
}
emit anchorClicked(link);