After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742787 - open selector improvements
open selector improvements
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: sébastien lafargue
sébastien lafargue
Depends on:
Blocks:
 
 
Reported: 2015-01-11 23:33 UTC by sébastien lafargue
Modified: 2015-06-18 10:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
open selector improvements (18.19 KB, patch)
2015-01-11 23:33 UTC, sébastien lafargue
reviewed Details | Review
open selector improvements (18.97 KB, patch)
2015-01-12 17:31 UTC, sébastien lafargue
none Details | Review
open selector improvements (18.36 KB, patch)
2015-01-12 18:06 UTC, sébastien lafargue
committed Details | Review

Description sébastien lafargue 2015-01-11 23:33:29 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
Comment 1 Paolo Borelli 2015-01-12 07:57:38 UTC
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
Comment 2 sébastien lafargue 2015-01-12 17:31:25 UTC
Created attachment 294364 [details] [review]
open selector improvements
Comment 3 sébastien lafargue 2015-01-12 18:06:38 UTC
Created attachment 294367 [details] [review]
open selector improvements

commited as b34a069
Comment 4 Sébastien Wilmet 2015-06-18 10:40:30 UTC
The patch has been pushed, let's close the bug…