aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2014-10-13 00:26:59 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2014-10-13 00:26:59 +0200
commit815ed2e233aca0aab04bce1ab5657dd953c72ce2 (patch)
tree9d95b2448e4810f889cc4ad0d1b9c15211dbdd87 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util
parentb47412eb1e2b983f803e6227ea5d07fdead9fe5a (diff)
downloadopen-keychain-815ed2e233aca0aab04bce1ab5657dd953c72ce2.tar.gz
open-keychain-815ed2e233aca0aab04bce1ab5657dd953c72ce2.tar.bz2
open-keychain-815ed2e233aca0aab04bce1ab5657dd953c72ce2.zip
rewrite export with new operation style
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java
index 649a74641..7492d95b2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java
@@ -29,6 +29,7 @@ import android.widget.Toast;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.operations.results.ExportResult;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException;
import org.sufficientlysecure.keychain.provider.ProviderHelper;
@@ -127,19 +128,10 @@ public class ExportHelper {
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
// get returned data bundle
- Bundle returnData = message.getData();
-
- int exported = returnData.getInt(KeychainIntentService.RESULT_EXPORT);
- String toastMessage;
- if (exported == 1) {
- toastMessage = mActivity.getString(R.string.key_exported);
- } else if (exported > 0) {
- toastMessage = mActivity.getString(R.string.keys_exported, exported);
- } else {
- toastMessage = mActivity.getString(R.string.no_keys_exported);
- }
- Toast.makeText(mActivity, toastMessage, Toast.LENGTH_SHORT).show();
+ Bundle data = message.getData();
+ ExportResult result = data.getParcelable(ExportResult.EXTRA_RESULT);
+ result.createNotify(mActivity).show();
}
}
};