Revision: 417 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=417&view=rev Author: kugel- Date: 2009-02-01 16:58:13 +0000 (Sun, 01 Feb 2009)
Log Message: ----------- Give show_ouput a file_type parameter, and pass the proper one in vcshow (as in, fix the FIXME from the previous commit) and vcblame. change the vcshow filename to include the document's one. Thanks Enrico!
Modified Paths: -------------- branches/GeanyVC_menu_redesign/geanyvc.c
Modified: branches/GeanyVC_menu_redesign/geanyvc.c =================================================================== --- branches/GeanyVC_menu_redesign/geanyvc.c 2009-01-31 20:30:11 UTC (rev 416) +++ branches/GeanyVC_menu_redesign/geanyvc.c 2009-02-01 16:58:13 UTC (rev 417) @@ -374,7 +374,8 @@
/* name should be in UTF-8, and can have a path. */ static void -show_output(const gchar * std_output, const gchar * name, const gchar * force_encoding) +show_output(const gchar * std_output, const gchar * name, + const gchar * force_encoding, GeanyFiletype *ftype) { gint page; GtkNotebook *book; @@ -386,11 +387,13 @@ doc = document_find_by_filename(name); if (doc == NULL) { - doc = document_new_file(name, NULL, std_output); + doc = document_new_file(name, ftype, std_output); } else { sci_set_text(doc->editor->sci, std_output); + if(ftype) + document_set_filetype(doc, ftype); book = GTK_NOTEBOOK(geany->main_widgets->notebook); page = gtk_notebook_page_num(book, GTK_WIDGET(doc->editor->sci)); gtk_notebook_set_current_page(book, page); @@ -623,7 +626,7 @@ else { name = g_strconcat(doc->file_name, ".vc.diff", NULL); - show_output(text, name, doc->encoding); + show_output(text, name, doc->encoding, NULL); g_free(text); g_free(name); } @@ -674,7 +677,7 @@ { gchar *name; name = g_strconcat(dir, ".vc.diff", NULL); - show_output(text, name, doc->encoding); + show_output(text, name, doc->encoding, NULL); g_free(text); g_free(name); } @@ -701,7 +704,7 @@ execute_command(vc, &text, NULL, doc->file_name, VC_COMMAND_BLAME, NULL, NULL); if (text) { - show_output(text, "*VC-BLAME*", NULL); + show_output(text, "*VC-BLAME*", NULL, doc->file_type); g_free(text); } else @@ -727,7 +730,7 @@ execute_command(vc, &output, NULL, doc->file_name, VC_COMMAND_LOG_FILE, NULL, NULL); if (output) { - show_output(output, "*VC-LOG*", NULL); + show_output(output, "*VC-LOG*", NULL, NULL); g_free(output); } } @@ -751,7 +754,7 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL); + show_output(text, "*VC-LOG*", NULL, NULL); g_free(text); }
@@ -778,7 +781,7 @@ execute_command(vc, &text, NULL, basedir, VC_COMMAND_LOG_DIR, NULL, NULL); if (text) { - show_output(text, "*VC-LOG*", NULL); + show_output(text, "*VC-LOG*", NULL, NULL); g_free(text); } g_free(basedir); @@ -809,7 +812,7 @@ execute_command(vc, &text, NULL, base_name, VC_COMMAND_STATUS, NULL, NULL); if (text) { - show_output(text, "*VC-STATUS*", NULL); + show_output(text, "*VC-STATUS*", NULL, NULL); g_free(text); }
@@ -832,7 +835,10 @@ execute_command(vc, &output, NULL, doc->file_name, VC_COMMAND_SHOW, NULL, NULL); if (output) { - show_output(output, "*VC-ORIG*", NULL); + gchar *name; + name = g_strconcat(doc->file_name, ".vc.orig", NULL); + show_output(output, name, doc->encoding, doc->file_type); + g_free(name); g_free(output); } } @@ -947,7 +953,7 @@ document_reload_file(doc, NULL);
if (NZV(text)) - show_output(text, "*VC-UPDATE*", NULL); + show_output(text, "*VC-UPDATE*", NULL, NULL); g_free(text); } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org