masneyb / gftp

gFTP is a free multithreaded file transfer client for *NIX based machines. 56 language translations available.
http://www.gftp.org
MIT License
116 stars 21 forks source link

Generate the author list in the Help->About Dialog #167

Closed sedwards closed 1 year ago

sedwards commented 1 year ago

This takes in to account our discussion about portability and simplifying the string handling as much as possible.

I accidentally closed out the other PR by mistake and it wouldn't let me reopen after amending the commit.

wdlkmpx commented 1 year ago

This is not portable enough, there are many CPU architectures. I'll turn on the PC and see what I can do with a different approach

sedwards commented 1 year ago

I spent a good bit of time looking in to this, the other way to do is is encode the data as hex in to an array, and that is portable across all platforms. We just replace the obj-copy calls to xdd calls, and then access the structure and convert it back to NULL terminated gchar so the dialog can read it.

See this discussion: https://stackoverflow.com/questions/410980/include-a-text-file-in-a-c-program-as-a-char/411000#411000

If that is what you want me to do, let me know, I just didn't want to throw out everything I had already done since I could add whatever platform support I needed in autoconf if it came up.

But if that's really the way you want to go, thats fine with me, I'll get over tossing my existing solution and go with the even more portable solution.

wdlkmpx commented 1 year ago

gftp can easily do that by itself, it only needs to find the AUTHORS file, read it and perform operations ${docdir}, /usr/share/doc/gftp/AUTHORS

I'll think I'll add gftp_get_docdir(), taking into account the GFTP_DOC_DIR env variable for the portable stuff

sedwards commented 1 year ago

Ah ok, I didn't know what function I should call in glib or gtk to read in a block of text like that. I couldn't find anything that pointed me in the right direction at least so I tried to implement the most portable generic solution I could...then I found the xdd one which is supposed to be even more portable.

If you know which glib/gtk of gftp functionality I should call to do it, I will give it a shot and save you the hassle.

After thinking about it more today, I'd also like to read in the LICENSE and have it displayed so I was thinking about making it more generic like you proposed anyway. So if you just point me in the right direction I'll give it another shot.

wdlkmpx commented 1 year ago

Hmm see commit https://github.com/masneyb/gftp/commit/e7224c9100b850e7a6c559ab4273b262ef6eff34

I didn't apply any changes from this PR, so you might want to open a new PR with the changes you want to add.

I didn't remove translators = _("Translated by") because most (all?) .po files actually translate that string https://github.com/masneyb/gftp/blob/master/po/zh_TW.po#L1460