bugGNUstep - Bugs: bug #34790, bindings not working without...

Group
 
 

bug #34790: bindings not working without synchronize for the first time

Submitter:  julian <julian_>
Submitted:  Wed 09 Nov 2011 11:08:59 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Ready For Test
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 16 Jan 2012 11:38:11 AM UTC, comment #9: 

ok inside GSBindingResolveMultipleValueBool

the keyPath is @"values.hide" (not @"values.hidden")

now the problem is, despite having erased all gnustep defaults files, there is a key named "hide" that is set to YES in the user defaults controller, in the NSRegistrationDomain (its the very last):


(gdb) po controller
<NSUserDefaultsController: 0x149d368>
(gdb) po [controller defaults]
<NSUserDefaults: 0x9024d8> SearchList: (GSPrimaryDomain, NSArgumentDomain, HelloWorld, NSGlobalDomain, GSConfigDomain, German, English, NSRegistrationDomain) Persistent: {HelloWorld = {}; NSGlobalDomain = {}; gdnc = {}; } Temporary: {GSConfigDomain = {"GNUSTEP_LOCAL_ADMIN_APPS" = "/extradisk/gnustep/Local/Applications/Admin"; "GNUSTEP_LOCAL_ADMIN_TOOLS" = "/extradisk/gnustep/Local/Tools/Admin"; "GNUSTEP_LOCAL_APPS" = "/extradisk/gnustep/Local/Applications"; "GNUSTEP_LOCAL_DOC" = "/extradisk/gnustep/Local/Library/Documentation"; "GNUSTEP_LOCAL_DOC_INFO" = "/extradisk/gnustep/Local/Library/Documentation/info"; "GNUSTEP_LOCAL_DOC_MAN" = "/extradisk/gnustep/Local/Library/Documentation/man"; "GNUSTEP_LOCAL_HEADERS" = "/extradisk/gnustep/Local/Library/Headers"; "GNUSTEP_LOCAL_LIBRARIES" = "/extradisk/gnustep/Local/Library/Libraries"; "GNUSTEP_LOCAL_LIBRARY" = "/extradisk/gnustep/Local/Library"; "GNUSTEP_LOCAL_ROOT" = "/extradisk/gnustep/Local"; "GNUSTEP_LOCAL_TOOLS" = "/extradisk/gnustep/Local/Tools"; "GNUSTEP_LOCAL_USERS_DIR" = "/home"; "GNUSTEP_LOCAL_WEB_APPS" = "/extradisk/gnustep/Local/Library/WebApplications"; "GNUSTEP_MAKEFILES" = "/extradisk/gnustep/System/Library/Makefiles"; "GNUSTEP_NETWORK_ADMIN_APPS" = "/extradisk/gnustep/Local/Applications/Admin"; "GNUSTEP_NETWORK_ADMIN_TOOLS" = "/extradisk/gnustep/Local/Tools/Admin"; "GNUSTEP_NETWORK_APPS" = "/extradisk/gnustep/Local/Applications"; "GNUSTEP_NETWORK_DOC" = "/extradisk/gnustep/Local/Library/Documentation"; "GNUSTEP_NETWORK_DOC_INFO" = "/extradisk/gnustep/Local/Library/Documentation/info"; "GNUSTEP_NETWORK_DOC_MAN" = "/extradisk/gnustep/Local/Library/Documentation/man"; "GNUSTEP_NETWORK_HEADERS" = "/extradisk/gnustep/Local/Library/Headers"; "GNUSTEP_NETWORK_LIBRARIES" = "/extradisk/gnustep/Local/Library/Libraries"; "GNUSTEP_NETWORK_LIBRARY" = "/extradisk/gnustep/Local/Library"; "GNUSTEP_NETWORK_ROOT" = "/extradisk/gnustep/Network"; "GNUSTEP_NETWORK_TOOLS" = "/extradisk/gnustep/Local/Tools"; "GNUSTEP_NETWORK_USERS_DIR" = "/home"; "GNUSTEP_NETWORK_WEB_APPS" = "/extradisk/gnustep/Local/Library/WebApplications"; "GNUSTEP_SYSTEM_ADMIN_APPS" = "/extradisk/gnustep/System/Applications/Admin"; "GNUSTEP_SYSTEM_ADMIN_TOOLS" = "/extradisk/gnustep/System/Tools/Admin"; "GNUSTEP_SYSTEM_APPS" = "/extradisk/gnustep/System/Applications"; "GNUSTEP_SYSTEM_DOC" = "/extradisk/gnustep/System/Library/Documentation"; "GNUSTEP_SYSTEM_DOC_INFO" = "/extradisk/gnustep/System/Library/Documentation/info"; "GNUSTEP_SYSTEM_DOC_MAN" = "/extradisk/gnustep/System/Library/Documentation/man"; "GNUSTEP_SYSTEM_HEADERS" = "/extradisk/gnustep/System/Library/Headers"; "GNUSTEP_SYSTEM_LIBRARIES" = "/extradisk/gnustep/System/Library/Libraries"; "GNUSTEP_SYSTEM_LIBRARY" = "/extradisk/gnustep/System/Library"; "GNUSTEP_SYSTEM_ROOT" = "/extradisk/gnustep/System"; "GNUSTEP_SYSTEM_TOOLS" = "/extradisk/gnustep/System/Tools"; "GNUSTEP_SYSTEM_USERS_DIR" = "/home"; "GNUSTEP_SYSTEM_WEB_APPS" = "/extradisk/gnustep/System/Library/WebApplications"; "GNUSTEP_USER_CONFIG_FILE" = ".GNUstep.conf"; "GNUSTEP_USER_DEFAULTS_DIR" = "GNUstep/Defaults"; "GNUSTEP_USER_DIR" = GNUstep; "GNUSTEP_USER_DIR_ADMIN_APPS" = "GNUstep/Applications/Admin"; "GNUSTEP_USER_DIR_ADMIN_TOOLS" = "GNUstep/Tools/Admin"; "GNUSTEP_USER_DIR_APPS" = "GNUstep/Applications"; "GNUSTEP_USER_DIR_DOC" = "GNUstep/Library/Documentation"; "GNUSTEP_USER_DIR_DOC_INFO" = "GNUstep/Library/Documentation/info"; "GNUSTEP_USER_DIR_DOC_MAN" = "GNUstep/Library/Documentation/man"; "GNUSTEP_USER_DIR_HEADERS" = "GNUstep/Library/Headers"; "GNUSTEP_USER_DIR_LIBRARIES" = "GNUstep/Library/Libraries"; "GNUSTEP_USER_DIR_LIBRARY" = "GNUstep/Library"; "GNUSTEP_USER_DIR_TOOLS" = "GNUstep/Tools"; "GNUSTEP_USER_DIR_WEB_APPS" = "GNUstep/Library/WebApplications"; }; GSPrimaryDomain = {NSLanguages = (German, English); }; NSArgumentDomain = {}; NSRegistrationDomain = {NSAMPMDesignation = (AM, PM); NSDateTimeOrdering = DMYH; NSEarlierTimeDesignations = (prior, last, past, ago); NSHourNameDesignations = ((0, midnight), (12, noon, lunch), (10, morning), (14, afternoon), (19, dinner)); NSLaterTimeDesignations = (next); NSMonthNameArray = (January, February, March, April, May, June, July, August, September, October, November, December); NSNextDayDesignations = (tomorrow); NSNextNextDayDesignations = (nextday); NSPriorDayDesignations = (yesterday); NSShortMonthNameArray = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec); NSShortWeekDayNameArray = (Sun, Mon, Tue, Wed, Thu, Fri, Sat); NSThisDayDesignations = (today); NSWeekDayNameArray = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); NSYearMonthWeekDesignations = (year, month, week); hide = YES; }; }

julian <julian_>
Sat 14 Jan 2012 04:55:45 PM UTC, comment #8: 

Ah, I had not realised that the "hidden" binding was an OR binding. Of course this gets handled by the code in GSBindingResolveMultipleValueBool and some clever coder put in some even cleverer code in there that I now fail to understand. OK, I understand what it does, but not how it could result in different results on your machine. The only way to resolve this is for you to debug through that function. I would expect that the loop gets executed once and that value will be nil (before and after the transformation). [value boolValue] should result in 0 and this isn't equal to GSBindingOperationOr (= 1). The problematic bit might be !operationKind, this is an enumerated type and I am not sure whether !0 = YES, in this case. Maybe we should rewrite the code here to use BOOL variables in a save way.

Fred Kiefer <FredKiefer>
Group Member
Sun 20 Nov 2011 07:27:37 PM UTC, comment #7: 

interestingly it seems like setValueFor: is never called.

however setValue:forKey: is. i debugged it a bit attached is the session. if it doesn't help just let me know what i should do.

(file #24405)

julian <julian_>
Tue 15 Nov 2011 11:27:26 PM UTC, comment #6: 

no problem, will look into it, but it will take a few days.

julian <julian_>
Tue 15 Nov 2011 11:23:58 PM UTC, comment #5: 

Sorry, I really don't have a clue here. Could you please try to debug this issue? You should start by setting a break point on line 516 in the file NSKeyValueBinding.m. This is inside of the  method setValueFor:. You will have to debug down into GSBindingResolveMultipleValueBool. I would expect that all the values there are nil and that the following setValue:forKey: call handles this as zero.

Fred Kiefer <FredKiefer>
Group Member
Tue 15 Nov 2011 01:07:45 PM UTC, comment #4: 

i double checked previously because it seemed so weird to me.

now i did another svn update / install, removed the whole ~/GNUstep folder and re-checked, still the same, working fine but initially hidden.

the app even prints out that it created an empty user defaults database...

this is a physical ubuntu 11.04 machine, i can also test in 32 and 64 bit ubuntu 10.4 VMs if you want.

julian <julian_>
Tue 15 Nov 2011 09:58:32 AM UTC, comment #3: 

Interestingly this is different for me. Here the label is initially visible. Could you please double check that there is no left over default in you .GNUstepDefaults file?

Otherwise I will have to track down a difference between my 64bit machine and yours.

Fred Kiefer <FredKiefer>
Group Member
Sun 13 Nov 2011 06:23:28 PM UTC, comment #2: 

thanks i can confirm using the sample app that the bindings now work.

there is one problem left. since no default is set for the key "hide", it should be equal to the default being zero. however, the label is initially hidden now, as if the default was set to one.

julian <julian_>
Sun 13 Nov 2011 04:46:19 PM UTC, comment #1: 

We only watch the values that were already requested, that is the values that anybody is listening to. Now when the original value is not present, we get back a value of nil and this was treated as it there was no value at all. I added a special marker value and now empty values get watched just like pre-existing ones.

Fred Kiefer <FredKiefer>
Group Member
Wed 09 Nov 2011 11:08:59 PM UTC, original submission:  

ok this bug is very unimportant i'm just reporting it for completeness.

if you bind an user interface element to a key of the standard user defaults controller the binding and don't provide a default value, the binding won't work without calling synchronize after setting the key.

launch the attached app. you can hide and unhide the label with the buttons, but it does not work on the first start of the app.  quit the app. now a value for the user defaults key is already set and on subsequent runs the app works fine.

this can of course be fixed by either providing a default value (but one usually does only for "nonzero defaults") or by synchronizing the user defaults controller (but this is usually done only when necessary).

so there is you unimportant bug for rainy days.

julian <julian_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #24405:  debug.txt added by julian_ (15KiB - text/plain)
file #24339:  gnustepbug-synchronize.zip added by julian_ (120KiB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by julian_ (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-11-20 julian_ Attached File- Added debug.txt, #24405
    2011-11-13 FredKiefer StatusNone Ready For Test
        Assigned toNone FredKiefer
        Open/ClosedOpen In Test
    2011-11-09 julian_ Attached File- Added gnustepbug-synchronize.zip, #24339

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code