SF.net SVN: geany: [2638] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Tue Jun 3 17:26:28 UTC 2008
Revision: 2638
http://geany.svn.sourceforge.net/geany/?rev=2638&view=rev
Author: ntrel
Date: 2008-06-03 10:26:22 -0700 (Tue, 03 Jun 2008)
Log Message:
-----------
Fix using wrong encoding for document filename when doing a
directory diff.
Replace find_by_filename() with p_document->find_by_filename() (now
it does the same job).
Modified Paths:
--------------
trunk/ChangeLog
trunk/plugins/vcdiff.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-03 17:22:04 UTC (rev 2637)
+++ trunk/ChangeLog 2008-06-03 17:26:22 UTC (rev 2638)
@@ -2,7 +2,7 @@
* src/build.c, src/dialogs.c, src/document.c, src/document.h,
src/msgwindow.c, src/navqueue.c, src/plugindata.h, src/plugins.c,
- src/symbols.c, src/win32.c, plugins/vcdiff.c:
+ src/symbols.c, src/win32.c:
Note: this breaks the plugin API for plugins using
document_find_by_filename().
Make document_find_by_filename() take only a utf8_filename argument,
@@ -12,6 +12,11 @@
Add filename argument for document_save_file_as().
Add GeanyDocument::real_path field, which if non-NULL indicates the
file once existed on disk (not just as an unsaved document filename).
+ * plugins/vcdiff.c:
+ Fix using wrong encoding for document filename when doing a
+ directory diff.
+ Replace find_by_filename() with p_document->find_by_filename() (now
+ it does the same job).
2008-06-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/plugins/vcdiff.c
===================================================================
--- trunk/plugins/vcdiff.c 2008-06-03 17:22:04 UTC (rev 2637)
+++ trunk/plugins/vcdiff.c 2008-06-03 17:26:22 UTC (rev 2638)
@@ -248,22 +248,8 @@
}
-static int find_by_filename(const gchar* filename)
-{
- guint i;
-
- for (i = 0; i < documents_array->len; i++)
- {
- if (documents[i]->is_valid && documents[i]->file_name &&
- strcmp(documents[i]->file_name, filename) == 0)
- return i;
- }
- return -1;
-}
-
-
-/* name_prefix should be in UTF-8, and can have a path. */
-static void show_output(const gchar *std_output, const gchar *name_prefix,
+/* utf8_name_prefix can have a path. */
+static void show_output(const gchar *std_output, const gchar *utf8_name_prefix,
const gchar *force_encoding)
{
gchar *text, *detect_enc = NULL;
@@ -271,7 +257,7 @@
GtkNotebook *book;
gchar *filename;
- filename = g_path_get_basename(name_prefix);
+ filename = g_path_get_basename(utf8_name_prefix);
setptr(filename, g_strconcat(filename, ".vc.diff", NULL));
/* need to convert input text from the encoding of the original file into
@@ -287,7 +273,7 @@
}
if (text)
{
- idx = find_by_filename(filename);
+ idx = p_document->find_by_filename(filename);
if ( idx == -1)
{
GeanyFiletype *ft = p_filetypes->lookup_by_name("Diff");
@@ -416,6 +402,7 @@
text = make_diff(base_name, VC_COMMAND_DIFF_DIR);
if (text)
{
+ setptr(base_name, p_utils->get_utf8_from_locale(base_name));
show_output(text, base_name, NULL);
g_free(text);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list