[GCI] [Notepad] Sorting encrypted notes, issue 187

Showing 1-9 of 9 messages
[GCI] [Notepad] Sorting encrypted notes, issue 187 Shuhao 11/25/11 12:16 PM
Here's the link to GCI: http://www.google-melange.com/gci/task/view/google/gci2011/7116278

I've been studying through the code for adding the notes view. The way I understand it is that this is the workflow:
  1. The SQLite database gets queried, and it's queried with a certain order gotten from PreferenceActivity
  2. The notes stored in the SQLite database is encrypted, hence the ordering of alphabetical or reverse alphabetical wouldn't work as they're encrypted strings.
  3. The NoteListCursorAdapter takes the cursor, iterates through and sets each item in the list. It iterates through according to the order that's first queried.
So the main problem I'm having is that since everything is in the cursor, and I can't change the ordering of the cursor (?), it'll be difficult to change this.

Am I missing something? 

Shuhao
Re: [Notepad] Sorting encrypted notes, issue 187 Peli 11/26/11 6:39 AM
Answered by Randy on your task page:
http://www.google-melange.com/gci/task/view/google/gci2011/7116278

I think the tactics would be to store the plain text titles in some
kind of cache that is created once all strings are decrypted, and then
sort the list according to that cache. That gets invalidated as soon
as the user logs out of OI Safe.

Peli

On Nov 25, 9:16 pm, Shuhao Wu <ad...@thekks.net> wrote:
> Here's the link to GCI:http://www.google-melange.com/gci/task/view/google/gci2011/7116278
>
> I've been studying through the code for adding the notes view. The way I
> understand it is that this is the workflow:
>
>    1. The SQLite database gets queried, and it's queried with a certain
>    order gotten from PreferenceActivity
>    2. The notes stored in the SQLite database is encrypted, hence the

>    ordering of alphabetical or reverse alphabetical wouldn't work as they're
>    encrypted strings.
>    3. The NoteListCursorAdapter takes the cursor, iterates through and sets

>    each item in the list. It iterates through according to the order that's
>    first queried.
>
> So the main problem I'm having is that since everything is in the cursor,
> and I can't change the ordering of the cursor (?), it'll be difficult to
> change this.
>
> Am I missing something?
>
> Shuhao

Re: [GCI] [Notepad] Sorting encrypted notes, issue 187 Shuhao 11/26/11 1:38 PM
The problem is that the list is constructed via a CursorAdapter. So the construction of the UI is done via the ordering of the Cursor.

Does this mean I have to rewrite a significant portion of the interface?
Re: [Notepad] Sorting encrypted notes, issue 187 Peli 11/27/11 3:08 PM
Probably this means you have to write a custom cursor. However, maybe
it is possible to replace just the cursor by a custom cursor
(MatrixCursor?), without the need to modify too much of the rest of
the code...

Let us know if you think the task is too involved or should be split
into smaller parts.

Peli

Re: [Notepad] Sorting encrypted notes, issue 187 Shuhao 11/27/11 3:29 PM
It might be a bit involved, in the sense that I need to understand how several parts of the code works. So I think I'll need some help with that.
Re: [Notepad] Sorting encrypted notes, issue 187 Shuhao 11/30/11 4:23 PM
Yeah, after some further investigation, i don't think the task can be done without rewriting a lot, because currently we're getting the rows from OpenMatrixCursor's data rows and then using a mEncryptedStringHashMap to map the encrypted to the decrypted string.

This might take a while to do and I don't have the time right now to do such a complicated task (even though the feature is quite trivia).
Re: Sorting encrypted notes, issue 187 Peli 11/30/11 11:03 PM
Ok, so unclaim this task and pick some other task. You may comment
directly on the issue page of 187 what you just wrote here.

Peli

Re: Sorting encrypted notes, issue 187 Shuhao 12/1/11 12:57 PM
Yeah, Is it okay if I create an issue (something I want to work on) and claim it?
Re: Sorting encrypted notes, issue 187 aap 12/1/11 7:16 PM
Shuhao,

It would be easier to answer this question if you give us some idea what you have in mind.  If we like it, we might even create the issue for you.

-- Aaron


On Thursday, December 1, 2011 3:57:42 PM UTC-5, Shuhao wrote:
Yeah, Is it okay if I create an issue (something I want to work on) and claim it?