| 589 } |
589 } |
| 590 |
590 |
| 591 void gaim_prefs_rename(const char *oldname, const char *newname) { |
591 void gaim_prefs_rename(const char *oldname, const char *newname) { |
| 592 struct gaim_pref *oldpref, *newpref; |
592 struct gaim_pref *oldpref, *newpref; |
| 593 |
593 |
| 594 gaim_debug_info("prefs", "Attempting to rename %s to %s\n", oldname, newname); |
|
| 595 |
|
| 596 oldpref = find_pref(oldname); |
594 oldpref = find_pref(oldname); |
| 597 newpref = find_pref(newname); |
595 newpref = find_pref(newname); |
| 598 |
596 |
| 599 /* it's already been renamed, call off the dogs */ |
597 /* it's already been renamed, call off the dogs */ |
| 600 if(!oldpref) |
598 if(!oldpref) |
| 601 return; |
599 return; |
| 602 |
600 |
| 603 g_return_if_fail(newpref != NULL); /* the new one needs to be created */ |
601 gaim_debug_info("prefs", "Renaming %s to %s\n", oldname, newname); |
| |
602 |
| |
603 g_return_if_fail(newpref != NULL); /* the new one needs to be created first */ |
| 604 g_return_if_fail(oldpref->type == newpref->type); |
604 g_return_if_fail(oldpref->type == newpref->type); |
| 605 g_return_if_fail(oldpref->first_child == NULL); /* can't rename parents */ |
605 g_return_if_fail(oldpref->first_child == NULL); /* can't rename parents */ |
| 606 |
606 |
| 607 switch(oldpref->type) { |
607 switch(oldpref->type) { |
| 608 case GAIM_PREF_NONE: |
608 case GAIM_PREF_NONE: |