Merge lp:~kalikiana/midori/folderzg into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 6243
Merged at revision: 6261
Proposed branch: lp:~kalikiana/midori/folderzg
Merge into: lp:midori
Diff against target: 24 lines (+7/-0)
1 file modified
midori/midori-browser.c (+7/-0)
To merge this branch: bzr merge lp:~kalikiana/midori/folderzg
Reviewer Review Type Date Requested Status
André Auzi Approve
Review via email: mp+172402@code.launchpad.net

Commit message

Don't insert folders into the log

Description of the change

Don't insert folders into the log

To post a comment you must log in.
Revision history for this message
André Auzi (aauzi) wrote :

The remaining risk, if callers don't respect the contract:

 * midori_browser_update_history:
 * @item: a #KatzeItem
 * @type: "website", "bookmark" or "download"
 * @event: "access", "leave", "modify", "delete"

is that KatzeItems of other type are used. For the moment I only think about separators.

It may be more robust for future evolutions to code:

if (!KATZE_ITEM_IS_BOOKMARK (item))
    return;

review: Needs Fixing
Revision history for this message
Cris Dywan (kalikiana) wrote :

I don't quite agree with that:

I wanted to fix the assertion quickly, but I didn't want to block on researching how to get a path/to/folder, what format to use and delay the fix - ultimately it's possible and desirable to log folders in zeitgeist as well. I should've pointed that out to begin with.

If a separator is passed most likely that's a bug in any relevant calling code. Maybe g_return_if_fail (KATZE_ITEM_IS_SEPARATOR (item)) instead?

Revision history for this message
André Auzi (aauzi) wrote :

> I don't quite agree with that:
>
> I wanted to fix the assertion quickly, but I didn't want to block on
> researching how to get a path/to/folder, what format to use and delay the fix
> - ultimately it's possible and desirable to log folders in zeitgeist as well.
> I should've pointed that out to begin with.
>
> If a separator is passed most likely that's a bug in any relevant calling
> code. Maybe g_return_if_fail (KATZE_ITEM_IS_SEPARATOR (item)) instead?

sorry, I missed the ZEITGEIST_NFO_BOOKMARK_FOLDER existence.

g_return_if_fail (KATZE_ITEM_IS_SEPARATOR (item)) would be a plus.

I would then add a FIXME comment to trace the final intent.

lp:~kalikiana/midori/folderzg updated
6243. By Cris Dywan

Assert that separators don't get logged

Revision history for this message
Cris Dywan (kalikiana) wrote :

André, can you give this another look? This is a bug fix and I'd like to get it in before freeze.

Revision history for this message
André Auzi (aauzi) wrote :

After carefully reading the zeigeist documents, it appears to me that the "subject" uri we use for bookmarks is wrong as well.

We currently use the bookmarked uri while we should probably use an uri identifying the bookmark itself.

I could not find a standard way to identify bookmarks with uri, in our case it could be something like:
midori://Bookmarks/.../bookmark_name

and uri for folders could then become:
midori://Bookmarks/.../folder_name

But that's another story, the fix can go as it is.

review: Approve
Revision history for this message
Cris Dywan (kalikiana) wrote :

Filed bug 1200943 for a follow up.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2013-07-01 20:20:53 +0000
3+++ midori/midori-browser.c 2013-07-07 10:11:26 +0000
4@@ -470,6 +470,8 @@
5 const gchar* type,
6 const gchar* event)
7 {
8+ g_return_if_fail (!KATZE_ITEM_IS_SEPARATOR (item));
9+
10 #ifdef HAVE_ZEITGEIST
11 const gchar* inter;
12 if (strstr (event, "access"))
13@@ -484,6 +486,11 @@
14 inter = ZEITGEIST_ZG_DELETE_EVENT;
15 else
16 g_assert_not_reached ();
17+
18+ /* FIXME: Should insert folders into the log (ZEITGEIST_NFO_BOOKMARK_FOLDER) */
19+ if (KATZE_ITEM_IS_FOLDER (item))
20+ return;
21+
22 zeitgeist_log_insert_events_no_reply (zeitgeist_log_get_default (),
23 zeitgeist_event_new_full (inter, ZEITGEIST_ZG_USER_ACTIVITY,
24 "application://midori.desktop",

Subscribers

People subscribed via source and target branches

to all changes: