Changeset 4dc6b8d for protocols


Ignore:
Timestamp:
2010-03-12T01:05:21Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
7c5affca
Parents:
56244c0
Message:

Added support for PURPLE_PREF_STRING_LIST style settings, this makes the
QQ module (and maybe others) work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r56244c0 r4dc6b8d  
    6868                char *def = NULL;
    6969                set_eval eval = NULL;
     70                void *eval_data = NULL;
     71                GList *io = NULL;
     72                GSList *opts = NULL;
    7073               
    7174                name = purple_account_option_get_setting( o );
     
    9093                        break;
    9194               
     95                case PURPLE_PREF_STRING_LIST:
     96                        def = g_strdup( purple_account_option_get_default_list_value( o ) );
     97                        for( io = purple_account_option_get_list( o ); io; io = io->next )
     98                        {
     99                                PurpleKeyValuePair *kv = io->data;
     100                                opts = g_slist_append( opts, kv->key );
     101                        }
     102                        eval = set_eval_list;
     103                        eval_data = opts;
     104                        break;
     105                       
    92106                default:
    93                         fprintf( stderr, "Setting with unknown type: %s (%d)\n", name, purple_account_option_get_type( o ) );
     107                        irc_usermsg( acc->irc, "Setting with unknown type: %s (%d) Expect stuff to break..\n",
     108                                     name, purple_account_option_get_type( o ) );
    94109                        name = NULL;
    95110                }
     
    99114                        s = set_add( &acc->set, name, def, eval, acc );
    100115                        s->flags |= ACC_SET_OFFLINE_ONLY;
     116                        s->eval_data = eval_data;
    101117                        g_free( def );
    102118                }
     
    150166                {
    151167                case PURPLE_PREF_STRING:
     168                case PURPLE_PREF_STRING_LIST:
    152169                        purple_account_set_string( pa, name, set_getstr( &acc->set, name ) );
    153170                        break;
Note: See TracChangeset for help on using the changeset viewer.