GSList *pkg_list = NULL;
char *query = NULL;
- char *query2 = NULL;
gchar *checksum;
if (b == NULL) {
goto end;
}
- query2 = __make_query_with_collation(info.op, info.uri,
- info.mime, info.m_type, info.s_type);
- if (info.uri_r_info) {
- query = __make_query(query, info.op, info.uri_r_info,
- info.mime, info.m_type, info.s_type);
- }
-
- query = __make_query(query, info.op, info.scheme,
- info.mime, info.m_type, info.s_type);
-
- query = __make_query(query, info.op, "*",
- info.mime, info.m_type, info.s_type);
-
- if (info.scheme && (strcmp(info.scheme, "file") == 0)
- && info.mime && (strcmp(info.mime, "NULL") != 0)) {
- query = __make_query(query, info.op, "NULL",
+ query = __make_query_with_collation(info.op, info.uri,
info.mime, info.m_type, info.s_type);
- }
- query = _svc_db_query_builder_or(query2, query);
query = _svc_db_query_builder_build(query);
_svc_db_exec_query(query, &pkg_list, uid);
if (query) {
query = NULL;
}
- if (info.category)
- __get_list_with_category(info.category, &pkg_list, uid);
-
- __get_list_with_submode(info.op, info.win_id, &pkg_list, uid);
-
pkg_count = g_slist_length(pkg_list);
- _D("pkg_count : %d", pkg_count);
-
- if (pkg_count == 1) {
- pkgname = (char *)pkg_list->data;
- if (pkgname != NULL) {
- __put_cache(checksum, pkgname, uid);
- ret = __run_svc_with_pkgname(pkgname, b, request_code,
- cbfunc, data, uid);
- goto end;
- }
- } else if (pkg_count > 1) {
- bundle_add(b, AUL_SVC_K_URI_R_INFO, info.uri);
- __put_cache(checksum, APP_SELECTOR, uid);
- ret = __run_svc_with_pkgname(APP_SELECTOR, b, request_code,
- cbfunc, data, uid);
- goto end;
- }
- __free_pkg_list(pkg_list);
- pkg_list = NULL;
-
- /*scheme & host*/
- if (info.uri_r_info) {
- pkgname = _svc_db_get_app(info.op, info.origin_mime, info.uri_r_info, uid);
-
- if (pkgname != NULL) {
- __put_cache(checksum, pkgname, uid);
- ret = __run_svc_with_pkgname(pkgname, b, request_code,
- cbfunc, data, uid);
- free(pkgname);
- goto end;
+ if (pkg_count > 0) {
+ __free_pkg_list(pkg_list);
+ pkg_list = NULL;
+ if (info.uri_r_info) {
+ query = __make_query(query, info.op, info.uri_r_info,
+ info.mime, info.m_type, info.s_type);
}
- query2 = __make_query(query, info.op, info.uri_r_info,
- info.mime, info.m_type, info.s_type);
query = __make_query(query, info.op, info.scheme,
info.mime, info.m_type, info.s_type);
info.mime, info.m_type, info.s_type);
}
- query = _svc_db_query_builder_or(query2, query);
query = _svc_db_query_builder_build(query);
_svc_db_exec_query(query, &pkg_list, uid);
if (query) {
goto end;
}
} else if (pkg_count > 1) {
- bundle_add(b, AUL_SVC_K_URI_R_INFO, info.uri_r_info);
- __put_cache(checksum, APP_SELECTOR, uid);
+ bundle_add(b, AUL_SVC_K_URI_R_INFO, info.uri);
ret = __run_svc_with_pkgname(APP_SELECTOR, b, request_code,
cbfunc, data, uid);
goto end;
}
-
__free_pkg_list(pkg_list);
pkg_list = NULL;
}
+ /*scheme & host*/
+ if (info.uri_r_info) {
+ pkgname = _svc_db_get_app(info.op, info.origin_mime, info.uri_r_info, uid);
+
+ if (pkgname != NULL) {
+ __put_cache(checksum, pkgname, uid);
+ ret = __run_svc_with_pkgname(pkgname, b, request_code,
+ cbfunc, data, uid);
+ free(pkgname);
+ goto end;
+ }
+
+ query = __make_query(query, info.op, info.uri_r_info,
+ info.mime, info.m_type, info.s_type);
+ query = _svc_db_query_builder_build(query);
+ _svc_db_exec_query(query, &pkg_list, uid);
+ if (query) {
+ free(query);
+ query = NULL;
+ }
+
+ pkg_count = g_slist_length(pkg_list);
+ if (pkg_count > 0) {
+ __free_pkg_list(pkg_list);
+ pkg_list = NULL;
+ query = __make_query(query, info.op, "*",
+ info.mime, info.m_type, info.s_type);
+
+ if (info.scheme && (strcmp(info.scheme, "file") == 0)
+ && info.mime && (strcmp(info.mime, "NULL") != 0)) {
+ query = __make_query(query, info.op, "NULL",
+ info.mime, info.m_type, info.s_type);
+ }
+
+ query = _svc_db_query_builder_build(query);
+ _svc_db_exec_query(query, &pkg_list, uid);
+ if (query) {
+ free(query);
+ query = NULL;
+ }
+
+ if (info.category)
+ __get_list_with_category(info.category, &pkg_list, uid);
+
+ __get_list_with_submode(info.op, info.win_id, &pkg_list, uid);
+
+ pkg_count = g_slist_length(pkg_list);
+ _D("pkg_count : %d", pkg_count);
+
+ if (pkg_count == 1) {
+ pkgname = (char *)pkg_list->data;
+ if (pkgname != NULL) {
+ __put_cache(checksum, pkgname, uid);
+ ret = __run_svc_with_pkgname(pkgname, b, request_code,
+ cbfunc, data, uid);
+ goto end;
+ }
+ } else if (pkg_count > 1) {
+ bundle_add(b, AUL_SVC_K_URI_R_INFO, info.uri_r_info);
+ ret = __run_svc_with_pkgname(APP_SELECTOR, b, request_code,
+ cbfunc, data, uid);
+ goto end;
+ }
+
+ __free_pkg_list(pkg_list);
+ pkg_list = NULL;
+ }
+ }
+
/*scheme*/
pkgname = _svc_db_get_app(info.op, info.origin_mime, info.scheme, uid);
return AUL_SVC_RET_ENOMATCH;
} else {
bundle_add(b, AUL_SVC_K_URI_R_INFO, info.scheme);
- __put_cache(checksum, APP_SELECTOR, uid);
ret = __run_svc_with_pkgname(APP_SELECTOR, b, request_code,
cbfunc, data, uid);
}