pidgin/gtkutils.c

changeset 38358
30ba44276e74
parent 38299
770365ded9f8
parent 38260
dcada91c0912
child 38433
361c801c4536
equal deleted inserted replaced
38346:dee30d35e5e7 38358:30ba44276e74
694 -1); 694 -1);
695 695
696 if (pixbuf) 696 if (pixbuf)
697 g_object_unref(pixbuf); 697 g_object_unref(pixbuf);
698 698
699 if (default_proto_id != NULL && !strcmp(purple_protocol_get_id(protocol), default_proto_id)) 699 if (default_proto_id != NULL && purple_strequal(purple_protocol_get_id(protocol), default_proto_id))
700 aop_menu->default_item = i; 700 aop_menu->default_item = i;
701 } 701 }
702 g_list_free(list); 702 g_list_free(list);
703 703
704 return aop_menu; 704 return aop_menu;
1059 proto = purple_connection_get_protocol(gc); 1059 proto = purple_connection_get_protocol(gc);
1060 } 1060 }
1061 1061
1062 protoname = purple_protocol_class_list_icon(proto, account, NULL); 1062 protoname = purple_protocol_class_list_icon(proto, account, NULL);
1063 1063
1064 if (!strcmp(protoname, protocol)) 1064 if (purple_strequal(protoname, protocol))
1065 break; 1065 break;
1066 1066
1067 account = NULL; 1067 account = NULL;
1068 } 1068 }
1069 1069
1070 /* Special case for AIM and ICQ */ 1070 /* Special case for AIM and ICQ */
1071 if (account == NULL && (!strcmp(protocol, "aim") || 1071 if (account == NULL && (purple_strequal(protocol, "aim") ||
1072 !strcmp(protocol, "icq"))) 1072 purple_strequal(protocol, "icq")))
1073 { 1073 {
1074 for (l = list; l != NULL; l = l->next) 1074 for (l = list; l != NULL; l = l->next)
1075 { 1075 {
1076 PurpleConnection *gc; 1076 PurpleConnection *gc;
1077 PurpleProtocol *proto = NULL; 1077 PurpleProtocol *proto = NULL;
1098 proto = purple_connection_get_protocol(gc); 1098 proto = purple_connection_get_protocol(gc);
1099 } 1099 }
1100 1100
1101 protoname = purple_protocol_class_list_icon(proto, account, NULL); 1101 protoname = purple_protocol_class_list_icon(proto, account, NULL);
1102 1102
1103 if (!strcmp(protoname, "aim") || !strcmp(protoname, "icq")) 1103 if (purple_strequal(protoname, "aim") || purple_strequal(protoname, "icq"))
1104 break; 1104 break;
1105 1105
1106 account = NULL; 1106 account = NULL;
1107 } 1107 }
1108 } 1108 }
1548 * nothing we can really send. The only logical one is 1548 * nothing we can really send. The only logical one is
1549 * "Application," but do we really want to send a binary and 1549 * "Application," but do we really want to send a binary and
1550 * nothing else? Probably not. I'll just give an error and 1550 * nothing else? Probably not. I'll just give an error and
1551 * return. */ 1551 * return. */
1552 /* The original patch sent the icon used by the launcher. That's probably wrong */ 1552 /* The original patch sent the icon used by the launcher. That's probably wrong */
1553 if (!g_strcmp0(type, "Link")) { 1553 if (purple_strequal(type, "Link")) {
1554 purple_notify_error(NULL, NULL, _("Cannot send launcher"), 1554 purple_notify_error(NULL, NULL, _("Cannot send launcher"),
1555 _("You dragged a desktop launcher. Most " 1555 _("You dragged a desktop launcher. Most "
1556 "likely you wanted to send the target " 1556 "likely you wanted to send the target "
1557 "of this launcher instead of this " 1557 "of this launcher instead of this "
1558 "launcher itself."), NULL); 1558 "launcher itself."), NULL);
1902 normalized_buddyname = g_utf8_casefold(tmp, -1); 1902 normalized_buddyname = g_utf8_casefold(tmp, -1);
1903 g_free(tmp); 1903 g_free(tmp);
1904 1904
1905 /* There's no sense listing things like: 'xxx "xxx"' 1905 /* There's no sense listing things like: 'xxx "xxx"'
1906 when the name and buddy alias match. */ 1906 when the name and buddy alias match. */
1907 if (buddy_alias && strcmp(buddy_alias, buddyname)) { 1907 if (buddy_alias && !purple_strequal(buddy_alias, buddyname)) {
1908 char *completion_entry = g_strdup_printf("%s \"%s\"", buddyname, buddy_alias); 1908 char *completion_entry = g_strdup_printf("%s \"%s\"", buddyname, buddy_alias);
1909 char *tmp2 = g_utf8_normalize(buddy_alias, -1, G_NORMALIZE_DEFAULT); 1909 char *tmp2 = g_utf8_normalize(buddy_alias, -1, G_NORMALIZE_DEFAULT);
1910 1910
1911 tmp = g_utf8_casefold(tmp2, -1); 1911 tmp = g_utf8_casefold(tmp2, -1);
1912 g_free(tmp2); 1912 g_free(tmp2);
1924 completion_added = TRUE; 1924 completion_added = TRUE;
1925 } 1925 }
1926 1926
1927 /* There's no sense listing things like: 'xxx "xxx"' 1927 /* There's no sense listing things like: 'xxx "xxx"'
1928 when the name and contact alias match. */ 1928 when the name and contact alias match. */
1929 if (contact_alias && strcmp(contact_alias, buddyname)) { 1929 if (contact_alias && !purple_strequal(contact_alias, buddyname)) {
1930 /* We don't want duplicates when the contact and buddy alias match. */ 1930 /* We don't want duplicates when the contact and buddy alias match. */
1931 if (!buddy_alias || strcmp(contact_alias, buddy_alias)) { 1931 if (!purple_strequal(contact_alias, buddy_alias)) {
1932 char *completion_entry = g_strdup_printf("%s \"%s\"", 1932 char *completion_entry = g_strdup_printf("%s \"%s\"",
1933 buddyname, contact_alias); 1933 buddyname, contact_alias);
1934 char *tmp2 = g_utf8_normalize(contact_alias, -1, G_NORMALIZE_DEFAULT); 1934 char *tmp2 = g_utf8_normalize(contact_alias, -1, G_NORMALIZE_DEFAULT);
1935 1935
1936 tmp = g_utf8_casefold(tmp2, -1); 1936 tmp = g_utf8_casefold(tmp2, -1);
2378 const char *value = NULL; 2378 const char *value = NULL;
2379 gchar tmp_buf[4]; 2379 gchar tmp_buf[4];
2380 2380
2381 purple_debug_info("buddyicon", "Converting buddy icon to %s\n", protocol_formats[i]); 2381 purple_debug_info("buddyicon", "Converting buddy icon to %s\n", protocol_formats[i]);
2382 2382
2383 if (g_str_equal(protocol_formats[i], "png")) { 2383 if (purple_strequal(protocol_formats[i], "png")) {
2384 key = "compression"; 2384 key = "compression";
2385 value = "9"; 2385 value = "9";
2386 } else if (g_str_equal(protocol_formats[i], "jpeg")) { 2386 } else if (purple_strequal(protocol_formats[i], "jpeg")) {
2387 sprintf(tmp_buf, "%u", quality); 2387 sprintf(tmp_buf, "%u", quality);
2388 key = "quality"; 2388 key = "quality";
2389 value = tmp_buf; 2389 value = tmp_buf;
2390 } 2390 }
2391 2391
2422 return contents; 2422 return contents;
2423 } 2423 }
2424 2424
2425 g_free(contents); 2425 g_free(contents);
2426 2426
2427 if (!g_str_equal(protocol_formats[i], "jpeg")) { 2427 if (!purple_strequal(protocol_formats[i], "jpeg")) {
2428 /* File size was too big and we can't lower the quality, 2428 /* File size was too big and we can't lower the quality,
2429 so skip to the next image type. */ 2429 so skip to the next image type. */
2430 break; 2430 break;
2431 } 2431 }
2432 2432
3499 return FALSE; 3499 return FALSE;
3500 } 3500 }
3501 3501
3502 str = url + sizeof("open://") - 1; 3502 str = url + sizeof("open://") - 1;
3503 3503
3504 if (strcmp(str, "accounts") == 0) 3504 if (purple_strequal(str, "accounts"))
3505 pidgin_accounts_window_show(); 3505 pidgin_accounts_window_show();
3506 else if (strcmp(str, "prefs") == 0) 3506 else if (purple_strequal(str, "prefs"))
3507 pidgin_prefs_show(); 3507 pidgin_prefs_show();
3508 else 3508 else
3509 return FALSE; 3509 return FALSE;
3510 return TRUE; 3510 return TRUE;
3511 } 3511 }

mercurial