Commit 07e074ac authored by Naba Kumar's avatar Naba Kumar

Added mime types.

	* plugins/editor/anjuta-document-manager.plugin.in: Added mime types.

	* plugins/file-manager/an_file_view.c,
	plugins/file-manager/plugin.c: Added file manager preferences to
	show/hide files ignored by version control (e.g. cvsignore).

	* plugins/editor/text_editor.c: Initialize vfs info struct.

	* .cvsignore, global-tags/.cvsignore, libanjuta/.cvsignore,
	libanjuta/interfaces/.cvsignore, libegg/.cvsignore,
	libegg/menu/.cvsignore, libegg/recent-files/.cvsignore,
	libegg/treeviewutils/.cvsignore, libegg/util/.cvsignore,
	omf-install/.cvsignore, pixmaps/.cvsignore,
	plugins/file-manager/anjuta-file-manager-plugin.glade,
	scintilla/.cvsignore, scintilla/include/.cvsignore,
	scripts/.cvsignore, src/.cvsignore, tagmanager/.cvsignore,
	tagmanager/python.c: Updated.
parent 7187ab3f
.tm_project.cache .anjuta
.tm_project*
aclocal.m4 aclocal.m4
anjuta.desktop *.desktop
anjuta.desktop.in *.desktop.in
anjuta.pws *.pws
anjuta.spec *.spec
autom4te.cache autom4te.cache
config.h config.h
config.h.in config.h.in
config.log config.log
config.status config.status
configure configure
intltool-extract intltool-extract*
intltool-merge intltool-merge*
intltool-modules intltool-modules*
intltool-update intltool-update*
libtool libtool
prepare.sh prepare.sh
stamp-h stamp-h*
stamp-h.in ltmain.sh
mkinstalldirs
config.guess
config.sub
Makefile Makefile
Makefile.in Makefile.in
*.bak
*~
#*#
*.gladep
2005-07-15 Naba Kumar <naba@gnome.org> 2005-07-16 Naba Kumar <naba@gnome.org>
* plugins/editor/anjuta-document-manager.plugin.in: Added mime types.
* plugins/file-manager/an_file_view.c,
plugins/file-manager/plugin.c: Added file manager preferences to
show/hide files ignored by version control (e.g. cvsignore).
* plugins/editor/text_editor.c: Initialize vfs info struct.
* .cvsignore, global-tags/.cvsignore, libanjuta/.cvsignore,
libanjuta/interfaces/.cvsignore, libegg/.cvsignore,
libegg/menu/.cvsignore, libegg/recent-files/.cvsignore,
libegg/treeviewutils/.cvsignore, libegg/util/.cvsignore,
omf-install/.cvsignore, pixmaps/.cvsignore,
plugins/file-manager/anjuta-file-manager-plugin.glade,
scintilla/.cvsignore, scintilla/include/.cvsignore,
scripts/.cvsignore, src/.cvsignore, tagmanager/.cvsignore,
tagmanager/python.c: Updated.
2005-07-16 Naba Kumar <naba@gnome.org>
* tagmanager/parse.c, tagmanager/parse.h, tagmanager/python.c: * tagmanager/parse.c, tagmanager/parse.h, tagmanager/python.c:
Fixed python parser to parser class methods. Fixed python parser to parser class methods.
......
Makefile.in Makefile.in
Makefile Makefile
tm_global_tags anjuta-tags
system.tags system.tags
*.lo
*.o
*.bak
...@@ -3,3 +3,8 @@ Makefile.in ...@@ -3,3 +3,8 @@ Makefile.in
*.pc *.pc
anjuta-marshal.c anjuta-marshal.c
anjuta-marshal.h anjuta-marshal.h
*.lo
*.o
*~
*.la
*.bak
...@@ -6,3 +6,8 @@ Makefile.am ...@@ -6,3 +6,8 @@ Makefile.am
*.list *.list
hierarchy.txt hierarchy.txt
iface-built.stamp iface-built.stamp
*.lo
*.o
*~
*.la
*.bak
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
.deps .deps
*.lo *.lo
*.la *.la
*.o
Makefile Makefile
Makefile.in Makefile.in
eggmarshalers.c eggmarshalers.c
...@@ -17,3 +18,5 @@ test-tree-utils ...@@ -17,3 +18,5 @@ test-tree-utils
test-union test-union
libeggdocktypebuiltins.c libeggdocktypebuiltins.c
test-dock test-dock
*.bak
*~
...@@ -7,4 +7,5 @@ Makefile.in ...@@ -7,4 +7,5 @@ Makefile.in
test-actions test-actions
accels accels
test-merge test-merge
*.bak
*~
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
.deps .deps
*.lo *.lo
*.la *.la
*.bak
*~
Makefile Makefile
Makefile.in Makefile.in
test-multi-drag test-multi-drag
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
.deps .deps
*.lo *.lo
*.la *.la
*.bak
*~
Makefile Makefile
Makefile.in Makefile.in
test-multi-drag test-multi-drag
......
...@@ -6,3 +6,5 @@ Makefile.in ...@@ -6,3 +6,5 @@ Makefile.in
*.lo *.lo
eggmarshalers.c eggmarshalers.c
eggmarshalers.h eggmarshalers.h
*.bak
*~
...@@ -2,3 +2,5 @@ Makefile ...@@ -2,3 +2,5 @@ Makefile
Makefile.in Makefile.in
*.omf *.omf
.nautilus-metafile.xml .nautilus-metafile.xml
*.bak
*~
Makefile Makefile
Makefile.in Makefile.in
*~ *~
*.bak
.*swp .*swp
.xvpics .xvpics
.thumbnails .thumbnails
......
...@@ -8,4 +8,4 @@ Interfaces=IAnjutaDocumentManager,IAnjutaFile ...@@ -8,4 +8,4 @@ Interfaces=IAnjutaDocumentManager,IAnjutaFile
UserActivatable=no UserActivatable=no
[File Loader] [File Loader]
SupportedMimeTypes=text/*,text/source,application/x-perl,application/x-python,application/x-shellscript SupportedMimeTypes=text/*,text/source,application/x-perl,application/x-python,application/x-shellscript,application/x-php,application/x-java,application/x-javascript
...@@ -8,4 +8,4 @@ Interfaces=IAnjutaDocumentManager,IAnjutaFile ...@@ -8,4 +8,4 @@ Interfaces=IAnjutaDocumentManager,IAnjutaFile
UserActivatable=no UserActivatable=no
[File Loader] [File Loader]
SupportedMimeTypes=text/*,text/source,application/x-perl,application/x-python,application/x-shellscript SupportedMimeTypes=text/*,text/source,application/x-perl,application/x-python,application/x-shellscript,application/x-php,application/x-java,application/x-javascript
...@@ -376,10 +376,11 @@ text_editor_new (AnjutaPreferences *eo, const gchar *uri, const gchar *name) ...@@ -376,10 +376,11 @@ text_editor_new (AnjutaPreferences *eo, const gchar *uri, const gchar *name)
else else
te->filename = g_strdup_printf ("Newfile#%d", ++new_file_count); te->filename = g_strdup_printf ("Newfile#%d", ++new_file_count);
if (uri) if (uri)
{ {
GnomeVFSFileInfo info;
GnomeVFSResult result; GnomeVFSResult result;
GnomeVFSURI* vfs_uri; GnomeVFSURI* vfs_uri;
GnomeVFSFileInfo info = {0,0};
new_file_count--; new_file_count--;
if (te->filename) if (te->filename)
g_free (te->filename); g_free (te->filename);
......
...@@ -61,6 +61,7 @@ typedef struct _FileFilter ...@@ -61,6 +61,7 @@ typedef struct _FileFilter
GList *dir_unmatch; GList *dir_unmatch;
gboolean ignore_hidden_files; gboolean ignore_hidden_files;
gboolean ignore_hidden_dirs; gboolean ignore_hidden_dirs;
gboolean ignore_nonrepo_files;
} FileFilter; } FileFilter;
static GdlIcons *icon_set = NULL; static GdlIcons *icon_set = NULL;
...@@ -93,6 +94,7 @@ anjuta_fv_open_file (FileManagerPlugin * fv, const char *path) ...@@ -93,6 +94,7 @@ anjuta_fv_open_file (FileManagerPlugin * fv, const char *path)
#define DIR_FILTER_UNMATCH "filter.dir.unmatch" #define DIR_FILTER_UNMATCH "filter.dir.unmatch"
#define DIR_FILTER_UNMATCH_COMBO "filter.dir.unmatch.combo" #define DIR_FILTER_UNMATCH_COMBO "filter.dir.unmatch.combo"
#define DIR_FILTER_IGNORE_HIDDEN "filter.dir.ignore.hidden" #define DIR_FILTER_IGNORE_HIDDEN "filter.dir.ignore.hidden"
#define FILE_FILTER_IGNORE_NONREPO "filter.file.ignore.nonrepo"
#define GET_PREF(var, P) \ #define GET_PREF(var, P) \
if (ff->var) \ if (ff->var) \
...@@ -119,6 +121,7 @@ fv_prefs_new (FileManagerPlugin *fv) ...@@ -119,6 +121,7 @@ fv_prefs_new (FileManagerPlugin *fv)
GET_PREF(dir_match, DIR_FILTER_MATCH); GET_PREF(dir_match, DIR_FILTER_MATCH);
GET_PREF(dir_unmatch, DIR_FILTER_UNMATCH); GET_PREF(dir_unmatch, DIR_FILTER_UNMATCH);
GET_PREF_BOOL(ignore_hidden_dirs, DIR_FILTER_IGNORE_HIDDEN); GET_PREF_BOOL(ignore_hidden_dirs, DIR_FILTER_IGNORE_HIDDEN);
GET_PREF_BOOL(ignore_nonrepo_files, FILE_FILTER_IGNORE_NONREPO);
return ff; return ff;
} }
...@@ -271,7 +274,6 @@ fv_connect (FileManagerPlugin *fv) ...@@ -271,7 +274,6 @@ fv_connect (FileManagerPlugin *fv)
NULL); NULL);
} }
#if 0
static gboolean static gboolean
file_entry_apply_filter (const char *name, GList *match, GList *unmatch, file_entry_apply_filter (const char *name, GList *match, GList *unmatch,
gboolean ignore_hidden) gboolean ignore_hidden)
...@@ -281,9 +283,6 @@ file_entry_apply_filter (const char *name, GList *match, GList *unmatch, ...@@ -281,9 +283,6 @@ file_entry_apply_filter (const char *name, GList *match, GList *unmatch,
g_return_val_if_fail(name, FALSE); g_return_val_if_fail(name, FALSE);
if (ignore_hidden && ('.' == name[0])) if (ignore_hidden && ('.' == name[0]))
return FALSE; return FALSE;
/* TTimo - ignore .svn directories */
if (!strcmp(name, ".svn"))
return FALSE;
for (tmp = match; tmp; tmp = g_list_next(tmp)) for (tmp = match; tmp; tmp = g_list_next(tmp))
{ {
if (0 == fnmatch((char *) tmp->data, name, 0)) if (0 == fnmatch((char *) tmp->data, name, 0))
...@@ -303,7 +302,6 @@ file_entry_apply_filter (const char *name, GList *match, GList *unmatch, ...@@ -303,7 +302,6 @@ file_entry_apply_filter (const char *name, GList *match, GList *unmatch,
} }
return matched; return matched;
} }
#endif
static void static void
fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root) fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root)
...@@ -317,6 +315,7 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root) ...@@ -317,6 +315,7 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root)
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GSList *file_node; GSList *file_node;
GSList *files = NULL; GSList *files = NULL;
GList *ignore_files = NULL;
gchar *entries = NULL; gchar *entries = NULL;
g_return_if_fail (path != NULL); g_return_if_fail (path != NULL);
...@@ -347,6 +346,43 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root) ...@@ -347,6 +346,43 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root)
} }
} }
} }
g_snprintf(file_name, PATH_MAX, "%s/.cvsignore", path);
if (ff->ignore_nonrepo_files && 0 == stat(file_name, &s))
{
if (S_ISREG(s.st_mode))
{
int fd;
if ((fd = open(file_name, O_RDONLY)) >= 0)
{
off_t n = 0;
off_t total_read = 0;
gchar **strv = NULL;
gchar **ptrv = NULL;
gchar *content = g_new (char, s.st_size + 2);
while (0 < (n = read(fd, content + total_read,
s.st_size - total_read)))
total_read += n;
content[s.st_size] = '\0';
close(fd);
strv = g_strsplit (content, "\n", -1);
ptrv = strv;
while (strv && *ptrv)
{
ignore_files = g_list_prepend (ignore_files,
g_strdup (*ptrv));
DEBUG_PRINT ("Ignoring: %s", *ptrv);
ptrv++;
}
g_strfreev (strv);
g_free (content);
}
}
}
if (NULL != (dir = opendir(path))) if (NULL != (dir = opendir(path)))
{ {
while (NULL != (dir_entry = readdir(dir))) while (NULL != (dir_entry = readdir(dir)))
...@@ -359,6 +395,10 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root) ...@@ -359,6 +395,10 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root)
(0 == strcmp(file, ".")) || (0 == strcmp(file, ".")) ||
(0 == strcmp(file, ".."))) (0 == strcmp(file, "..")))
continue; continue;
if (ignore_files &&
!file_entry_apply_filter (file, NULL, ignore_files,
FALSE))
continue;
g_snprintf(file_name, PATH_MAX, "%s/%s", path, file); g_snprintf(file_name, PATH_MAX, "%s/%s", path, file);
...@@ -438,6 +478,11 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root) ...@@ -438,6 +478,11 @@ fv_add_tree_entry (FileManagerPlugin *fv, const gchar *path, GtkTreeIter *root)
} }
if (entries) if (entries)
g_free (entries); g_free (entries);
if (ignore_files)
{
g_list_foreach (ignore_files, (GFunc)g_free, NULL);
g_list_free (ignore_files);
}
} }
static void static void
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<widget class="GtkTable" id="table1"> <widget class="GtkTable" id="table1">
<property name="border_width">10</property> <property name="border_width">10</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">3</property> <property name="n_rows">4</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">5</property> <property name="row_spacing">5</property>
...@@ -484,6 +484,28 @@ ...@@ -484,6 +484,28 @@
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:filter.file.ignore.nonrepo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Do not show files ignore by version control</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
</child> </child>
......
...@@ -93,6 +93,7 @@ prefs_init (FileManagerPlugin *fv) ...@@ -93,6 +93,7 @@ prefs_init (FileManagerPlugin *fv)
REGISTER_NOTIFY ("filter.file.ignore.hidden", on_gconf_notify_prefs); REGISTER_NOTIFY ("filter.file.ignore.hidden", on_gconf_notify_prefs);
REGISTER_NOTIFY ("filter.file.match", on_gconf_notify_prefs); REGISTER_NOTIFY ("filter.file.match", on_gconf_notify_prefs);
REGISTER_NOTIFY ("filter.file.unmatch", on_gconf_notify_prefs); REGISTER_NOTIFY ("filter.file.unmatch", on_gconf_notify_prefs);
REGISTER_NOTIFY ("filter.file.ignore.nonrepo", on_gconf_notify_prefs);
} }
static void static void
......
Makefile Makefile
Makefile.in Makefile.in
*.o *.o
*.lo
*.la
*~ *~
*.a
*.bak
.*swp .*swp
.deps .deps
.libs .libs
.sources .sources
.nautilus-metafile.xml .nautilus-metafile.xml
*.a
test-scintilla test-scintilla
Makefile Makefile
Makefile.in Makefile.in
*.o *.o
*.la
*.lo
*~ *~
.*swp .*swp
.deps .deps
.libs .libs
.sources .sources
.nautilus-metafile.xml .nautilus-metafile.xml
*.bak
Makefile.in Makefile.in
Makefile Makefile
anjuta_import.sh anjuta_import.sh
*.bak
*~
Makefile Makefile
Makefile.in Makefile.in
*.o *.o
*.lo
*.la
*~ *~
*.bak
*.gladep
.*swp .*swp
.gdbinit .gdbinit
.deps .deps
......
Makefile.in Makefile.in
Makefile Makefile
*.o
*.lo
*.la
*~
*.bak
...@@ -109,6 +109,7 @@ static void findPythonTags (void) ...@@ -109,6 +109,7 @@ static void findPythonTags (void)
} }
} }
vStringDelete (name); vStringDelete (name);
vStringDelete (lastClass);
} }
extern parserDefinition* PythonParser (void) extern parserDefinition* PythonParser (void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment