Commit Graph

1187 Commits

Author SHA1 Message Date
Jesse Vincent 3b0b3dcab1 Revert "refactor getHeaders and removeHeaders to use a common method and an"
Subtly flawed. Returned the wrong headers

This reverts commit 657b3961f86b1b694fb7587216ecefeb0b20f5d2.
2010-11-27 04:03:29 +00:00
Jesse Vincent 73565abfdd BatchButton area toggling should't happen from anything other than the
UiThread:

Fixes a common error from the market:

android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRoot.checkThread(ViewRoot.java:2802)
at android.view.ViewRoot.invalidateChild(ViewRoot.java:607)
at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:633)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:2505)
at android.view.View.invalidate(View.java:5139)
at android.view.View.setFlags(View.java:4502)
at android.view.View.setVisibility(View.java:3030)
at
com.fsck.k9.activity.MessageList.hideBatchButtons(MessageList.java:2883)
at
com.fsck.k9.activity.MessageList.toggleBatchButtons(MessageList.java:2906)
at com.fsck.k9.activity.MessageList.access$500(MessageList.java:77)
at
com.fsck.k9.activity.MessageList$MessageListAdapter.pruneDirtyMessages(MessageList.java:2302)
at com.fsck.k9.activity.MessageList$1.run(MessageList.java:811)
2010-11-26 03:55:22 +00:00
Jesse Vincent 3dd7af2cac refactor getHeaders and removeHeaders to use a common method and an
iterator to address a Market FC:

java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
at com.fsck.k9.mail.internet.MimeHeader.getHeader(MimeHeader.java:87)
at
com.fsck.k9.mail.internet.MimeHeader.getFirstHeader(MimeHeader.java:51)
at
com.fsck.k9.mail.internet.MimeMessage.getFirstHeader(MimeMessage.java:437)
at
com.fsck.k9.mail.internet.MimeMessage.getContentType(MimeMessage.java:130)
at
com.fsck.k9.mail.internet.MimeMessage.getMimeType(MimeMessage.java:159)
at
com.fsck.k9.mail.internet.MimeUtility.findFirstPartByMimeType(MimeUtility.java:971)
at com.fsck.k9.crypto.Apg.isEncrypted(Apg.java:464)
at
com.fsck.k9.activity.MessageView.updateDecryptLayout(MessageView.java:2702)
at
com.fsck.k9.activity.MessageView$Listener$6.run(MessageView.java:2466)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
2010-11-26 03:55:18 +00:00
Jesse Vincent 83955d3278 Be more careful about deleting messages from the MessageListAdapter -
don't do it from something that's not the UI thread
2010-11-10 21:12:42 +00:00
Jesse Vincent 02996f8743 ack. broken paren 2010-11-03 00:47:43 +00:00
Jesse Vincent 0b36393c8c Guard against null content from html parts on reply/forward, which was
causing a bunch of NPEs on the market.
2010-11-03 00:45:13 +00:00
Jesse Vincent 5bfdb31733 We care about eclair MR1, not eclair 2010-11-03 00:45:09 +00:00
Jesse Vincent ccafc36b31 Use a more backward compatible os version check, since the "current"
best practice is incompatible with 1.5
2010-10-29 22:36:39 +00:00
Jesse Vincent e8b331a447 SINGLE_COLUMN layouts cause Android 1.0-2.1 to segfault. 2010-10-29 03:28:59 +00:00
Jesse Vincent 5496239df6 get to: contacts working right. 2010-10-29 03:28:53 +00:00
Jesse Vincent 413c32467d message_to_label and message_to_fmt were used from places that weren't
their original sources. rename them to lie less.
2010-10-29 03:28:43 +00:00
Jesse Vincent 480f2cdf55 redo our messagelist sigil code to not break sender colorization 2010-10-29 03:28:34 +00:00
Jesse Vincent 79d0528981 Try to send pending messages whenever we refresh pushers. should help
with "stuck" unsent messages on push-only accounts
2010-10-29 03:28:27 +00:00
Jesse Vincent e9186056ea unify two codepaths that sent unsent messages, one of them without a notification 2010-10-29 03:28:23 +00:00
Jesse Vincent 43b2cc0c82 add a variant of sendPendingMessages that will send pending messages in all accounts 2010-10-29 03:28:17 +00:00
Jesse Vincent aef21fd288 Never show an undismissable "new email" notification for a null account (like used to happen during setup) 2010-10-29 03:28:06 +00:00
Jesse Vincent 4d9383675f The "viewport" hinting we used to try to better fit messages by default
made android zooming incredibly unreliable. Now it's only somewhat
unreliable.
2010-10-29 03:28:01 +00:00
Jesse Vincent aa494796b4 Merge branch 'master' into 3.2-MAINT
* master:
  Improved accessibility for next/prev buttons     (reported by a screenreader user)
  We've been seeing a lot of FCs on htmlifcation of large messages due to running out of memory during our heavy HTMLification. Try to be a bit lighter on the poor RAM if a plain text message is big.
2010-10-23 17:35:31 +00:00
Jesse Vincent d4dca71bda Merge branch 'master' into 3.2-MAINT
* master: (28 commits)
  Updated MIME Type list with http://www.stdicon.com/mimetypes
  It turns out that not every android release has a good extension to mimetype mapping. restore our previous hardcoded mime database as a fallback
  Fix for NPE when changing the identity
  Bumped manifest to ${version.name}
  Fix phantom messages in unified inbox.
  added a synchronous variant of searchLocalMessages
  Bumped manifest to ${version.name}
  first pass at importing the traditional chinese translation from Issue 2500 ( thanks to zhangyin@research.neu.edu.cn)
  notification that the dataset changed needs to happen on the UI thread.
  When returning from a messageview to a messagelist do our listview updates on a thread rather than on the main ui thread. it results in the list blinking with old data, but that's still a better user experience than "frozen"
  astyle
  update a comment about an uncommon code path
  Add gmail-style "to me" and "cc me" indicators in messagelist
  When doing a message search, break it into "first 10" and "more" - because a long SQL query takes more time before starting to return results, K-9 was increasingly slow on large folders.
  Running heavy operations on the UI thread makes K-9's UI slow and freezy.  addOrUpdateMessages is very heavy. and very common.
  Corrected small typo
  Update issue 7031 http://code.google.com/p/android/issues/detail?id=7031 added removeDialog() for every dismissDialog()
  Same as r2450 Rename strings-sv.xml to strings.xml (Android ignores the actual file name, rename is for consistency)
  Revert "For the common case of "getMessage" where we actually have the object in"
  Calculate preview for html-only messages
  ...

Conflicts:
	AndroidManifest.xml
	src/com/fsck/k9/activity/MessageList.java
	src/com/fsck/k9/provider/MessageProvider.java
2010-10-23 16:34:37 +00:00
cketti 038e5812b4 Backport:
- Fix NullPointerException when saving account settings for non-IMAP accounts.
- Cosmetic code changes
- Use the correct package name for AccessibleEmailContentActivity in AndroidManifest.xml
2010-10-13 21:42:47 +00:00
Jesse Vincent 8a4cbef3c1 MessageProvider: making sure exposed cursor gets dereferenced on close (and closed on finalization) to prevent memory leak 2010-10-11 21:15:54 +00:00
Jesse Vincent 6249c4a81c Optimize the new return-to-listview code. (Avoid a bug where we do far
too much work on first open of a message list)
2010-10-11 19:48:10 +00:00
Jesse Vincent d07aca3008 "Preferences" -> "Settings" for consistency 2010-10-11 14:54:23 +00:00
Jesse Vincent c5d68fb49d Add preferences to enable pinch-to-zoom and single-column layout for
messages
2010-10-11 14:54:15 +00:00
Jesse Vincent 5fc78b4219 astyle 2010-10-11 00:08:54 +00:00
Jesse Vincent a683186f6e move 3 IMAP preferences out of the "wizard" flow to an advanced page
where they belong
2010-10-11 00:08:47 +00:00
Jesse Vincent 28388b235e move "saveAllHeaders" to the account preferences screen. 2010-10-11 00:08:39 +00:00
Jesse Vincent 777c3e28b5 Disable theme in preferences to work around an android bug 2010-10-10 19:29:15 +00:00
Fiouz 296ab4f2be Update issue 1623
Message retrieval:
- Use the given projection for the cursor result instead of always using a predefined projection. Extraction logic is now in dedicated classes for easy extension.
- Added BaseColumns._ID & BaseColumns._COUNT columns.
- Deprecated "id" column since it's not a reliable identifier (it's an incremential value generated at query() time)
2010-10-09 09:19:24 +00:00
cketti 3503355b2e "Reply after quote" preference wasn't persisted. 2010-10-09 03:17:59 +00:00
cketti 385c34e190 Refactoring
- Moved ListPreference helper functions from FontSizeSettings to K9PreferenceActivity
- Used helper functions in Prefs
- Reordered preferences in Prefs to match the order in global_preferences.xml (display order)
2010-10-09 01:05:29 +00:00
cketti 96f18734f4 Minor rename 2010-10-09 00:48:46 +00:00
cketti da7210d1db Refactoring: Some variable, method, and id renaming. 2010-10-09 00:38:52 +00:00
cketti 7028a4c167 Fixes issue 2144
- Removed the contact names cache (memory leak)
- Changed Contacts.searchByAddress() to Contacts.getNameForAddress(). Cursor is now immediately closed.
- Only try to resolve contact names when "Global settings" -> "Show contact name" is checked
- Never resolve contact names if number of recipients exceeds a threshold
2010-10-09 00:24:43 +00:00
cketti 4f429ec3bc Update issue 2144
Forgot to actually save the value when leaving global settings.
2010-10-09 00:13:46 +00:00
cketti 23b53bd660 Update issue 2144
Added option to show names from contacts to global preferences (value isn't used yet).
2010-10-08 23:50:33 +00:00
Jesse Vincent 72cb0bf7ec remove debugging statement 2010-10-08 06:56:50 +00:00
Jesse Vincent 8c1eda3149 An attempt at cleaning up after the 3.00x and earlier bug that caused
K-9 to leave old headers hanging around in the database
2010-10-08 06:33:04 +00:00
Jesse Vincent ccc9a99d94 make batch buttons behave correctly if the last selected item is deleted
while in a messageview
2010-10-08 06:18:45 +00:00
Jesse Vincent b0de9913e0 more correct list updates after restore 2010-10-08 06:18:30 +00:00
Jesse Vincent 7881039cbf astyle 2010-10-08 05:34:46 +00:00
Jesse Vincent 945bccd633 First pass at a sane "restore list state" behavior when going back to a
messagelist from a message view
2010-10-08 05:34:33 +00:00
Jesse Vincent 78f797dda8 A previous refactoring broke notification for messages from the user by
replacing  a localized string with substitutions with a concatenation
in one of two places the string was used.
2010-10-08 05:09:38 +00:00
Fiouz 6feb483f36 Update issue 1623
Restored accidently dropped content resolver notification code (dropped during r2397 refactoring)
First pass at documenting exposed fields
2010-10-06 20:14:33 +00:00
Fiouz f858c72482 Added @Override compile check 2010-10-06 17:51:35 +00:00
cketti 9b5436d23b Removed (redundant) debug logging from the IMAP parser code. 2010-10-06 01:50:02 +00:00
Fiouz 548e6e7c77 Update issue 1623
Don't export the formatted date through the content provider: now exported as the raw Epoch value - date formatting is a UI concern. That makes MessageInfoHolder lighter.
2010-10-05 22:33:20 +00:00
Fiouz 58c80ad096 Update issue 1623
Added semaphore to prevent third party content resolver from exhausting K-9 resources: it won't allow more than 1 cursor to be active at the same time. Concurrent threads (other content resolver invocations) will be suspended until the previous cursor gets released.
2010-10-05 20:23:07 +00:00
Jesse Vincent 6061c42ea9 find src/com/fsck/ -name \*.java|xargs astyle --style=ansi --mode=java --indent-switches --indent=spaces=4 --convert-tabs 2010-10-05 06:04:28 +00:00
Jesse Vincent 58bb54a588 when quoting an html body part for forwarding, downrez it to plain text.
In the glorious future, we should be forwarding as an attachment. but
this is better than the previous behaviour
2010-10-05 06:04:16 +00:00