void Gobby::OperationNew::start() { InfRequest* request; if(m_directory) { request = inf_browser_add_subdirectory( m_browser, &m_parent, m_name.c_str(), NULL, on_request_finished_static, this); } else { request = inf_browser_add_note( m_browser, &m_parent, m_name.c_str(), "InfText", NULL, NULL, TRUE, on_request_finished_static, this); } if(request != NULL) { m_request = request; g_object_ref(m_request); m_message_handle = get_status_bar().add_info_message( Glib::ustring::compose( m_directory ? _("Creating directory \"%1\"...") : _("Creating document \"%1\"..."), m_name)); } }
static void inf_test_browser_cmd_create(InfTestBrowser* test, const gchar* param) { inf_browser_add_subdirectory( test->browser, &test->cwd, param, NULL, NULL, NULL ); }
static void infinoted_plugin_dbus_add_node(InfinotedPluginDbus* plugin, InfinotedPluginDbusInvocation* invocation, InfBrowser* browser, const InfBrowserIter* iter) { const gchar* name; const gchar* type; GVariant* sheet_set_variant; InfAclSheetSet* sheet_set; GError* error; InfRequest* request; g_variant_get_child(invocation->parameters, 1, "&s", &name); g_variant_get_child(invocation->parameters, 2, "&s", &type); g_variant_get_child( invocation->parameters, 3, "@a{sa{sb}}", &sheet_set_variant ); error = NULL; sheet_set = infinoted_plugin_dbus_sheet_set_from_variant( sheet_set_variant, &error ); g_variant_unref(sheet_set_variant); if(error != NULL) { g_dbus_method_invocation_return_gerror(invocation->invocation, error); g_error_free(error); infinoted_plugin_dbus_invocation_free(plugin, invocation); } else { if(strcmp(type, "InfSubdirectory") == 0) { request = inf_browser_add_subdirectory( browser, iter, name, sheet_set, infinoted_plugin_dbus_add_node_finished_cb, invocation ); } else { request = inf_browser_add_note( browser, iter, name, type, sheet_set, NULL, FALSE, infinoted_plugin_dbus_add_node_finished_cb, invocation ); } if(request != NULL) { invocation->request = request; invocation->request_func = infinoted_plugin_dbus_add_node_finished_cb; } } }