[meld] preferences: New pref for applying text filters in folder comparison
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] preferences: New pref for applying text filters in folder comparison
- Date: Tue, 10 Feb 2015 19:30:04 +0000 (UTC)
commit b9db8f475e4976649fcb55fef79d3522135d2a97
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Feb 10 06:20:57 2015 +1000
preferences: New pref for applying text filters in folder comparison
New preferences are awful, but this has been a long-standing issue for
performance of folder comparisons, and it's often not clear to new
users that it's a thing we do. Also, the upcoming newline-ignoring
change makes this even more expensive, so now seems like the right time
to add this.
data/org.gnome.meld.gschema.xml | 5 +++++
data/ui/preferences.ui | 16 ++++++++++++++++
meld/preferences.py | 16 ++++++++++------
3 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.meld.gschema.xml b/data/org.gnome.meld.gschema.xml
index a58408c..c625b23 100644
--- a/data/org.gnome.meld.gschema.xml
+++ b/data/org.gnome.meld.gschema.xml
@@ -161,6 +161,11 @@
<summary>File timestamp resolution</summary>
<description>When comparing based on mtime, this is the minimum difference in nanoseconds between
two files before they're considered to have different mtimes. This is useful when comparing files between
filesystems with different timestamp resolution.</description>
</key>
+ <key name="folder-filter-text" type="b">
+ <default>true</default>
+ <summary>Apply text filters during folder comparisons</summary>
+ <description>If true, folder comparisons that compare file contents also apply active text filters
and the blank line trimming option, and ignore newline differences.</description>
+ </key>
<key name="folder-status-filters" type="as">
<default>['normal', 'modified', 'new']</default>
<summary>File status filters</summary>
diff --git a/data/ui/preferences.ui b/data/ui/preferences.ui
index c5e8afb..fa3330e 100644
--- a/data/ui/preferences.ui
+++ b/data/ui/preferences.ui
@@ -787,6 +787,22 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_folder_filter_text">
+ <property name="label" translatable="yes">Apply text filters during folder
comparisons</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/meld/preferences.py b/meld/preferences.py
index 1c0cd1a..1fb0875 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -199,6 +199,7 @@ class PreferencesDialog(Component):
('use-system-editor', self.system_editor_checkbutton, 'active'),
('custom-editor-command', self.custom_edit_command_entry, 'text'),
('folder-shallow-comparison', self.checkbutton_shallow_compare, 'active'),
+ ('folder-filter-text', self.checkbutton_folder_filter_text, 'active'),
('folder-ignore-symlinks', self.checkbutton_ignore_symlinks, 'active'),
('vc-show-commit-margin', self.checkbutton_show_commit_margin, 'active'),
('vc-commit-margin', self.spinbutton_commit_margin, 'value'),
@@ -212,12 +213,15 @@ class PreferencesDialog(Component):
for key, obj, attribute in bindings:
settings.bind(key, obj, attribute, Gio.SettingsBindFlags.DEFAULT)
- settings.bind(
- 'use-system-editor', self.custom_edit_command_entry, 'sensitive',
- Gio.SettingsBindFlags.DEFAULT | Gio.SettingsBindFlags.INVERT_BOOLEAN)
- settings.bind(
- 'use-system-font', self.fontpicker, 'sensitive',
- Gio.SettingsBindFlags.DEFAULT | Gio.SettingsBindFlags.INVERT_BOOLEAN)
+ invert_bindings = [
+ ('use-system-editor', self.custom_edit_command_entry, 'sensitive'),
+ ('use-system-font', self.fontpicker, 'sensitive'),
+ ('folder-shallow-comparison', self.checkbutton_folder_filter_text, 'sensitive'),
+ ]
+ for key, obj, attribute in invert_bindings:
+ settings.bind(
+ key, obj, attribute, Gio.SettingsBindFlags.DEFAULT |
+ Gio.SettingsBindFlags.INVERT_BOOLEAN)
self.checkbutton_wrap_text.bind_property(
'active', self.checkbutton_wrap_word, 'sensitive',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]