*/
#include <app_preference.h>
+#include <app_manager.h>
#include "cluster_data.h"
#include "cluster_db.h"
#include "conf.h"
#define CLUSTER_DATA_PAGE_COUNT "cluster_page_count"
+#define MAX_SIZE 100
static struct {
Eina_List *data_list;
{
if (cluster_db_create()) {
/* Do not show default calendar widget for common profile */
- //__cluster_data_insert_default_data();
+ __cluster_data_insert_default_data();
cluster_data_set_page_count(1);
}
cluster_db_get_list(&cluster_data_s.data_list);
* org.tizen.music-player.widget
* org.tizen.contacts-widget
*/
+ char default_widget[MAX_SIZE] = {0};
+ char path[MAX_SIZE];
+ app_info_h appHandle = NULL;
+
+ char *path1 = app_get_resource_path();
+ if(!path1) {
+ __E("Resource Path not found");
+ return;
+ }
+ snprintf(path,MAX_SIZE,"%s%s",path1,"default-widget.conf");
+ __D("Conf file path : [%s]", path);
+ free(path1);
+ FILE *fp = fopen(path,"r");
+
+ if (!fp) {
+ __E("Conf file default-widget.conf doesn't exist at path : [%s]", path);
+ return;
+ }
+
+ fscanf(fp,"%s",default_widget);
+ fclose(fp);
+
+ __D("Default Widget : [%s]", default_widget);
+
+ int nRet = app_info_create(default_widget, &appHandle);
+ if (nRet != APP_MANAGER_ERROR_NONE) {
+ __E("Default Widget not installed in the device : [%s]", default_widget);
+ return;
+ }
+ __D("Default Widget installed in the device : [%s]", default_widget);
+ app_info_destroy(appHandle);
+
+
widget_data_t *new_item = (widget_data_t *)malloc(sizeof(widget_data_t));
memset(new_item, 0, sizeof(widget_data_t));
new_item->page_idx = 0;
new_item->pos_y = 0;
new_item->pos_x = 0;
- new_item->pkg_name = strdup("org.tizen.calendar.widget");
+ new_item->pkg_name = strdup(default_widget);
new_item->widget_label = strdup(add_widget_data_get_widget_label(new_item->pkg_name));
new_item->content_info = NULL;