GtkWidget * nemo_interesting_folder_bar_new_for_location (NemoView *view, GFile *location) { InterestingFolderType type = TYPE_NONE_FOLDER; gchar *path = NULL; GFile *tmp_loc = NULL; path = g_build_filename (g_get_user_data_dir (), "nemo", "actions", NULL); tmp_loc = g_file_new_for_path (path); if (g_file_equal (location, tmp_loc)) { type = TYPE_ACTIONS_FOLDER; goto out; } g_free (path); g_object_unref (tmp_loc); path = g_build_filename (g_get_user_data_dir (), "nemo", "scripts", NULL); tmp_loc = g_file_new_for_path (path); if (g_file_equal (location, tmp_loc)) type = TYPE_SCRIPTS_FOLDER; out: g_free (path); g_object_unref (tmp_loc); return type == TYPE_NONE_FOLDER ? NULL : nemo_interesting_folder_bar_new (view, type); }
GtkWidget * nemo_interesting_folder_bar_new_for_location (NemoView *view, GFile *location) { InterestingFolderType type = TYPE_NONE_FOLDER; gchar *path = NULL; GFile *tmp_loc = NULL; path = nemo_action_manager_get_user_directory_path (); tmp_loc = g_file_new_for_path (path); if (g_file_equal (location, tmp_loc)) { type = TYPE_ACTIONS_FOLDER; goto out; } g_free (path); g_object_unref (tmp_loc); path = nemo_get_scripts_directory_path (); tmp_loc = g_file_new_for_path (path); if (g_file_equal (location, tmp_loc)) type = TYPE_SCRIPTS_FOLDER; out: g_free (path); g_object_unref (tmp_loc); return type == TYPE_NONE_FOLDER ? NULL : nemo_interesting_folder_bar_new (view, type); }