[tracker/follow-symlinks: 2/2] tracker-preferences: Add preference to follow symlinks
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/follow-symlinks: 2/2] tracker-preferences: Add preference to follow symlinks
- Date: Tue, 22 Jul 2014 16:18:52 +0000 (UTC)
commit 36db7b5dd8cfde4a5618a97f0cd586cacbb04bd9
Author: Martyn Russell <martyn lanedo com>
Date: Tue Jul 22 17:15:48 2014 +0100
tracker-preferences: Add preference to follow symlinks
....freedesktop.Tracker.Miner.Files.gschema.xml.in | 6 ++
src/tracker-preferences/tracker-preferences.ui | 72 +++++++++++++++++++-
src/tracker-preferences/tracker-preferences.vala | 10 +++
3 files changed, 86 insertions(+), 2 deletions(-)
---
diff --git a/data/gschemas/org.freedesktop.Tracker.Miner.Files.gschema.xml.in
b/data/gschemas/org.freedesktop.Tracker.Miner.Files.gschema.xml.in
index f8c424a..e1b377f 100644
--- a/data/gschemas/org.freedesktop.Tracker.Miner.Files.gschema.xml.in
+++ b/data/gschemas/org.freedesktop.Tracker.Miner.Files.gschema.xml.in
@@ -90,6 +90,12 @@ Boston, MA 02110-1301, USA.
<default>true</default>
</key>
+ <key name="follow-symlinks" type="b">
+ <_summary>Follow symlinks</_summary>
+ <_description>Set to true to follow any symlinks found, disabled by default because this can be
dangerous</_description>
+ <default>false</default>
+ </key>
+
<key name="index-removable-devices" type="b">
<_summary>Index removable devices</_summary>
<_description>Set to true to enable indexing mounted directories for removable devices.</_description>
diff --git a/src/tracker-preferences/tracker-preferences.ui b/src/tracker-preferences/tracker-preferences.ui
index 2310721..31207ab 100644
--- a/src/tracker-preferences/tracker-preferences.ui
+++ b/src/tracker-preferences/tracker-preferences.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.2 -->
+<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkAdjustment" id="adjustment_delay">
@@ -1458,6 +1458,74 @@ Most commonly this is used to ignore directories like *~, *.o, *.la, etc</proper
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
+ <object class="GtkFrame" id="frame_what_is_crawled">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_follow_symlinks">
+ <property name="label" translatable="yes">Follow S_ymlinks</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled"
handler="tracker_preferences_checkbutton_follow_symlinks_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">What is crawled?</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkFrame" id="frame_what_is_indexed">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -1539,7 +1607,7 @@ Most commonly this is used to ignore directories like *~, *.o, *.la, etc</proper
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
diff --git a/src/tracker-preferences/tracker-preferences.vala
b/src/tracker-preferences/tracker-preferences.vala
index f641c8d..6f04dc7 100644
--- a/src/tracker-preferences/tracker-preferences.vala
+++ b/src/tracker-preferences/tracker-preferences.vala
@@ -71,6 +71,7 @@ public class Tracker.Preferences {
private ToggleButton togglebutton_pictures;
private ToggleButton togglebutton_videos;
private ToggleButton togglebutton_download;
+ private CheckButton checkbutton_follow_symlinks;
private CheckButton checkbutton_index_file_content;
private CheckButton checkbutton_index_numbers;
private Box hbox_duplicate_warning;
@@ -151,6 +152,7 @@ public class Tracker.Preferences {
togglebutton_pictures = builder.get_object ("togglebutton_pictures") as ToggleButton;
togglebutton_videos = builder.get_object ("togglebutton_videos") as ToggleButton;
togglebutton_download = builder.get_object ("togglebutton_download") as ToggleButton;
+ checkbutton_follow_symlinks = builder.get_object ("checkbutton_follow_symlinks") as
CheckButton;
checkbutton_index_file_content = builder.get_object ("checkbutton_index_file_content") as
CheckButton;
checkbutton_index_numbers = builder.get_object ("checkbutton_index_numbers") as CheckButton;
hbox_duplicate_warning = builder.get_object ("hbox_duplicate_warning") as Box;
@@ -229,6 +231,8 @@ public class Tracker.Preferences {
togglebutton_videos.active = model_contains (liststore_index, "&VIDEOS");
togglebutton_download.active = model_contains (liststore_index, "&DOWNLOAD");
+ checkbutton_follow_symlinks.active = settings_miner_fs.get_boolean ("follow-symlinks");
+
checkbutton_index_file_content.active = settings_fts.get_int ("max-words-to-index") > 0;
checkbutton_index_numbers.active = settings_fts.get_boolean ("ignore-numbers") != true;
@@ -584,6 +588,12 @@ public class Tracker.Preferences {
}
[CCode (instance_pos = -1)]
+ public void checkbutton_follow_symlinks_toggled_cb (CheckButton source) {
+ settings_miner_fs.set_boolean ("follow-symlinks", source.active);
+ suggest_restart = true;
+ }
+
+ [CCode (instance_pos = -1)]
public void checkbutton_index_file_content_toggled_cb (CheckButton source) {
// FIXME: Should make number configurable, 10000 is the default.
if (source.active) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]