GNOME Bugzilla – Bug 511589
Anjuta uses GNOME-VFS
Last modified: 2009-07-11 16:04:47 UTC
GNOME-VFS will be deprecated when glib 2.16 is released (with GNOME 2.22) The following C files use functions beginning with gnome_vfs: rob@poseidon:~/projects/anjuta/trunk$ grep -c --include *.c -r gnome_vfs . | sort -r -n -t : -k 2 ./plugins/sourceview/anjuta-document-saver.c:43 ./plugins/editor/text_editor.c:35 ./plugins/sourceview/anjuta-document-loader.c:32 ./plugins/document-manager/action-callbacks.c:32 ./libegg/egg-recent-files-module.c:26 ./plugins/file-loader/plugin.c:25 ./plugins/gtodo/libgtodo.c:21 ./plugins/project-manager/plugin.c:14 ./plugins/symbol-db/symbol-db-engine.c:12 ./plugins/document-manager/anjuta-docman.c:11 ./libanjuta/anjuta-profile.c:11 ./libanjuta/anjuta-utils.c:10 ./plugins/symbol-db/plugin.c:9 ./plugins/sourceview/anjuta-document.c:9 ./plugins/project-import/project-import.c:9 ./libegg/egg-recent-item.c:9 ./plugins/subversion/plugin.c:8 ./plugins/profiler/plugin.c:8 ./plugins/debug-manager/start.c:8 ./plugins/cvs-plugin/plugin.c:8 ./libegg/egg-recent-model.c:8 ./plugins/symbol-browser/plugin.c:6 ./plugins/symbol-browser/an_symbol_prefs.c:6 ./plugins/sourceview/anjuta-utils.c:6 ./plugins/macro/macro-db.c:6 ./plugins/valgrind/vgdefaultview.c:5 ./plugins/message-view/message-view.c:5 ./plugins/indent/indent-util.c:5 ./plugins/file-wizard/file.c:5 ./plugins/file-manager/file-model.c:5 ./plugins/valgrind/plugin.c:4 ./plugins/sourceview/sourceview.c:4 ./plugins/profiler/gprof-profile-data.c:4 ./plugins/glade/anjuta-design-document.c:4 ./plugins/debug-manager/breakpoints.c:4 ./plugins/build-basic-autotools/build-basic-autotools.c:4 ./plugins/glade/plugin.c:3 ./plugins/document-manager/plugin.c:3 ./plugins/build-basic-autotools/executer.c:3 ./src/main.c:2 ./plugins/symbol-browser/an_symbol_view.c:2 ./plugins/search/search-replace_backend.c:2 ./plugins/project-wizard/property.c:2 ./plugins/gtodo/export.c:2 ./plugins/debug-manager/threads.c:2 ./plugins/debug-manager/plugin.c:2 ./plugins/tools/variable.c:1 ./plugins/tools/editor.c:1 ./plugins/symbol-db/test/main.c:1 ./plugins/file-wizard/plugin.c:1 ./plugins/file-manager/plugin.c:1 ./plugins/debug-manager/stack_trace.c:1 ./plugins/cvs-plugin/cvs-interface.c:1 ./plugins/cvs-plugin/cvs-execute.c:1 ./plugins/cvs-plugin/cvs-callbacks.c:1 ./plugins/class-inheritance/plugin.c:1 ./plugins/class-gen/plugin.c:1
I will pay everyone a bear who fixes ports this completely on next GUADEC ;-) Anyway, of course you are right but we really never intended to fix this before 2.22 as many other modules. I don't know when we will decide to depend completely on the libs from 2.22 as Anjuta should currently work even with 2.18.
s/bear/beer ;-)
file-manager done...
Created attachment 120808 [details] [review] remove gnomevfs from file-loader This patch removes the remaining gnomevfs-mime and gnomevfs stuff from file-loader plugin; more to come
Created attachment 120810 [details] [review] remove gnomevfs from plugin This patch removes gnomevfs from the build-basic-autotools plugin
Nevermind that last patch. Will add a function to libanjuta, because the usage is very common.
Created attachment 120812 [details] [review] add utility function and remove more gnomevfs add utilitiy function to libanjuta for getting local path from uri. Cleanup of build-basic-autotools and class-gen of gnomevfs-deps
Created attachment 120814 [details] [review] add utility function and remove more gnomevfs *sigh* will stop posting patches today, get some sleep; does the same as previous patch.
on ./plugins/symbol-db/plugin.c I see a gnome_vfs_get_mime_type_for_name () call, which I read there's not such thing on GIO. Any hints? If we cannot come up with a solution symbol-db cannot be ported completely to GIO. http://library.gnome.org/devel/gio/2.15/ch15s03.html.
(In reply to comment #8) > Created an attachment (id=120814) [edit] > add utility function and remove more gnomevfs Awesome patches series! I will be away next week so it might take some time until there are reviewed if nobody else takes care. Thanks!
(In reply to comment #8) > Created an attachment (id=120814) [edit] > add utility function and remove more gnomevfs Awesome patches series! I will be away next week so it might take some time until there are reviewed if nobody else takes care. Some notes: You don't need anjuta_utils_get_local_path_from_uri(). You can use g_file_get_path() instead. This will return NULL if there is no local representation of the file.
I know, and I used it in places where a GFile is already available; in other places like the class-gen plugin, I got tired of writing file = g_file_new_for_uri (uri); local_path = g_file_get_path (file); g_object_unref (file); (which is actually the whole content of anjuta_util_get_local_path_from_uri)
Hi! (In reply to comment #12) > I know, and I used it in places where a GFile is already available; in other > places like the class-gen plugin, I got tired of writing > > file = g_file_new_for_uri (uri); > local_path = g_file_get_path (file); > g_object_unref (file); > > (which is actually the whole content of anjuta_util_get_local_path_from_uri) > OK, I see. I would prefer not to use an uri in the first place (but instead a GFile*) but that's not possible for some API. As already discussed, we should port any posix/glib file operation to gio and make them async wherever possible. (Speaking of the "TODO: use gio here" comment) Anyway, the patches look good - they will be committed soon.
Thanks a lot for your awesome constribution, Jens! That was really high quality. Next time, please also attach a ChangeLog entry (see HACKING for details). We have come a long way: ./plugins/gtodo/libgtodo.c:21 ./plugins/project-manager/plugin.c:14 ./plugins/project-import/project-import.c:12 ./libanjuta/anjuta-profile.c:11 ./libanjuta/anjuta-utils.c:10 ./plugins/debug-manager/start.c:9 ./plugins/profiler/plugin.c:8 ./plugins/cvs-plugin/plugin.c:7 ./plugins/symbol-browser/an_symbol_prefs.c:6 ./plugins/subversion/plugin.c:6 ./plugins/macro/macro-db.c:6 ./plugins/valgrind/vgdefaultview.c:5 ./plugins/symbol-db/test/main.c:5 ./plugins/symbol-browser/plugin.c:5 ./plugins/run-program/parameters.c:5 ./plugins/message-view/message-view.c:5 ./plugins/indent/indent-util.c:5 ./plugins/valgrind/plugin.c:4 ./plugins/symbol-db/symbol-db-system.c:4 ./plugins/symbol-browser/an_symbol_view.c:4 ./plugins/profiler/gprof-profile-data.c:4 ./plugins/debug-manager/breakpoints.c:4 ./plugins/symbol-db/test/benchmark.c:3 ./plugins/symbol-db/plugin.c:3 ./src/main.c:2 ./plugins/search/search-replace_backend.c:2 ./plugins/run-program/execute.c:2 ./plugins/project-wizard/property.c:2 ./plugins/gtodo/export.c:2 ./plugins/debug-manager/threads.c:2 ./plugins/tools/variable.c:1 ./plugins/glade/plugin.c:1 ./plugins/file-wizard/plugin.c:1 ./plugins/debug-manager/stack_trace.c:1 ./plugins/cvs-plugin/cvs-interface.c:1 ./plugins/cvs-plugin/cvs-execute.c:1 ./plugins/cvs-plugin/cvs-callbacks.c:1 ./plugins/class-inheritance/plugin.c:1 Still some files to do...
Created attachment 121813 [details] [review] port for CVS plugun Next one. I'm a bit busy at work, sorry for the delay.
btw, your statistics are a bit faulty; ./plugins/glade/plugin.c:1 is already ported, the _vfs_ call is in a commented block
lies, damned lies, statistics ;-) Thanks!
Created attachment 121915 [details] [review] Fix usage of gnome-vfs for more plugins remove more gnome-vfs. Also fixes a bug in project-import that there was no error dialog showing if there was an error during import.
I have committed this in svn trunk. Thanks Jens.
While fixing another bug, I have removed the use of gnome-vfs in anjuta-profile.c. I will take care of project-manager and project-import when I will be able to merge gnome-build in Anjuta.
Created attachment 122675 [details] [review] Fix gnome-vfs in gtodo plugin
(In reply to comment #21) > Created an attachment (id=122675) [edit] > Fix gnome-vfs in gtodo plugin It's quite a lots of change. It looks fine. I have just read it. Have you checked that the plugin is still working fine ? Then, I have question about this code in ligtodo.c:598: read = g_file_info_get_attribute_boolean (file_info, "access::can_read"); write = g_file_info_get_attribute_boolean (file_info, "access::can_write"); /* If I am not allowed to read the file */ if(read) { /* save some more info here.. check for some logicol errors and print it. */ g_set_error(&tmp_error,LIBGTODO_ERROR,LIBGTODO_ERROR_NO_PERMISSION, _("No permission to read the file.")); g_propagate_error(error, tmp_error); return TRUE; } You have replace the old "if (read == 0)" by "if (read)" but I think it should be rather "if (!read)", no ?
Yes, you're right. I only tried not-writable. But there is another problem with non-readable files; I'll update the patch, including your comment
Created attachment 124116 [details] [review] Fix usage of gnome-vfs for gtodo-plugin
(In reply to comment #24) > Created an attachment (id=124116) [edit] > Fix usage of gnome-vfs for gtodo-plugin Ok Thanks for your patch. I have just committed it.
Created attachment 124890 [details] [review] FIx usage of gnome-vfs for valgrind plugin
Created attachment 124935 [details] [review] Fix usage of gnome-vfs for valgrind anjuta_util_diff
Created attachment 124962 [details] [review] Fix usage of gnome-vfs for profiler plugin
Created attachment 124972 [details] [review] Fix usage of gnome-vfs for message view plugin
Created attachment 124975 [details] [review] Fix usage of gnome-vfs for macro plugin
Created attachment 124976 [details] [review] Fix usage of gnome-vfs for search plugin
Thanks for very much Jens for all your patches. I have applied all of them with no change.
In file profiler/plugin.c it's used a glib 2.18 only function. http://library.gnome.org/devel/gio/unstable/GFile.html#g-file-monitor Are we requiring 2.18? I won't be able to use it until my distrib (debian sid) will update too.
may be changed to g_file_monitor_file without problem
Created attachment 125032 [details] [review] Use gio 2.16 API in profile plugin
(In reply to comment #35) > Created an attachment (id=125032) [edit] > Use gio 2.16 API in profile plugin > thanks. Patch applied.
(In reply to comment #31) > Created an attachment (id=124976) [edit] > Fix usage of gnome-vfs for search plugin > Just a note: The search plugin uses the standard C library io feature (fwrite, etc.). We should also change this to gio as it is supposed to work for non-local files, too.
Before, after or in parallel of the current modifications of the search feature?
(In reply to comment #38) > Before, after or in parallel of the current modifications of the search > feature? > I think we can do that in parallel without much harm. The big modifications in the search plugin have been done and the rest are just some UI changes that shouldn't affect the backend anymore.
(In reply to comment #39) > I think we can do that in parallel without much harm. The big modifications in > the search plugin have been done and the rest are just some UI changes that > shouldn't affect the backend anymore. > I opened a feature bug #565492 and attached a patch to it
Created attachment 125407 [details] [review] Fix of a regression introduced by previous CVS patch
Thanks Georg!
Created attachment 125449 [details] [review] Fix usage of GnomeVFS for subversion plugin
Created attachment 125469 [details] [review] Replace gnomevfs in run-program plugin with gio
Created attachment 125526 [details] [review] Replace gnomevfs in run-program plugin with gio, 2nd try remove large portion of path resolvment, because g_file_* does it inherently
Thanks a lot for your patches Jens. So, what's remaining: - debug-manager - gtodo - symbol-db - gnome-build (gbf-am, gbf-mkfile) There is a patch for gnome-build in bug #539124 but it is broken and I guess it also has to be updated to apply to the new build structure.
actually gtodo is done, there's an #ifdef 0 section left in code currently not used by anjuta.
btw you may remove the whole #ifdef 0 block in libgtodo.c, it's not necessary with gio anymore. I cannot provide a patch currently, my sourcetree is in a mess
subversion/plugin.c:233: type = g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL); uses a function which is glib 2.18+ only.
Created attachment 125809 [details] [review] port symbol-db to gio Pretty straightforward patch that ports all GnomeVfs functions to their gio counterparts.
(In reply to comment #50) > Created an attachment (id=125809) [edit] > port symbol-db to gio > > Pretty straightforward patch that ports all GnomeVfs functions to their gio > counterparts. > committed, thanks.
Created attachment 125836 [details] [review] replace glib-2.18 only functions with older counterparts *sigh* /me votes for a bigger size of the "Since" paragraph in devhelp
committed, thanks for the patch.
I've removed GNOME_VFS_LIBS from svn and cvs Makefile.am, because they won't be needed anymore. It would be great if also on the plugins already ported to gio there was this trivial patch. Btw: I don't know the status of the porting so I avoid to patch here and there, but surely you know it! thanks a lot.
Created attachment 125847 [details] [review] Remove gnome-vfs from Makefile.am
Created attachment 125850 [details] [review] remove code not needed in gio/gfvs
patches committed, thanks for them!
So is this completely fixed now? Because suka set this at http://live.gnome.org/action/diff/GioPort?action=diff&rev1=158&rev2=159
No, I think there is a few use left. I think it could be completed in this cycle.
Created attachment 126324 [details] [review] Fix usage of gnome-vfs for debug-manager
> So, what's remaining: > - debug-manager > - gtodo > - symbol-db > - gnome-build (gbf-am, gbf-mkfile) > What about project-manager? Saw it when tracing bug #567541. One small fix is contained in the patch for that bug
> What about project-manager? Saw it when tracing bug #567541. One small fix is > contained in the patch for that bug Obviously it also uses gnome-vfs. Maybe I missed it last time I checked. Seems like we really have a change to kill gnome-vfs for this release which would be cool!
Created attachment 126520 [details] [review] Remove gnome-vfs from project-manager I think the project-manager uri handling stuff could use some more cleanup than what I did.
Created attachment 126527 [details] [review] remove dangling includes, Makefile references etc.
(In reply to comment #62) > > What about project-manager? Saw it when tracing bug #567541. One small fix is > > contained in the patch for that bug > > Obviously it also uses gnome-vfs. Maybe I missed it last time I checked. Seems > like we really have a change to kill gnome-vfs for this release which would be > cool! > grep -c --include *.c --include *.am --include *.h -ir gnome[-_]vfs . | sort -rnt : -k2 | grep -v :0$ ./plugins/gbf-am/gbf-am-project.c:45 ./plugins/gbf-mkfile/gbf-mkfile-project.c:29 ./plugins/symbol-db/test/main.c:8 ./plugins/symbol-db/test/benchmark.c:5 ./src/main.c:3 ./plugins/glade/plugin.c:2 ./src/anjuta.c:1 ./libanjuta/anjuta-utils.c:1 ./libanjuta/anjuta-preferences.c:1 ./libanjuta/anjuta-plugin-manager.c:1 Doesn't look too bad, I think. Hardest problem is gnome-build. I'd vote for using the methods of the related bug for gnome-build and do an overhaul later on
Created attachment 126536 [details] [review] 126527: remove dangling includes, Makefile references etc. patch 126527 without included 126520
Created attachment 126544 [details] [review] Remove gnome-vfs from project-manager work around a problem when files in a project do not exist on filesystem (like #554614)
Created attachment 126587 [details] [review] remove gnome-vfs from gbf-mkfile plugin and fix a bug affecting creating wrong uris for source files
Created attachment 126595 [details] [review] remove gnome-vfs from gbf-am plugin whew... gbf-am and gbf-mkfile share a serious amount of code... maybe some refactoring should be done here...
Created attachment 126596 [details] [review] last patch to remove nearly everything left. The only files left are: ./plugins/symbol-db/test/main.c:8 ./plugins/symbol-db/test/benchmark.c:5 The stuff in main.c is enclosed in #if 0 and the stuff in benchmark.c is not even compiled.
Hi! > whew... gbf-am and gbf-mkfile share a serious amount of code... maybe some > refactoring should be done here... gbf-mkfile is actually quite broken and does only allow very basic stuff. I don't really like the use of perl scripts for the parsing anyway and reusing the automake stuff for the Makefile scanning is not good either.
(In reply to comment #69) > whew... gbf-am and gbf-mkfile share a serious amount of code... maybe some > refactoring should be done here... Definitively yes, but I think we should keep this for the next cycle.
(In reply to comment #70) > Created an attachment (id=126596) [edit] > last patch to remove nearly everything left. > > The only files left are: > > ./plugins/symbol-db/test/main.c:8 > ./plugins/symbol-db/test/benchmark.c:5 > > The stuff in main.c is enclosed in #if 0 and the stuff in benchmark.c is not > even compiled. > benchmark.c is used to test speed of population engine. I'll be grateful to you if you could port it to gio too. You can leave there main.c coz it's not used now.
Created attachment 126630 [details] [review] very last patch to port benchmark.c
(In reply to comment #74) > Created an attachment (id=126630) [edit] > very last patch to port benchmark.c > patch committed! thanks very much!
Thanks for the patches! I had to fix some little things in the project-manager patch (wrong unref, missing argument and typo), you might want to check if this is all correct.
Looks fine, I think I have submitted the wrong version of the patch.
I cannot have editor plugin to compile anymore. print.c:30:39: error: libgnomeprint/gnome-print.h: No such file or directory print.c:31:43: error: libgnomeprint/gnome-print-job.h: No such file or directory print.c:32:48: error: libgnomeprintui/gnome-print-dialog.h: No such file or directory print.c:33:53: error: libgnomeprintui/gnome-print-job-preview.h: No such file or directory print.c:64: error: expected specifier-qualifier-list before ‘GnomeFont’ print.c:78: error: expected specifier-qualifier-list before ‘GnomePrintJob’ print.c:133: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token print.c: In function ‘anjuta_print_job_info_style_destroy’: print.c:141: error: ‘PrintJobInfoStyle’ has no member named ‘font’ print.c:141: warning: implicit declaration of function ‘gnome_font_unref’ print.c:141: warning: nested extern declaration of ‘gnome_font_unref’ print.c:141: error: ‘PrintJobInfoStyle’ has no member named ‘font’ print.c:142: error: ‘PrintJobInfoStyle’ has no member named ‘font_name’ print.c:142: error: ‘PrintJobInfoStyle’ has no member named ‘font_name’ print.c: In function ‘anjuta_print_job_info_style_load_font’: print.c:173: error: ‘GnomeFontFace’ undeclared (first use in this function) print.c:173: error: (Each undeclared identifier is reported only once print.c:173: error: for each function it appears in.) print.c:173: error: ‘font_face’ undeclared (first use in this function) print.c:176: error: ‘PrintJobInfoStyle’ has no member named ‘font_name’ print.c:178: error: ‘PrintJobInfoStyle’ has no member named ‘font_name’ print.c:179: error: ‘PrintJobInfoStyle’ has no member named ‘bold’ print.c:185: error: ‘PrintJobInfoStyle’ has no member named ‘italics’ print.c:191: error: ‘PrintJobInfoStyle’ has no member named ‘size’ print.c:193: error: ‘PrintJobInfoStyle’ has no member named ‘size’ print.c:195: error: ‘PrintJobInfoStyle’ has no member named ‘size’ print.c:198: error: ‘PrintJobInfoStyle’ has no member named ‘font’ [...] was libgnomeprintui expected to be removed?
project-manager fails too. gbf-tree-data.c: In function ‘gbf_tree_data_new_source’: gbf-tree-data.c:83: error: ‘GFile’ undeclared (first use in this function) gbf-tree-data.c:83: error: (Each undeclared identifier is reported only once gbf-tree-data.c:83: error: for each function it appears in.) gbf-tree-data.c:83: error: ‘file’ undeclared (first use in this function) gbf-tree-data.c:84: error: ‘GFileInfo’ undeclared (first use in this function) gbf-tree-data.c:84: error: ‘file_info’ undeclared (first use in this function) gbf-tree-data.c:91: warning: implicit declaration of function ‘g_file_new_for_uri’ gbf-tree-data.c:91: warning: nested extern declaration of ‘g_file_new_for_uri’ gbf-tree-data.c:92: warning: implicit declaration of function ‘g_file_get_basename’ gbf-tree-data.c:92: warning: nested extern declaration of ‘g_file_get_basename’ gbf-tree-data.c:92: warning: assignment makes pointer from integer without a cast gbf-tree-data.c:93: warning: implicit declaration of function ‘g_file_query_exists’ gbf-tree-data.c:93: warning: nested extern declaration of ‘g_file_query_exists’ gbf-tree-data.c:95: warning: implicit declaration of function ‘g_file_query_info’ gbf-tree-data.c:95: warning: nested extern declaration of ‘g_file_query_info’ gbf-tree-data.c:96: error: ‘G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME’ undeclared (first use in this function) gbf-tree-data.c:97: error: ‘G_FILE_QUERY_INFO_NONE’ undeclared (first use in this function)
http://svn.gnome.org/viewvc/anjuta/trunk/configure.in?r1=4609&r2=4610 removed libgnomeprint-2.2 >= $GNOME_REQUIRED libgnomeprintui-2.2 >= $GNOME_REQUIRED from configure.in. --> Jens? However, this issue is unrelated to THIS bug report as this went in for rev4609 before gnome-vfs was killed.
Should work now - at least make distcheck doesn't complain any longer...
The patch for debug manager seems to be missing from trunk...
Thanks Jens. I have committed the debug manager patch. Is there something missing now ?
There is something wrong with gbf-am now. Try adding files to a target and instead of adding the files, they are added using a relative path to the project root. For example TEST_SOURCE = main.c \ ../../src/test1.c \ ../../src/test2.c (note that main.c, test1.c and test2.c are all in the same directory src/)
Created attachment 127740 [details] [review] Fix regression found by jhs Fixes also a c&p error for uri_is_parent
Thanks!
I don't consider this bug completely fixed yet. ;-) $:andre\> grep -r gnomevfs . ./plugins/symbol-db/test/main.c:#include <libgnomevfs/gnome-vfs.h> ./plugins/profiler/plugin.h:#include <libgnomevfs/gnome-vfs-utils.h> ./plugins/profiler/plugin.h:#include <libgnomevfs/gnome-vfs.h> ./plugins/profiler/gprof-profile-data.h:#include <libgnomevfs/gnome-vfs.h> $:andre\> grep -r gnome_vfs . ./plugins/symbol-db/test/main.c:gnome_vfs_init (); ./plugins/symbol-db/test/main.c:if (gnome_vfs_directory_list_load ./plugins/symbol-db/test/main.c:local_path = gnome_vfs_get_local_path_from_uri (tmp); ./plugins/symbol-db/test/main.c: gnome_vfs_init (); ./plugins/symbol-db/test/main.c: gnome_vfs_init (); ./plugins/symbol-db/test/benchmark.c: gnome_vfs_init();
Will send patch for profiler later; as for symbol-db, this is all within a huge #if 0 block
(In reply to comment #88) > as for symbol-db, this is all within a huge > #if 0 block > I confirm this. That is only dead-code that will be replaced when new tests will be required. There's no need to remove it too, being inside a #if 0 block.
I get your point, but it still causes false positives in the scripts we run to check for deprecated stuff. :)
ok then, removed main.c on svn trunk.
Created attachment 128916 [details] [review] fix remaning places
(In reply to comment #92) > Created an attachment (id=128916) [edit] > fix remaning places > committed, thanks! (In reply to comment #87) > I don't consider this bug completely fixed yet. ;-) > Andre is it all ok now?
I'm closing this. Please reopen it if you find something wrong.
cool. thanks a bunch.