summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Regier <alias301@gmail.com>2011-03-25 21:56:25 -0700
committerSteve Frécinaux <code@istique.net>2011-03-26 19:52:01 +0100
commitd883e816828cbe2d1f8928bcd13affb36a1ee60b (patch)
treeba1e7e2a579203ed62e209346734f058884b2994
parent567f5da7ddcb024ee72a0bec03a3313230044643 (diff)
downloadlibpeas-d883e816828cbe2d1f8928bcd13affb36a1ee60b.tar.gz
Make peas_plugin_info_get_authors() consistent with other API.
The PeasPluginInfo getters usually return an empty array rather than NULL, so let's be consistent here.
-rw-r--r--libpeas/peas-plugin-info.c2
-rw-r--r--tests/libpeas/plugin-info.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/libpeas/peas-plugin-info.c b/libpeas/peas-plugin-info.c
index 10a59e0..f76f893 100644
--- a/libpeas/peas-plugin-info.c
+++ b/libpeas/peas-plugin-info.c
@@ -209,6 +209,8 @@ _peas_plugin_info_new (const gchar *filename,
/* Get Authors */
info->authors = g_key_file_get_string_list (plugin_file, "Plugin",
"Authors", NULL, NULL);
+ if (info->authors == NULL)
+ info->authors = g_new0 (gchar *, 1);
/* Get Copyright */
str = g_key_file_get_string (plugin_file, "Plugin", "Copyright", NULL);
diff --git a/tests/libpeas/plugin-info.c b/tests/libpeas/plugin-info.c
index 6fe6a6b..2202b75 100644
--- a/tests/libpeas/plugin-info.c
+++ b/tests/libpeas/plugin-info.c
@@ -97,6 +97,7 @@ test_plugin_info_verify_min_info (PeasEngine *engine)
{
PeasPluginInfo *info;
GError *error = NULL;
+ const gchar **authors;
info = peas_engine_get_plugin_info (engine, "min-info");
@@ -119,7 +120,8 @@ test_plugin_info_verify_min_info (PeasEngine *engine)
g_assert_cmpstr (peas_plugin_info_get_version (info), ==, NULL);
g_assert_cmpstr (peas_plugin_info_get_help_uri (info), ==, NULL);
- g_assert (peas_plugin_info_get_authors (info) == NULL);
+ authors = peas_plugin_info_get_authors (info);
+ g_assert (authors != NULL && authors[0] == NULL);
}
static void