Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
konsolebox commented on this pull request. > @@ -1565,6 +1565,138 @@ void document_open_files(const GSList *filenames, > gboolean readonly, GeanyFilety } +static GFileEnumerator *enumerate_children(const char *dir_path, GError **error) +{ + GFile *file = g_file_new_for_path(dir_path); + + const gchar *attributes = G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE; + + GFileEnumerator *enumerator = g_file_enumerate_children(file, attributes, What function, g_file_enumerate_children? It does exist in that version. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#discussion_r112433287
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
elextr commented on this pull request. > @@ -1565,6 +1565,138 @@ void document_open_files(const GSList *filenames, > gboolean readonly, GeanyFilety } +static GFileEnumerator *enumerate_children(const char *dir_path, GError **error) +{ + GFile *file = g_file_new_for_path(dir_path); + + const gchar *attributes = G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE; + + GFileEnumerator *enumerator = g_file_enumerate_children(file, attributes, Currently Geany only requires 2.32, but this is a 2.44 function. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#pullrequestreview-33743035
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
> however I think it's better to integrate this into the existing open dialog. > Perhaps with a checkbox ([x] open recursively) I think I tried to do that initially, but I got into some issues that made me decide to just use another dialog box. It's probably the difference in behavior between targetting files, and targetting both files and directories. I can't remember if it was the stock button or the dialog box itself that's to be blamed. Anyway, I find using another dialog box more convenient and faster to use. I don't have to click a checkbox, or check if it's been activated or not before clicking a View or Open button. Differing behavior, and programmatical issues that might occur are also segregated. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-295617699
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
I think the general feature is OK, however I think it's better to integrate this into the existing open dialog. Perhaps with a checkbox ([x] open recursively) and a text entry to optionally specify file patterns (and maybe read them from project settings?) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-295608956
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 1 commit. 4c22050 Ask before opening many files -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/04c26d1f91791e19f1e3bf18e550bb79654ee505..4c2205041a907a416d41d9a100851e92a01444b4
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 1 commit. 04c26d1 Revert the unreverted modification for the title arg to win32_show_document_open_dialog() -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/837eb0ce657161780be6494c9b7cc9c2ff148727..04c26d1f91791e19f1e3bf18e550bb79654ee505
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 1 commit. 837eb0c Use stock icon -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/cf9c0e657f84dbe421a8d624e240fcd942b1e0ab..837eb0ce657161780be6494c9b7cc9c2ff148727
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 1 commit. cf9c0e6 Reformat affected while loop --- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/13f47d6da30e83111b977bd75a0607890422005b..cf9c0e657f84dbe421a8d624e240fcd942b1e0ab
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 4 commits. 5046fc2 Make specifying recursion limit more consistent 97e7f17 Do not specify URI b76b58a Use simpler function calls for getting attributes 13f47d6 Use g_file_enumerator_next_file() instead of g_file_enumerator_iterate() --- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/55caa0a81784abcf9d2db1f64b002bdac2ae3aa2..13f47d6da30e83111b977bd75a0607890422005b
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
> Opening files in recursive directories is something that belongs in a plugin, > not in core. I thought it's doable, but I'm not sure about the idea of mirror-copying open-dialog-box related codes to a plugin. Having an Open Dialog box under Tools menu also seems awkward. But I can do that if I decide to. > Also look at the project plugins (there are two of them at least) because > they may do part of what you want too and also the treebrowser plugin which > does recursive directory walking without too-new glib functions. It's ok. I can easily picture how it can be done with `g_file_enumerator_next_file()`. Also, it seems like not explicitly requesting a GFile instance from an iteration function is better since we don't need it when we're opening a file. An instance should only be created if we're opening another directory. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237833181
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
Opening files in recursive directories is something that belongs in a plugin, not in core. Also look at the project plugins (there are two of them at least) because they may do part of what you want too and also the treebrowser plugin which does recursive directory walking without too-new glib functions. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237808797
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
> Geany's requirement is 2.32 so you will have to find another solution. Using the other function `g_file_enumerator_next_file()` would make the code messy as you would have to manage instances of GFile and GFileInfo as you traverse yourself. I also don't like converting it to a recursive function (if it may be the solution). I guess I'll just wait for a version requirement bump. > Can you discuss your use-case more? Your first post doesn't actually make a > lot of sense when you look at it in this light. I thought saying "most helpful when recursively opening multiple files in the second instance of Geany" was my trump card because I assumed that there was no way to open other files in another instance but it turns out that there's actually a way. So I guess I have to give other reasons why this feature would be helpful besides that. And one simply is the basic function it gives: It helps users open multiple instances recursively, whether they would be capable of doing that in the command-line or not. It's easier to open a dialog box than type `find /geany/src/ \( -name '*.c' -o -name '*.h' \) -print0 | xargs -0 geany`. And if we use `-c`, we would also have to remember the directory that the target instance is using. Maybe I could create a script for that - that's flexible enough to be configurable with the type of files I want to be opened, and the target instance I want the files to be opened with, but it's still much more convenient to just have it in a dialog box. I do it often after all. Reasons for opening multiple files recursively are pretty much obvious already, but here are mine: - Open multiple files of the source directory of a project I want to work on with (like Geany's `./src`). - Open multiple files of the source directory of a dependency I want to examine (like glib and gtk+ 2) so I would know how their functions work. I could access them easily with "Find Usage". - Open multiple files in /usr/include (like /usr/include/glib-2.0/ and /usr/include/gtk-2.0/gtk/ ) so I could have completion. That is of course not only about Geany. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237784071
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
> I guess that also proves that it's possible to sanely have multiple > instances? Yes you can have multiple instances safely with different configs, as noted above you can direct files opened at the command line, or you can open the file sin the instance as well of course. Can you discuss your use-case more? Your first post doesn't actually make a lot of sense when you look at it in this light. > Travis CI build fails because g_file_enumerator_iterate() requires GLib 2.44. Geany's requirement is 2.32 so you will have to find another solution. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237778041
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
Travis CI build fails because `g_file_enumerator_iterate()` requires GLib 2.44. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237776634
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
Whats wrong with using the -i option on the command line? Multiple instances using the same configuration should not be encouraged. It will blow up in users faces at some point. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1163#issuecomment-237770628
Re: [Github-comments] [geany/geany] Add 'File->Open Files Recursively' (#1163)
@konsolebox pushed 3 commits. 59f5f05 Do not skip explicitly selected symbolic links 836bc85 Fix "Cancel": GEANY_RESPONSE_OPEN_RECURSIVELY wasn't checking against 'response' 55caa0a Use current directory if nothing is selected --- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/geany/geany/pull/1163/files/b5e3c5dc466d2a207f9ac3aeee10ed69d024543b..55caa0a81784abcf9d2db1f64b002bdac2ae3aa2