@@ -24,23 +24,24 @@ void TizenAutofill::InitailizeAutofill() {
24
24
25
25
int ret = autofill_connect (
26
26
autofill_,
27
- [](autofill_h ah , autofill_connection_status_e status, void * user_data) {
28
- },
29
- NULL );
27
+ [](autofill_h autofill , autofill_connection_status_e status,
28
+ void * user_data) { },
29
+ nullptr );
30
30
if (ret != AUTOFILL_ERROR_NONE) {
31
- FT_LOG (Error) << __FUNCTION__ << " connect_autofill_daemon error" ;
31
+ FT_LOG (Error) << " connect_autofill_daemon error" ;
32
32
}
33
33
34
34
autofill_fill_response_set_received_cb (
35
35
autofill_,
36
- [](autofill_h ah, autofill_fill_response_h fill_response, void * data) {
36
+ [](autofill_h autofill, autofill_fill_response_h fill_response,
37
+ void * data) {
37
38
int count = 0 ;
38
39
autofill_fill_response_get_group_count (fill_response, &count);
39
40
autofill_fill_response_foreach_group (
40
41
fill_response,
41
- [](autofill_fill_response_group_h group_h , void * user_data) {
42
+ [](autofill_fill_response_group_h group , void * user_data) {
42
43
autofill_fill_response_group_foreach_item (
43
- group_h ,
44
+ group ,
44
45
[](autofill_fill_response_item_h item, void * user_data) {
45
46
char * id = nullptr ;
46
47
char * value = nullptr ;
@@ -74,11 +75,11 @@ void TizenAutofill::InitailizeAutofill() {
74
75
75
76
return true ;
76
77
},
77
- group_h );
78
+ group );
78
79
return true ;
79
80
},
80
81
&count);
81
- TizenAutofill::GetInstance ().CallPopupCallback ();
82
+ TizenAutofill::GetInstance ().OnPopup ();
82
83
},
83
84
nullptr );
84
85
@@ -95,10 +96,14 @@ void TizenAutofill::RequestAutofill(std::vector<std::string> hints,
95
96
autofill_view_info_set_app_id (view_info, app_id);
96
97
autofill_view_info_set_view_id (view_info, id.c_str ());
97
98
99
+ if (app_id) {
100
+ free (app_id);
101
+ }
102
+
98
103
for (auto hint : hints) {
99
104
std::optional<autofill_hint_e> autofill_hint = ConvertAutofillHint (hint);
100
105
if (autofill_hint.has_value ()) {
101
- autofill_item_h item;
106
+ autofill_item_h item = nullptr ;
102
107
autofill_item_create (&item);
103
108
autofill_item_set_autofill_hint (item, autofill_hint.value ());
104
109
autofill_item_set_id (item, id.c_str ());
@@ -119,36 +124,36 @@ void TizenAutofill::RequestAutofill(std::vector<std::string> hints,
119
124
120
125
void TizenAutofill::RegisterAutofillItem (std::string view_id,
121
126
AutofillItem item) {
122
- autofill_save_item_h si_h ;
127
+ autofill_save_item_h save_item = nullptr ;
123
128
124
- autofill_save_item_create (&si_h );
125
- autofill_save_item_set_autofill_hint (si_h , item.hint_ );
126
- autofill_save_item_set_id (si_h , item.id_ .c_str ());
127
- autofill_save_item_set_label (si_h , item.label_ .c_str ());
128
- autofill_save_item_set_sensitive_data (si_h , item.sensitive_data_ );
129
- autofill_save_item_set_value (si_h , item.value_ .c_str ());
129
+ autofill_save_item_create (&save_item );
130
+ autofill_save_item_set_autofill_hint (save_item , item.hint_ );
131
+ autofill_save_item_set_id (save_item , item.id_ .c_str ());
132
+ autofill_save_item_set_label (save_item , item.label_ .c_str ());
133
+ autofill_save_item_set_sensitive_data (save_item , item.sensitive_data_ );
134
+ autofill_save_item_set_value (save_item , item.value_ .c_str ());
130
135
131
136
char * app_id;
132
137
app_get_id (&app_id);
133
138
134
- autofill_save_view_info_h svi_h ;
139
+ autofill_save_view_info_h save_view_info = nullptr ;
135
140
136
- autofill_save_view_info_create (&svi_h );
137
- autofill_save_view_info_set_app_id (svi_h , app_id);
138
- autofill_save_view_info_set_view_id (svi_h , view_id.c_str ());
141
+ autofill_save_view_info_create (&save_view_info );
142
+ autofill_save_view_info_set_app_id (save_view_info , app_id);
143
+ autofill_save_view_info_set_view_id (save_view_info , view_id.c_str ());
139
144
140
- autofill_save_view_info_add_item (svi_h, si_h );
145
+ autofill_save_view_info_add_item (save_view_info, save_item );
141
146
142
147
if (app_id) {
143
148
free (app_id);
144
149
}
145
150
146
- int ret = autofill_commit (autofill_, svi_h );
151
+ int ret = autofill_commit (autofill_, save_view_info );
147
152
if (ret != AUTOFILL_ERROR_NONE) {
148
153
FT_LOG (Error) << " autofill_commit error" ;
149
154
}
150
155
151
- autofill_save_view_info_destroy (svi_h );
156
+ autofill_save_view_info_destroy (save_view_info );
152
157
}
153
158
154
159
std::optional<autofill_hint_e> TizenAutofill::ConvertAutofillHint (
0 commit comments