On Fri, Aug 19, 2011 at 6:10 PM, Chris Kühl <[email protected]> wrote:
> On Thu, Aug 18, 2011 at 4:03 PM, Patrick Ohly <[email protected]> wrote:
>> On Mo, 2011-08-15 at 15:05 +0200, Chris Kühl wrote:
>>
>> +static bool getPnpInfoNamesFromValues(const std::string &vendorValue,  
>> std::string &vendorName,
>> +                                      const std::string &productValue, 
>> std::string &productName)
>> +{
>> +    static GKeyFile *bt_key_vals = NULL;
>> +
>> +    if(!bt_key_vals) {
>> +        bt_key_vals = g_key_file_new();
>> +        GError *err = NULL;
>> +        string filePath(SyncEvolutionDataDir() + "/bluetooth_products.ini");
>>
>> The syncevo-dbus-server has a feature where it watches files that make
>> up the running process and restarts when any of those change. System
>> daemons do that via package scripts, but for daemons started in a
>> session that doesn't work. The SyncEvolution mechanism currently works
>> for the executable and shared libraries, automatically found from
>> scanning /proc/self/maps.
>>
>> Data files are loaded anew when needed (XML config files, for example).
>> Doing that for every getPnpInfoNamesFromValues() might be a bit often.
>> Perhaps the result can be cached in the D-Bus session instance instead
>> of in a static variable?
>>
>> Or you could manually add that file to the watch list. See
>> DBusServer::run().
>>
>
> Ah, yes. I did notice that code but had forgotten about it.

I forgot to add here that I've added a file monitor to the
BluezManager class to take care of this. It's in a separate commit. on
the *merge_prep branch.

Cheers,
Chris
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to