Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Thu, 21 Jun 2012 09:22:36 Commit: 6759dc19e66b45b858d828d6844494346da24eb1 https://github.com/geany/geany-plugins/commit/6759dc19e66b45b858d828d6844494...
Log Message: ----------- Merge pull request #46 from b4n/fixes/treebrowser
Vraious TreeBrowser fixes
Modified Paths: -------------- treebrowser/src/treebrowser.c
Modified: treebrowser/src/treebrowser.c 59 files changed, 31 insertions(+), 28 deletions(-) =================================================================== @@ -145,13 +145,13 @@ enum
static void project_change_cb(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFile *config, G_GNUC_UNUSED gpointer data); static void treebrowser_browse(gchar *directory, gpointer parent); -static void treebrowser_bookmarks_set_state(); -static void treebrowser_load_bookmarks(); +static void treebrowser_bookmarks_set_state(void); +static void treebrowser_load_bookmarks(void); static void gtk_tree_store_iter_clear_nodes(gpointer iter, gboolean delete_root); -static void treebrowser_rename_current(); -static void on_menu_create_new_object(GtkMenuItem *menuitem, gchar *type); -static void load_settings(); -static gboolean save_settings(); +static void treebrowser_rename_current(void); +static void on_menu_create_new_object(GtkMenuItem *menuitem, const gchar *type); +static void load_settings(void); +static gboolean save_settings(void);
/* ------------------ @@ -358,7 +358,7 @@ enum }
static gchar* -get_default_dir() +get_default_dir(void) { gchar *dir; GeanyProject *project = geany->app->project; @@ -388,7 +388,7 @@ enum }
static gchar * -get_terminal() +get_terminal(void) { gchar *terminal; #ifdef G_OS_WIN32 @@ -571,7 +571,7 @@ enum }
static void -treebrowser_bookmarks_set_state() +treebrowser_bookmarks_set_state(void) { if (gtk_tree_store_iter_is_valid(treestore, &bookmarks_iter)) bookmarks_expanded = tree_view_row_expanded_iter(GTK_TREE_VIEW(treeview), &bookmarks_iter); @@ -580,7 +580,7 @@ enum }
static void -treebrowser_load_bookmarks() +treebrowser_load_bookmarks(void) { gchar *bookmarks; gchar *contents, *path_full; @@ -640,13 +640,16 @@ enum { if (g_file_test(path_full, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { + gchar *file_name = g_path_get_basename(path_full); + gtk_tree_store_append(treestore, &iter, &bookmarks_iter); icon = CONFIG_SHOW_ICONS ? utils_pixbuf_from_stock(GTK_STOCK_DIRECTORY) : NULL; gtk_tree_store_set(treestore, &iter, TREEBROWSER_COLUMN_ICON, icon, - TREEBROWSER_COLUMN_NAME, g_basename(path_full), + TREEBROWSER_COLUMN_NAME, file_name, TREEBROWSER_COLUMN_URI, path_full, -1); + g_free(file_name); if (icon) g_object_unref(icon); gtk_tree_store_append(treestore, &iter, &iter); @@ -788,7 +791,7 @@ enum { int i = 0; gboolean founded = FALSE, global_founded = FALSE; - gchar *new = ""; + gchar *new = NULL; gchar **root_segments = NULL, **find_segments = NULL; guint root_segments_n = 0, find_segments_n = 0;
@@ -801,7 +804,7 @@ enum
for (i = 1; i<=find_segments_n; i++) { - new = g_strconcat(new, G_DIR_SEPARATOR_S, find_segments[i], NULL); + new = g_strconcat(new ? new : "", G_DIR_SEPARATOR_S, find_segments[i], NULL);
if (founded) { @@ -821,7 +824,7 @@ enum }
static gboolean -treebrowser_track_current() +treebrowser_track_current(void) {
GeanyDocument *doc = document_get_current(); @@ -891,7 +894,7 @@ enum }
static void -treebrowser_rename_current() +treebrowser_rename_current(void) { GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); GtkTreeIter iter; @@ -904,7 +907,7 @@ enum }
static void -treebrowser_create_new_current(gchar *type) +treebrowser_create_new_current(const gchar *type) { on_menu_create_new_object(NULL, type); } @@ -993,7 +996,7 @@ enum }
static void -on_menu_create_new_object(GtkMenuItem *menuitem, gchar *type) +on_menu_create_new_object(GtkMenuItem *menuitem, const gchar *type) { GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); GtkTreeIter iter; @@ -1307,7 +1310,7 @@ enum * ------------------ */
static void -on_button_go_up() +on_button_go_up(void) { gchar *uri;
@@ -1317,13 +1320,13 @@ enum }
static void -on_button_refresh() +on_button_refresh(void) { treebrowser_chroot(addressbar_last_address); }
static void -on_button_go_home() +on_button_go_home(void) { gchar *uri;
@@ -1333,7 +1336,7 @@ enum }
static void -on_button_current_path() +on_button_current_path(void) { gchar *uri;
@@ -1343,7 +1346,7 @@ enum }
static void -on_button_hide_bars() +on_button_hide_bars(void) { showbars(FALSE); } @@ -1565,7 +1568,7 @@ enum }
static void -treebrowser_track_current_cb() +treebrowser_track_current_cb(void) { if (CONFIG_FOLLOW_CURRENT_DOC) treebrowser_track_current(); @@ -1585,7 +1588,7 @@ enum }
static GtkWidget* -create_view_and_model() +create_view_and_model(void) {
GtkWidget *view; @@ -1630,7 +1633,7 @@ enum }
static void -create_sidebar() +create_sidebar(void) { GtkWidget *scrollwin; GtkWidget *toolbar; @@ -1747,7 +1750,7 @@ enum } configure_widgets;
static void -load_settings() +load_settings(void) { GKeyFile *config = g_key_file_new();
@@ -1770,7 +1773,7 @@ enum }
static gboolean -save_settings() +save_settings(void) { GKeyFile *config = g_key_file_new(); gchar *config_dir = g_path_get_dirname(CONFIG_FILE); @@ -2026,7 +2029,7 @@ static void kb_activate(guint key_id) }
void -plugin_cleanup() +plugin_cleanup(void) { g_free(addressbar_last_address); g_free(CONFIG_FILE);
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).