Small improvements

This commit is contained in:
M66B 2019-02-04 16:10:30 +00:00
parent 783bdd68ed
commit 0f8e958935
4 changed files with 6 additions and 6 deletions

View File

@ -1217,7 +1217,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
for (EntityAttachment attachment : attachments)
if (EntityAttachment.PGP_MESSAGE.equals(attachment.encryption)) {
if (!attachment.available)
throw new IllegalArgumentException(getString(R.string.title_attachments_missing));
throw new IllegalArgumentException(context.getString(R.string.title_attachments_missing));
File file = EntityAttachment.getFile(context, attachment.id);
encrypted = new BufferedInputStream(new FileInputStream(file));
@ -1246,7 +1246,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}
if (encrypted == null)
throw new IllegalArgumentException(getString(R.string.title_not_encrypted));
throw new IllegalArgumentException(context.getString(R.string.title_not_encrypted));
ByteArrayOutputStream decrypted = new ByteArrayOutputStream();

View File

@ -635,7 +635,7 @@ public class FragmentAccount extends FragmentBase {
}
if (!inbox)
throw new IllegalArgumentException(getString(R.string.title_no_inbox));
throw new IllegalArgumentException(context.getString(R.string.title_no_inbox));
if (!archive && altArchive != null)
altArchive.type = EntityFolder.ARCHIVE;
if (!drafts && altDrafts != null)

View File

@ -1543,7 +1543,7 @@ public class FragmentCompose extends FragmentBase {
if (drafts == null)
drafts = db.folder().getPrimaryDrafts();
if (drafts == null)
throw new IllegalArgumentException(getString(R.string.title_no_primary_drafts));
throw new IllegalArgumentException(context.getString(R.string.title_no_primary_drafts));
String body = "";

View File

@ -208,7 +208,7 @@ public class FragmentFolder extends FragmentBase {
Log.i("Creating folder=" + name);
if (TextUtils.isEmpty(name))
throw new IllegalArgumentException(getString(R.string.title_folder_name_missing));
throw new IllegalArgumentException(context.getString(R.string.title_folder_name_missing));
EntityFolder create = new EntityFolder();
create.account = aid;
@ -323,7 +323,7 @@ public class FragmentFolder extends FragmentBase {
int count = db.operation().getOperationCount(id, null);
if (count > 0)
throw new IllegalArgumentException(
getResources().getQuantityString(
context.getResources().getQuantityString(
R.plurals.title_notification_operations, count, count));
db.folder().setFolderTbd(id);