[Commits] [SCM] clawsker branch, master, updated. 1.1.1-4-gd2b9c23

mones at claws-mail.org mones at claws-mail.org
Sat Jul 14 12:04:04 CEST 2018


The branch, master has been updated
       via  d2b9c2328c530bfe3501b45f969007d95dc48973 (commit)
      from  566c5535b6faceb69ff2d81cf7a7fa4f61189b74 (commit)

Summary of changes:
 clawsker |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)


- Log -----------------------------------------------------------------
commit d2b9c2328c530bfe3501b45f969007d95dc48973
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sat Jul 14 11:54:38 2018 +0200

    Don't update modifications if no initial value
    
    This happens with hidden properties of plugins which are not used and
    therefore there's no value on clawsrc. Could also happen with removed
    hidden properties which are not present in newer Claws Mail installs.
    
    In both cases the widgets are disabled in UI, but the handler is run on
    startup, causing a warning (undefined value used in comparison) and
    modifiying the counter, wich in turn causes the warning dialog to be
    wrongly shown on exit.

diff --git a/clawsker b/clawsker
index b25168c..b286a67 100755
--- a/clawsker
+++ b/clawsker
@@ -347,7 +347,8 @@ sub get_claws_version {
 sub handle_bool_value {
     my ($widget, $event, $dataref) = @_;
     $$dataref->[VALUE] = ($widget->get_active ())? '1': '0';
-    $MODIFIED += $$dataref->[VALUE] != $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] != $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub handle_int_value {
@@ -362,13 +363,15 @@ sub handle_int_value {
     else {
         $widget->set_text ($$dataref->[VALUE]);
     }
-    $MODIFIED += $$dataref->[VALUE] != $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] != $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub handle_string_value {
     my ($widget, $event, $dataref) = @_;
     $$dataref->[VALUE] = $widget->get_text ();
-    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub handle_nchar_value {
@@ -376,7 +379,8 @@ sub handle_nchar_value {
     $_ = substr ($widget->get_text (), 0, $maxlen);
     $widget->set_text ($_);
     $$dataref->[VALUE] = $_;
-    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub gdk_color_from_str {
@@ -405,13 +409,15 @@ sub handle_color_value {
     my ($widget, $event, $dataref) = @_;
     my $newcol = $widget->get_color;
     $$dataref->[VALUE] = str_from_gdk_color ($newcol);
-    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub handle_selection_value {
     my ($widget, $event, $dataref) = @_;
     $$dataref->[VALUE] = $widget->get_active;
-    $MODIFIED += $$dataref->[VALUE] != $$dataref->[IVALUE]? 1: -1;
+    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1
+        if $$dataref->[IVALUE];
 }
 
 sub get_rc_filename {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Hidden preferences editor for Claws Mail


More information about the Commits mailing list