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 740302 - We need a way to change defaults in tracker-needle
We need a way to change defaults in tracker-needle
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Needle
0.16.x
Other Linux
: Normal enhancement
: ---
Assigned To: tracker-general
tracker-general
Depends on:
Blocks:
 
 
Reported: 2014-11-18 11:01 UTC by Jonathan Brax
Modified: 2015-04-01 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Gsettings for tracker-needle (4.02 KB, patch)
2015-03-23 19:23 UTC, Kunaal Jain
none Details | Review
Gsettings for tracker-needle (4.02 KB, patch)
2015-03-23 19:27 UTC, Kunaal Jain
none Details | Review
tracker-needle: use gsettings (5.07 KB, patch)
2015-03-24 09:13 UTC, Kunaal Jain
none Details | Review
Gsettings for tracker-needle (5.35 KB, patch)
2015-03-29 15:37 UTC, Kunaal Jain
none Details | Review
Gsettings for tracker-needle (1.47 KB, patch)
2015-03-31 21:00 UTC, Kunaal Jain
none Details | Review
Gsettings for tracker-needle (5.35 KB, patch)
2015-03-31 21:04 UTC, Kunaal Jain
committed Details | Review
Gsettings for tracker-needle (5.37 KB, patch)
2015-04-01 10:57 UTC, Kunaal Jain
committed Details | Review

Description Jonathan Brax 2014-11-18 11:01:12 UTC
Most people with desktop search try first to find a file by searching by filename. If that does not help they will widen the search criteria to search inside files also. 

To get to the most useful basic search I now need three clicks every time I start the search: 
1. Start Desktop-search by clicking icon
2. Change to "File name view"
3. Change to search from file names only

We need a way to change a settings panel in tracker-needle so that these most useful and fastest settings can be set as default. So that they become accessible by one click instead of three. 

Googling this I found a mod made for Arch Linux: 
   https://aur.archlinux.org/packages/tracker-needle-configurable/

I suggest something like that to be added to the main branch of tracker-needle. 

My OS: Linux Mint 17 Cinnamon 64 bit.
Comment 1 Martyn Russell 2014-11-19 10:51:55 UTC
Thanks for the suggestion. Are you interested in patching Tracker for us to do this? We would certainly accept a patch to do so...
Comment 2 Kunaal Jain 2015-03-23 19:23:42 UTC
Created attachment 300152 [details] [review]
Gsettings for tracker-needle

Make tracker-needle use gsettings. Stores the last view user was on before closing tracker-needle. When reopening users gets the last type of view. 
This way users who use search by file name or by categories won't have to change the view every time they use tracker-needle.
Comment 3 Kunaal Jain 2015-03-23 19:27:24 UTC
Created attachment 300153 [details] [review]
Gsettings for tracker-needle

minor indent fixes
Comment 4 Kunaal Jain 2015-03-23 19:56:06 UTC
Please note that this patch modifies the file for which I have submitted patch here https://bugzilla.gnome.org/show_bug.cgi?id=746194. To avoid conflicts, first apply that patch and then this patch.
Comment 5 Martyn Russell 2015-03-23 22:25:35 UTC
Review of attachment 300153 [details] [review]:

First, thanks for the patch!
OK, so a few things to fix here:

1. schemas should be created from a .xml.in, like we do with other binaries, that way we get content translated. See:
  a) https://git.gnome.org/browse/tracker/tree/src/tracker-store/org.freedesktop.Tracker.gschema.xml.in
  b) https://git.gnome.org/browse/tracker/tree/src/tracker-store/Makefile.am#n89

2. instead of "print()", use "debug()" or "message()" to use the GLib APIs...

Thanks :)
Comment 6 Kunaal Jain 2015-03-24 09:13:31 UTC
Created attachment 300183 [details] [review]
tracker-needle: use gsettings
Comment 7 Kunaal Jain 2015-03-24 09:53:28 UTC
Thanks Martyn for review. I have made the changes you mentioned. Took some liberty of reordering and commenting in Makefile.am. :)
Comment 8 Martyn Russell 2015-03-29 11:28:26 UTC
Review of attachment 300183 [details] [review]:

Good patch. One ting I would say though... it doesn't make sense to have 3 options when the views are exclusively mutual. It would make more sense to store a value, 0/1/2 for whichever view is used. What happens if someone sets all 3 to TRUE?

We also have a policy to try to keep the settings down (in number).

Everything else is fine. Thanks Kunaal! :)
Comment 9 Kunaal Jain 2015-03-29 15:37:34 UTC
Created attachment 300539 [details] [review]
Gsettings for tracker-needle
Comment 10 Kunaal Jain 2015-03-29 15:40:18 UTC
Thanks for review and suggestion. I agree three settings for mutually exclusive is waste as well as a source of bug. 

I have by default set filelist view (value = 2) so even if settings is buggy it will switch to default view.
Comment 11 Kunaal Jain 2015-03-31 21:00:34 UTC
Created attachment 300710 [details] [review]
Gsettings for tracker-needle
Comment 12 Kunaal Jain 2015-03-31 21:04:20 UTC
Created attachment 300711 [details] [review]
Gsettings for tracker-needle
Comment 13 Martyn Russell 2015-03-31 21:53:52 UTC
Review of attachment 300711 [details] [review]:

Everything looks good except for the default value being 2. The first view should be the default.
If you can update that in the GSettings XML file and the .vala, you can go ahead and commit.

Thanks :)
Comment 14 Kunaal Jain 2015-04-01 10:57:29 UTC
Created attachment 300731 [details] [review]
Gsettings for tracker-needle

Made the first view default (categories view, default-view = 1)
Comment 15 Kunaal Jain 2015-04-01 11:00:22 UTC
Thanks for review. I have made the changes you asked and committed the patch. Please close the bug.
Comment 16 Martyn Russell 2015-04-01 18:59:23 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.