Reference https://sourceforge.net/tracker/?func=detail&aid=3440252&group_id=15... last example the call to utils_mkdir() inside utils_get_config_files().
Can anyone explain why a function that is meant to be listing config files is creating an empty directory?
Cheers Lex
On 09/09/12 13:11, Lex Trotman wrote:
Reference https://sourceforge.net/tracker/?func=detail&aid=3440252&group_id=15... last example the call to utils_mkdir() inside utils_get_config_files().
Can anyone explain why a function that is meant to be listing config files is creating an empty directory?
Probably just to be safe.
I agree that it looks wrong to create a directory in a function used to list contents of a directory.
However, IIRC, the basic idea of the mkdir() itself was to create sub-directories in the user's config directory for his convenience. So the user sees after the first start of Geany which directories are read and so he sees where to place custom configs.
The mkdir() call could be moved out of utils_get_config_files() into src/main.c:create_config_dir() where also other sub-directories in the user's config directory are created. Then those were all in one place which is probably good.
Regards, Enrico
On 9 September 2012 21:57, Enrico Tröger enrico.troeger@uvena.de wrote:
On 09/09/12 13:11, Lex Trotman wrote:
Reference https://sourceforge.net/tracker/?func=detail&aid=3440252&group_id=15... last example the call to utils_mkdir() inside utils_get_config_files().
Can anyone explain why a function that is meant to be listing config files is creating an empty directory?
Probably just to be safe.
I agree that it looks wrong to create a directory in a function used to list contents of a directory.
However, IIRC, the basic idea of the mkdir() itself was to create sub-directories in the user's config directory for his convenience. So the user sees after the first start of Geany which directories are read and so he sees where to place custom configs.
The mkdir() call could be moved out of utils_get_config_files() into src/main.c:create_config_dir() where also other sub-directories in the user's config directory are created. Then those were all in one place which is probably good.
Hey Enrico,
That sounds like a much better suggestion.
Cheers Lex
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel