summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoohye Shin <soohye.shin@samsung.com>2015-10-15 13:34:30 +0900
committerSoohye Shin <soohye.shin@samsung.com>2015-10-15 14:59:15 +0900
commitceea255186e9d1404985178bd3ed7cc298153a7b (patch)
tree7573516d904a21dece069ec1aff9465a225e93a7
parent9960ce886ca8387053075cb425c5ee2789570b6c (diff)
downloadair_home-ceea255186e9d1404985178bd3ed7cc298153a7b.tar.gz
air_home-ceea255186e9d1404985178bd3ed7cc298153a7b.tar.bz2
air_home-ceea255186e9d1404985178bd3ed7cc298153a7b.zip
prevent:472260 - remove append string function for type of user list
Change-Id: Ibf3c336c669089eb37f54da7f484096644ce048d Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r--src/data/data_user.c46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/data/data_user.c b/src/data/data_user.c
index 1461ce0..85faf84 100644
--- a/src/data/data_user.c
+++ b/src/data/data_user.c
@@ -20,9 +20,9 @@
#include <stdbool.h>
#include <viewmgr.h>
#include <stdlib.h>
-#include <gum/gum-user.h>
-#include <gum/gum-user-service.h>
-#include <gum/common/gum-user-types.h>
+#include <gum-user.h>
+#include <gum-user-service.h>
+#include <common/gum-user-types.h>
#include <gio/gio.h>
#include "data_user.h"
@@ -292,33 +292,6 @@ static bool _load_login_user(Eina_List **list)
return true;
}
-static gchar **_append_string(gchar **src_strv, const gchar *string)
-{
- gchar **dest_strv;
- gint ind;
- gint len;
-
- if (src_strv)
- len = g_strv_length(src_strv);
-
- len = 0;
- ind = 0;
- dest_strv = NULL;
-
- dest_strv = (gchar **)g_malloc0(sizeof(gchar *) * (len + 2));
- if (src_strv) {
- while (src_strv[ind]) {
- dest_strv[ind] = g_strdup(src_strv[ind]);
- ind++;
- }
- }
-
- dest_strv[ind++] = g_strdup(string);
- dest_strv[ind] = NULL;
-
- return dest_strv;
-}
-
static bool _load_users(Eina_List **list)
{
GumUserList *ulist;
@@ -327,21 +300,22 @@ static bool _load_users(Eina_List **list)
GumUserType type;
struct datamgr_item *di;
char *name, *icon;
- gchar **strv;
uid_t uid, user_uid;
int i;
+ static const gchar * const strv[] = {
+ GUM_LIST_USERTYPE_NORMAL,
+ GUM_LIST_USERTYPE_ADMIN,
+ NULL
+ };
+
service = gum_user_service_create_sync(FALSE);
if (!service) {
_ERR("failed to create service");
return false;
}
- strv = _append_string(NULL, GUM_LIST_USERTYPE_NORMAL);
- strv = _append_string(strv, GUM_LIST_USERTYPE_ADMIN);
- ulist = gum_user_service_get_user_list_sync(service,
- (const gchar *const *)strv);
- g_strfreev(strv);
+ ulist = gum_user_service_get_user_list_sync(service, strv);
if (!ulist) {
_ERR("failed to get user list");
g_object_unref(service);