[geary/wip/721828-undo-2] Refinements
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/721828-undo-2] Refinements
- Date: Tue, 27 Jan 2015 02:51:12 +0000 (UTC)
commit 90c78374b5dc0322fc7a02b108f01980ec4ae0a9
Author: Jim Nelson <jim yorba org>
Date: Mon Jan 26 18:39:00 2015 -0800
Refinements
src/client/application/geary-controller.vala | 8 +++---
.../imap-engine/imap-engine-revokable-move.vala | 21 +------------------
2 files changed, 6 insertions(+), 23 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index f104061..12e84be 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1881,7 +1881,7 @@ public class GearyController : Geary.BaseObject {
Gee.List<Geary.EmailIdentifier> ids, Geary.FolderPath destination, Cancellable? cancellable) {
try {
save_revokable(yield source_folder.move_email_async(ids, destination, cancellable),
- _("Undo move"));
+ _("Undo move (Ctrl+Z)"));
} catch (Error err) {
debug("%s: Unable to move %d emails: %s", source_folder.to_string(), ids.size,
err.message);
@@ -2426,7 +2426,7 @@ public class GearyController : Geary.BaseObject {
debug("Folder %s doesn't support archive", current_folder.to_string());
} else {
save_revokable(yield supports_archive.archive_email_async(ids, cancellable),
- _("Undo archive"));
+ _("Undo archive (Ctrl+Z)"));
}
return;
@@ -2441,7 +2441,7 @@ public class GearyController : Geary.BaseObject {
Geary.FolderSupport.Move? supports_move = current_folder as Geary.FolderSupport.Move;
if (supports_move != null) {
save_revokable(yield supports_move.move_email_async(ids, trash_path, cancellable),
- _("Undo trash"));
+ _("Undo trash (Ctrl+Z)"));
return;
}
@@ -2487,7 +2487,7 @@ public class GearyController : Geary.BaseObject {
Gtk.Action undo_action = GearyApplication.instance.get_action(ACTION_UNDO);
undo_action.sensitive = revokable != null && revokable.can_revoke;
- undo_action.tooltip = (revokable != null && description != null) ? description : _("Undo");
+ undo_action.tooltip = (revokable != null && description != null) ? description : _("Undo (Ctrl+Z)");
}
private void on_can_revoke_changed() {
diff --git a/src/engine/imap-engine/imap-engine-revokable-move.vala
b/src/engine/imap-engine/imap-engine-revokable-move.vala
index 59fbacf..f288faa 100644
--- a/src/engine/imap-engine/imap-engine-revokable-move.vala
+++ b/src/engine/imap-engine/imap-engine-revokable-move.vala
@@ -10,10 +10,6 @@ private class Geary.ImapEngine.RevokableMove : Revokable {
private FolderPath original_dest;
private Gee.Set<Imap.UID> destination_uids;
- /**
- * Supplied EmailIdentifiers *must* be loaded with UIDs of the messages on the *destination*
- * folder. Do *not* merely stuff in here the EmailIdentifier from the source folder.
- */
public RevokableMove(GenericAccount account, FolderPath original_source, FolderPath original_dest,
Gee.Set<Imap.UID> destination_uids) {
this.account = account;
@@ -44,7 +40,7 @@ private class Geary.ImapEngine.RevokableMove : Revokable {
private async bool internal_revoke_async(Cancellable? cancellable) throws Error {
// at this point, it's a one-shot deal: any error from here on out, or success, revoke
- // is completed
+ // is spent
can_revoke = false;
// Use a detached Folder object, which bypasses synchronization on the destination folder
@@ -62,21 +58,8 @@ private class Geary.ImapEngine.RevokableMove : Revokable {
foreach (Imap.MessageSet msg_set in msg_sets)
yield dest_folder.copy_email_async(msg_set, original_source, cancellable);
- // remove it from the destination in one fell swoop
+ // remove it from the original destination in one fell swoop
yield dest_folder.remove_email_async(msg_sets, cancellable);
-
- // HACK:
- // There's not a super-reliable way to wait until the delete of the message in this
- // folder has round-tripped; could wait for the UID to be reported deleted, but it's
- // possible in IMAP to delete a message not present in folder and not get an error
- // (but also not be notified of its removal), and so waiting is a bad idea. Don't
- // want to close the folder immediately because that leaves the local remove_marker
- // in place and the folder is treated as "dirty", causing a full renormalize to
- // occur when next opened, which is expensive. So: just wait a bit and give the
- // server a chance to report the message is gone, leaving the db in a good state.
- // Do this *after* marking can_revoke=false so client is notified that this object
- // is now worthless.
- yield Scheduler.sleep_async(5);
}
} finally {
// note that the Cancellable is not used
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]