Commit Graph

8 Commits

Author SHA1 Message Date
Jacob Boerema e90f041ca5 plug-ins: fix resource leaks detected by coverity
Several resource leaks here were detected by coverity:
- Not freeing value_utf.
- Strings returned by g_strconcat should be g_free'd. To handle the string
concatenations easier we use GString and g_string_append instead.
Also introduce function get_list_elements to reduce the number of
repetetive elements.
While we were at it, also remove unused includes.
2021-10-24 22:01:16 -04:00
Jacob Boerema 0a0eeac1ad plug-ins: more refactoring of metadata-editor.
There was a lot of duplicate code based on
whether or not value was NULL with for
some tags partially unreachable code.

We combine the parts and only test
value for NULL where needed.

Also rename the typos in enum
COL_REGSITRY_* to
COL_REGISTRY_*
2021-03-12 22:05:52 -05:00
Jehan 31cbc7e0e6 plug-ins: clean all warnings on metadata plug-in.
I made the various static arrays in headers declared as extern and
defined in a separate implementation file, with additional size constant
when necessary (since G_N_ELEMENTS() cannot be used on partially
defined arrays).

Note that this is better than the original implementation, yet I am not
saying this is ideal either. I am not fond of such code organization and
think a better one could be done. But it would require to dive deeper
into this plug-in and I don't want to right now, nor have the time.

At least now it stopped shouting all these warnings!
2019-11-06 14:24:42 +01:00
Jehan 024a919c77 plug-ins: clean out some warnings.
This cleans just a third of the warnings in this metadata plug-in. It is
a very bad practice to define static const strings in a header file like
this, especially if this header is included in several files. Let's make
these macros.

Also why are these header tags sometimes used with the const name (now
macros), sometimes directly with the string literals? I fixed some of
these, but more string literals are lying around.

Remaining warnings are similar, about const string arrays. If really we
want this, we should declare these extern and define them in a separate
implementation file. This whole plug-in should be really reorganized and
cleaned in depth.
2019-11-06 13:36:12 +01:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer d315cc1034 Bug 761170 - Warnings building with clang
Fix clang warnings along with some other minor stuff, no logic changes.
2017-07-14 12:26:10 +02:00
Michael Natterer 486e0f3d88 plug-ins: lots and lots of cleanup in metadata/ 2017-07-07 23:54:25 +02:00
Ben Touchette dc9856cfe1 Bug 769820 - Cannot enter Iptc information when no metadata is available...
...and fails to write it to file when it is

Completely redo metadata editor and viewer code, adds support for
Xmp.xmpMM.History and more.
2017-07-07 18:11:39 +02:00