SF.net SVN: geany-plugins:[1301] trunk/geany-plugins/treebrowser/src/ treebrowser.c
dimitrov-adrian at users.sourceforge.net
dimitrov-adrian at xxxxx
Sun Apr 25 15:28:01 UTC 2010
Revision: 1301
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1301&view=rev
Author: dimitrov-adrian
Date: 2010-04-25 15:28:01 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Treebrowser: (Fixed) Copy full url became inactive if the document isn`t oppened
Modified Paths:
--------------
trunk/geany-plugins/treebrowser/src/treebrowser.c
Modified: trunk/geany-plugins/treebrowser/src/treebrowser.c
===================================================================
--- trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-25 15:00:33 UTC (rev 1300)
+++ trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-25 15:28:01 UTC (rev 1301)
@@ -328,14 +328,22 @@
{
gchar *bookmarks;
GError *error = NULL;
- gchar *contents;
+ gchar *contents, *path_full;
gchar **lines, **line;
- GtkTreeIter iter;
+ GtkTreeIter iter_bookmark, iter;
bookmarks = g_build_filename (g_get_home_dir(), ".gtk-bookmarks", NULL);
if (g_file_get_contents (bookmarks, &contents, NULL, &error))
{
- gtk_tree_store_iter_clear_nodes(NULL, FALSE);
+
+ //gtk_tree_store_iter_clear_nodes(NULL, FALSE);
+ /*gtk_tree_store_prepend(treestore, &iter_bookmark, NULL);
+ gtk_tree_store_set(treestore, &iter_bookmark,
+ TREEBROWSER_COLUMN_ICON, GTK_STOCK_HOME,
+ TREEBROWSER_COLUMN_NAME, _("Bookmarks"),
+ TREEBROWSER_COLUMN_URI, NULL,
+ -1);
+ */
lines = g_strsplit (contents, "\n", 0);
for (line = lines; *line; ++line)
{
@@ -351,12 +359,15 @@
}
else
name = NULL;
+ }
+ if (path_full = g_file_get_path(g_file_new_for_uri(*line)))
+ {
gtk_tree_store_append(treestore, &iter, NULL);
gtk_tree_store_set(treestore, &iter,
- TREEBROWSER_COLUMN_ICON, GTK_STOCK_DIRECTORY,
- TREEBROWSER_COLUMN_NAME, g_basename(*line),
- TREEBROWSER_COLUMN_URI, g_path_get_dirname(*line),
- -1);
+ TREEBROWSER_COLUMN_ICON, GTK_STOCK_HOME,
+ TREEBROWSER_COLUMN_NAME, g_basename(path_full),
+ TREEBROWSER_COLUMN_URI, path_full,
+ -1);
}
}
g_strfreev (lines);
@@ -800,7 +811,7 @@
item = ui_image_menu_item_new(GTK_STOCK_COPY, g_strdup_printf(_("Copy full path"), name));
gtk_container_add(GTK_CONTAINER(menu), item);
g_signal_connect(item, "activate", G_CALLBACK(on_menu_copy_uri), uri);
- gtk_widget_set_sensitive(item, is_document);
+ gtk_widget_set_sensitive(item, is_exists);
item = gtk_separator_menu_item_new();
gtk_container_add(GTK_CONTAINER(menu), item);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list