aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-19 20:09:04 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-19 20:09:04 +0200
commit36f3887c5fcd53b76343247868fa95e72b2b0044 (patch)
tree4da441e14852e6ab06a886d93459d82dd6089f30 /OpenKeychain/src/main
parentae56f4f90069cfeb7e88f2aa4c858048faf1b154 (diff)
downloadopen-keychain-36f3887c5fcd53b76343247868fa95e72b2b0044.tar.gz
open-keychain-36f3887c5fcd53b76343247868fa95e72b2b0044.tar.bz2
open-keychain-36f3887c5fcd53b76343247868fa95e72b2b0044.zip
handle empty filename in decrypt list
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java6
-rw-r--r--OpenKeychain/src/main/res/values/strings.xml1
2 files changed, 6 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java
index d54512076..275212ac8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java
@@ -34,6 +34,7 @@ import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
@@ -476,7 +477,10 @@ public class DecryptListFragment
KeyFormattingUtils.setStatus(mContext, holder, model.mResult);
OpenPgpMetadata metadata = model.mResult.getDecryptMetadata();
- holder.vFilename.setText(metadata.getFilename());
+
+ String filename = metadata.getFilename();
+ holder.vFilename.setText(
+ !TextUtils.isEmpty(filename) ? filename : mContext.getString(R.string.filename_unknown));
long size = metadata.getOriginalSize();
if (size == -1 || size == 0) {
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 4529c2463..1532ba204 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -1334,5 +1334,6 @@
<string name="error_loading_keys">"Error loading keys!"</string>
<string name="error_empty_log">"(error, empty log)"</string>
<string name="error_reading_text">"Could not read input to decrypt!"</string>
+ <string name="filename_unknown"><![CDATA[<no filename>]]></string>
</resources>