GNOME Bugzilla – Bug 742787
open selector improvements
Last modified: 2015-06-18 10:40:30 UTC
Created attachment 294316 [details] [review] open selector improvements open-selector: improvements - various fixes and cleanuup - refactoring - better items filtering - faster ( consolidation of some files's queries ) and Case-insensitive highlighting of results
Review of attachment 294316 [details] [review]: Some comments without looking at the real core of the patch ::: gedit/gedit-open-document-selector-store.c @@ -111,3 +111,3 @@ } - item = (FileItem *)g_slice_new (FileItem); + item = (FileItem *)g_slice_new0 (FileItem); I see that FileItem is allocated with g_slice_new in a few places. It is usually better to factor out create_file_item and free_file_item helpers ::: gedit/gedit-open-document-selector.c @@ +111,3 @@ +} + + while (*byte_array != BYTE_ARRAY_END && *byte_array == tag_found) space before * ::: gedit/gedit-open-document-selector.h @@ -42,2 +42,3 @@ typedef struct _GeditOpenDocumentSelectorClassPrivate GeditOpenDocumentSelectorClassPrivate; +#define BYTE_ARRAY_END 0xFF Does this need to be "public" in the .h? If no, let's move it to the .c file, if yes, it needs namespacing @@ -42,2 +42,5 @@ typedef struct _GeditOpenDocumentSelectorClassPrivate GeditOpenDocumentSelectorClassPrivate; +#define BYTE_ARRAY_END 0xFF + +/* Value 0xFF is reserved to mark the end of the array */ I guess this comment was for the define above and not for the enum? If instead it is here because it is logically part of the enum note that you can do enum { A, B, C = 42 } Also, at a quick glance it seems this could all go at the top of the .c file
Created attachment 294364 [details] [review] open selector improvements
Created attachment 294367 [details] [review] open selector improvements commited as b34a069
The patch has been pushed, let's close the bug…