Esempio n. 1
0
/* folder_new */
Folder * folder_new(AccountFolder * folder, FolderType type, char const * name,
		GtkTreeStore * store, GtkTreeIter * iter)
{
	Folder * ret;
	GtkTreePath * path;

#ifdef DEBUG
	fprintf(stderr, "DEBUG: %s(\"%s\")\n", __func__, name);
#endif
	if((ret = object_new(sizeof(*ret))) == NULL)
		return NULL;
	name = _get_local_name(type, name);
	ret->name = string_new(name);
	ret->store = store;
	path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), iter);
	ret->row = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
	gtk_tree_path_free(path);
	gtk_tree_store_set(store, iter, MFC_FOLDER, ret, MFC_NAME, name, -1);
	folder_set_type(ret, type);
	ret->messages = gtk_tree_store_new(MHC_COUNT, G_TYPE_POINTER,
			G_TYPE_POINTER, G_TYPE_POINTER, GDK_TYPE_PIXBUF,
			G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
			G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT,
			G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_UINT);
	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ret->messages),
			MHC_DATE, GTK_SORT_DESCENDING);
	ret->data = folder;
	if(ret->name == NULL)
	{
		folder_delete(ret);
		return NULL;
	}
	return ret;
}
Esempio n. 2
0
	/**
	 *  This member function if available only if the
	 *  #RUBBER_MSNO_WITH_LOCAL_NAME preprocessor symbol
	 *  is defined with a nonzero integer value.
	 *
	 *  @see mirror::MetaNamedScopedObject::local_name()
	 *  @see base_name
	 *  @see full_name
	 */
	inline std::string local_name(void) const
	{
		assert(_get_local_name != nullptr);
		return _get_local_name();
	}