if (!__add_event_handlers())
return false;
- if (!view_create_base_gui(vd, __paths_popup_opened))
+ if (!view_create_base_gui(vd, __paths_popup_opened_cb))
return false;
__init_view_app();
char *name = NULL;
char *version = NULL;
- if (model_app_get_id(&id) &&
- model_app_get_name(&name) &&
- model_app_get_version(&version))
+ if (model_get_app_id(&id) &&
+ model_get_app_name(&name) &&
+ model_get_app_version(&version))
view_update_application_tab(id, name, version);
char *paths[PATHS_LIST_ITEMS_COUNT] = { NULL };
}
</pre>
+<h3 id="app-res">Application's resources</h3>
+
+ <p>
+ Once the application is created and its UI is displayed, one can browse through the information gathered during the <a href="#app-init">Application initialization</a> procedure. This information consists of:
+ <ul>
+ <li>application's name, id, version;</li>
+ <li>paths to the application's resources like: data, cache, etc.</li>
+ </ul>
+ These information is obtained using <span style="font-family: Courier New,Courier,monospace">model_get_app_id()</span>,
+ <span style="font-family: Courier New,Courier,monospace">model_get_app_name()</span> and <span style="font-family: Courier New,Courier,monospace">model_get_app_version()</span> functions
+ within the <span style="font-family: Courier New,Courier,monospace">__init_view_app()</span> function called during the <a href="#app-init">Application initialization</a> procedure.
+ The paths to the application's resources directories are obtained using the <span style="font-family: Courier New,Courier,monospace">model_get_app_<b>#dir_type#</b>_path()</span> functions.
+ The implementation of the mentioned functions is listed below.
+ </p>
+
+<pre class="prettyprint">
+bool model_get_app_id(char **id)
+{
+ *id = NULL;
+
+ int ret = app_get_id(id);
+ if (ret != APP_ERROR_NONE) {
+ controller_log(DLOG_ERROR, "Function app_get_id() failed with error = %d", ret);
+ return false;
+ }
+
+ return true;
+}
+</pre>
+
+ <p>
+ The implementation of the <span style="font-family: Courier New,Courier,monospace">model_get_app_name()</span> and
+ <span style="font-family: Courier New,Courier,monospace">model_get_app_version()</span> functions is exactly the same as the implementation of the
+ <span style="font-family: Courier New,Courier,monospace">model_get_app_id()</span> function, but the Tizen's API <span style="font-family: Courier New,Courier,monospace">app_get_name()</span>
+ and <span style="font-family: Courier New,Courier,monospace">app_get_version()</span> functions are used instead of the
+ <span style="font-family: Courier New,Courier,monospace">app_get_id()</span> function.
+ </p>
+
+<pre class="prettyprint">
+bool model_get_app_<b>#dir_type#</b>_path(char **path)
+{
+ *path = NULL;
+
+ char *path_tmp = app_get_<b>#dir_type#</b>_path();
+ if (!path_tmp) {
+ controller_log(DLOG_ERROR, "Function app_get_<b>#dir_type#</b>_path() failed");
+ return false;
+ }
+
+ *path = strdup(path_tmp);
+ return true;
+}
+</pre>
+
+
<h3 id="model">Model</h3>
<script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>