Author Topic: [Solved] Preference pane settings do not save  (Read 29414 times)

0 Members and 1 Guest are viewing this topic.

lebidou

  • Resident
  • Posts: 133
Re: Preference pane settings do not save
« Reply #15 on: April 17, 2009, 03:17:47 PM »
I had some spare time to spend on this today, so I looked at the Synapticonfigload errors.
Apparently, it comes from the lack of an autorelease pool requested by the NSStrings tmp1 and tmp2. I modified this according to sample codes (I'm not an objective C expert neither).

If someone with more Obj-C knowledge could take a look at the diff:

Code: [Select]
--- synapticsconfigload/synapticsconfigload.m 2009-02-16 10:54:14.000000000 +0100
+++ synapticsconfigload.m 2009-04-17 14:35:29.000000000 +0200
@@ -12,7 +12,6 @@
  CFDataRef dat;
  CFDictionaryRef plist;
  CFStringRef *keys;
- NSString *tmp1, *tmp2;
  CFTypeRef *vals;
  int i;
 
@@ -23,10 +22,20 @@
  return 1;
  }
 
- f=fopen ([tmp2=[NSHomeDirectory() stringByAppendingString:tmp1
- = [NSString stringWithCString: "/Library/Preferences/org.voodoo.SynapticsTouchpad.plist"]] UTF8String], "rb");
- CFRelease(tmp1);
- CFRelease(tmp2);
+ //There was no AutoreleasePool, here is the allocation and init
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *tmp1, *tmp2;
+
+ //NSStrings Allocation and Initialization
+ tmp1 = [[NSString alloc] initWithCString:"/Library/Preferences/org.voodoo.SynapticsTouchpad.plist"];
+ tmp2 = [[NSString alloc] init];
+ tmp2 = [NSHomeDirectory() stringByAppendingString:tmp1];
+
+ f=fopen ([tmp2 UTF8String], "rb");
+
+ //We release the AutoreleasePool, this also releases tmp1 and tmp2
+ [pool release];
 
  if (!f)
  {

I hope it helps.

cogombo

  • Entrant
  • Posts: 6
Re: Preference pane settings do not save
« Reply #16 on: May 31, 2009, 11:52:27 PM »
The problem seems to come from the LaunchAgent plist file.

I modified mine with Lingon to set the value RunAtLoad wich wasn't present in the original one. Attached it to let you test if works for everyone (Copy it in /Library/LaunchAgents).

It seems to work here.

SUPERB!! perfect!

psychov

  • Entrant
  • Posts: 1
Re: [Solved] Preference pane settings do not save
« Reply #17 on: March 19, 2010, 03:30:00 PM »
have the same thing after all recomendations of this thread. settings doesn't saves.
any ideas?

eXyr0w

  • Entrant
  • Posts: 1
Re: [Solved] Preference pane settings do not save
« Reply #18 on: October 04, 2010, 08:22:38 PM »
thank you, this thread helped me to save the preferences in voodoops2...