Mercurial > pidgin
comparison plugins/log_reader.c @ 14077:034a3ffa09de
[gaim-migrate @ 16698]
CID 218
Also a win32 compile fix.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 11 Aug 2006 02:20:18 +0000 |
parents | 8bda65b88e49 |
children | ec4a3eb4c709 |
comparison
equal
deleted
inserted
replaced
14076:7f0e6b3f4832 | 14077:034a3ffa09de |
---|---|
898 from_name_matches = (gaim_str_has_prefix( | 898 from_name_matches = (gaim_str_has_prefix( |
899 from_name, alias) && | 899 from_name, alias) && |
900 !isalnum(*(from_name + | 900 !isalnum(*(from_name + |
901 alias_length))); | 901 alias_length))); |
902 | 902 |
903 to_name_matches = (gaim_str_has_prefix( | 903 to_name_matches = to_name && (gaim_str_has_prefix( |
904 to_name, alias) && | 904 to_name, alias) && |
905 !isalnum(*(to_name + | 905 !isalnum(*(to_name + |
906 alias_length))); | 906 alias_length))); |
907 | 907 |
908 g_free(alias); | 908 g_free(alias); |
1680 */ | 1680 */ |
1681 HKEY hKey; | 1681 HKEY hKey; |
1682 char buffer[1024] = ""; | 1682 char buffer[1024] = ""; |
1683 DWORD size = (sizeof(buffer) - 1); | 1683 DWORD size = (sizeof(buffer) - 1); |
1684 DWORD type; | 1684 DWORD type; |
1685 gboolean found = FALSE; | |
1685 | 1686 |
1686 path = NULL; | 1687 path = NULL; |
1687 /* TODO: Test this after removing the trailing "\\". */ | 1688 /* TODO: Test this after removing the trailing "\\". */ |
1688 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\", | 1689 if(ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "Trillian.SkinZip\\shell\\Add\\command\\", |
1689 0, KEY_QUERY_VALUE, &hKey)) { | 1690 0, KEY_QUERY_VALUE, &hKey)) { |
1718 RegCloseKey(hKey); | 1719 RegCloseKey(hKey); |
1719 } | 1720 } |
1720 | 1721 |
1721 if (!path) { | 1722 if (!path) { |
1722 char *folder = wgaim_get_special_folder(CSIDL_PROGRAM_FILES); | 1723 char *folder = wgaim_get_special_folder(CSIDL_PROGRAM_FILES); |
1723 if (folder) | 1724 if (folder) { |
1724 path = g_build_filename(folder, "Trillian", | 1725 path = g_build_filename(folder, "Trillian", |
1725 "users", "default", "talk.ini", NULL); | 1726 "users", "default", "talk.ini", NULL); |
1726 g_free(folder); | 1727 g_free(folder); |
1727 } | 1728 } |
1728 } | 1729 } |
1729 | 1730 |
1730 gboolean found = FALSE; | |
1731 | |
1732 if (path) { | 1731 if (path) { |
1733 /* Read talk.ini file to find the log directory. */ | 1732 /* Read talk.ini file to find the log directory. */ |
1734 GError *error = NULL; | 1733 GError *error = NULL; |
1735 | 1734 |
1736 #if 0 && GTK_CHECK_VERSION(2,6,0) /* FIXME: Not tested yet. */ | 1735 #if 0 && GLIB_CHECK_VERSION(2,6,0) /* FIXME: Not tested yet. */ |
1737 GKeyFile *key_file; | 1736 GKeyFile *key_file; |
1738 | 1737 |
1739 gaim_debug(GAIM_DEBUG_INFO, "Trillian talk.ini read", | 1738 gaim_debug(GAIM_DEBUG_INFO, "Trillian talk.ini read", |
1740 "Reading %s\n", path); | 1739 "Reading %s\n", path); |
1741 if (!g_key_file_load_from_file(key_file, path, G_KEY_FILE_NONE, GError &error)) { | 1740 if (!g_key_file_load_from_file(key_file, path, G_KEY_FILE_NONE, GError &error)) { |
1758 found = TRUE; | 1757 found = TRUE; |
1759 } | 1758 } |
1760 | 1759 |
1761 g_key_file_free(key_file); | 1760 g_key_file_free(key_file); |
1762 } | 1761 } |
1763 #else /* !GTK_CHECK_VERSION(2,6,0) */ | 1762 #else /* !GLIB_CHECK_VERSION(2,6,0) */ |
1764 GError *error = NULL; | |
1765 gsize length; | 1763 gsize length; |
1764 gchar *contents = NULL; | |
1766 | 1765 |
1767 gaim_debug(GAIM_DEBUG_INFO, "Trillian talk.ini read", | 1766 gaim_debug(GAIM_DEBUG_INFO, "Trillian talk.ini read", |
1768 "Reading %s\n", path); | 1767 "Reading %s\n", path); |
1769 if (!g_file_get_contents(path, &contents, &length, &error)) { | 1768 if (!g_file_get_contents(path, &contents, &length, &error)) { |
1770 gaim_debug(GAIM_DEBUG_ERROR, "Trillian talk.ini read", | 1769 gaim_debug(GAIM_DEBUG_ERROR, "Trillian talk.ini read", |