This is a wrapper around `tm_get_real_path()` but is in a more suitable namespace/module.
I think it makes more sense like this. I typically dislike adding general-purpose functions to the API, but since Glib doesn't provide any equivalent, it really is useful. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1224
-- Commit Summary --
* Add utils_get_real_path() and use it
-- File Changes --
M src/app.h (2) M src/document.c (8) M src/libmain.c (2) M src/plugindata.h (2) M src/tagmanager/tm_source_file.c (2) M src/utils.c (29) M src/utils.h (1)
-- Patch Links --
https://github.com/geany/geany/pull/1224.patch https://github.com/geany/geany/pull/1224.diff
@codebrainz pushed 1 commit.
0370112 Mark tm_get_real_path with G_DEPRECATED_FOR
If there are no objections, I will merge this "soon".
elextr commented on this pull request.
LGBI
b4n commented on this pull request.
Otherwise, LGTM
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
Meh, can't we move the implementation at the non-deprecated place and use it in the deprecated one, instead of this?
codebrainz commented on this pull request.
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
You mean a reverse dependency of TagManager on Geany?
b4n commented on this pull request.
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
Yeah; now it's under *src/* it might not be so bad
codebrainz commented on this pull request.
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
It seems wrong, which is why I did it like this, but if you'd prefer to have TM also depend on Geany, I can change it to be so.
b4n commented on this pull request.
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
Myeah it wouldn't really be pretty either. I don't care much, you can keep it like it's now.
techee commented on this pull request.
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name); +gchar *tm_get_real_path(const gchar *file_name) +#ifndef GEANY_PRIVATE +G_DEPRECATED_FOR(utils_get_real_path) +#endif
We might need TM to depend on Geany anyway - while working on https://github.com/geany/geany/pull/963 I realized I'd need to know in TM if GIO is used for opening/saving files or not.
We actually don't need to create the libtagmanager library - the sources inside "tagmanager" can just be other sources of libgeany.
Otherwise +1 for moving this function outside of TM - it doesn't belong there and I wanted to do this myself (but like Colomban I'd prefer having the implementation in utils).
Okay if you want, we can always move the implementation later.
The API version should be fixed, because it won't merge cleanly as is (no idea why GitHub doesn't complain BTW).
Moved to 1.31
Would be nice to stop incrementing the target release get this finally merged in 1.31. I believe the only thing that @b4n requested was updating the API in the docstring which should now be 1.31. @codebrainz could you make this change?
@techee it would be nice to get it done, but since its now only just over a week to release IMHO no more changes other than bugfixes should be included.
@elextr As I said, for 1.31, not 1.30.
Sorry @techee I misread :)
What about this?
(On a related note, our `realpath()` implementation for win32, called by `tm_get_real_path()` is buggy, see #1534)
I'm fine with this. However, I would support the idea of moving the implementation into `src/utils.c` as it is where it should live after any deprecation.
And of course, updating Geany and API version.
Closed in 4a60cdd12727f8f252a3e0d6921e26377ef84904
Closed #1224.
github-comments@lists.geany.org