1. 08 Mar, 2018 1 commit
    • Benjamin Berg's avatar
      Add calls to g_simple_async_result_set_check_cancellable · 26c215e2
      Benjamin Berg authored
      If an operation is cancelled through the GCancellable, then the idiom is
      that the operation is always cancelled, even if it has finished
      successfully. To ensure this is the case, add calls to
      g_simple_async_result_set_check_cancellable everywhere.
      Without this, e.g. gnome-control-center will crash when switching away
      from the power panel quickly, as the NMClient creation finishes
      asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
      ensure it doesn't access the now invalid user_data parameter.
  2. 08 Feb, 2018 1 commit
    • Lubomir Rintel's avatar
      all: fix -Wcast-function-type warnings · ee916a1e
      Lubomir Rintel authored
      GCC 8.0's -Wcast-function-type objects casting function pointers to ones
      with incompatible prototypes. Sometimes we do that on purpose though.
      Notably, the g_source_set_callback()'s func argument can point to functions
      of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps
      just not worth reworking, that would just be a waste of time.
      A cast to void(*)(void) avoids the GCC warning, let's use it.
  3. 06 Dec, 2017 2 commits
  4. 08 Mar, 2017 1 commit
  5. 03 Oct, 2016 1 commit
  6. 29 Mar, 2016 1 commit
  7. 03 Mar, 2016 2 commits
    • Thomas Haller's avatar
      all: don't include error->code in log messages · cd4f84b7
      Thomas Haller authored
      GError codes are only unique per domain, so logging the code without
      also indicating the domain is not helpful. And anyway, if the error
      messages are not distinctive enough to tell the whole story then we
      should fix the error messages.
      Based-on-patch-by: Dan Winship's avatarDan Winship <danw@gnome.org>
    • Thomas Haller's avatar
      all: clean-up usage of GError · 01b9b410
      Thomas Haller authored
      Functions that take a GError** MUST fill it in on error. There is no
      need to check whether error is NULL if the function it was passed to
      had a failing return value.
      Likewise, a proper GError must have a non-NULL message, so there's no
      need to double-check that either.
      Based-on-patch-by: Dan Winship's avatarDan Winship <danw@gnome.org>
  8. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      - Except for <config.h> itself. Include it with angle brackets as suggested by
  9. 26 Dec, 2015 1 commit
  10. 05 Aug, 2015 2 commits
  11. 24 Jul, 2015 1 commit
    • Dan Winship's avatar
      all: rename nm-glib-compat.h to nm-glib.h, use everywhere · 3452ee2a
      Dan Winship authored
      Rather than randomly including one or more of <glib.h>,
      <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
      "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
      nm-glib.h, include <gio/gio.h> from there, and then change all .c
      files in NM to include "nm-glib.h" rather than including the glib
      headers directly.
      (Public headers files still have to include the real glib headers,
      since nm-glib.h isn't installed...)
      Also, remove glib includes from header files that are already
      including a base object header file (which must itself already include
      the glib headers).
  12. 13 Nov, 2014 2 commits
    • Dan Winship's avatar
      libnm*: fix library gettext usage · 53f5e9af
      Dan Winship authored
      Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _()
      will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than
      "gettext (string)" (which will use the program's default domain, which
      works fine for programs in the NetworkManager tree, but not for
      external users). Likewise, we need to call bindtextdomain() so that
      gettext can find the translations if the library is installed in a
      different prefix from the program using it (and
      bind_textdomain_codeset(), so it will know the translations are in
      UTF-8 even if the locale isn't).
      (The fact that no one noticed this was broken before is because the
      libraries didn't really start returning useful translated strings much
      until 0.9.10, and none of the out-of-tree clients have been updated to
      actually show those strings to users yet.)
    • Dan Winship's avatar
      all: consistently include config.h · 3bfb163a
      Dan Winship authored
      config.h should be included from every .c file, and it should be
      included before any other include. Fix that.
      (As a side effect of how I did this, this also changes us to
      consistently use "config.h" rather than <config.h>. To the extent that
      it matters [which is not much], quotes are more correct anyway, since
      we're talking about a file in our own build tree, not a system
  13. 01 Aug, 2014 1 commit
    • Thomas Haller's avatar
      libnm-glib: fix warning about redefining typedef RemoteCall · 0238f8f8
      Thomas Haller authored
      clang warns:
          make[4]: Entering directory `./NetworkManager/libnm-glib'
            CC       libnm_glib_la-nm-remote-connection.lo
          nm-remote-connection.c:77:3: error: redefinition of typedef 'RemoteCall' is a C11 feature [-Werror,-Wtypedef-redefinition]
          } RemoteCall;
          nm-remote-connection.c:67:27: note: previous definition is here
          typedef struct RemoteCall RemoteCall;
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
  14. 25 Jul, 2014 1 commit
    • Dan Winship's avatar
      libnm-glib: document some properties · dafe51e8
      Dan Winship authored
      Some libnm-glib object properties were only documented in the
      GParamSpec strings, not via gtk-doc comments, so they became
      undocumented when the paramspec strings went away. Fix that.
      (Also fix incorrect gtk-doc syntax with several NMClient properties.)
  15. 15 Jul, 2014 2 commits
    • Dan Winship's avatar
      libnm-util, libnm-glib: whitespace fixes · 2570c5a1
      Dan Winship authored
      Fix indentation, kill trailing whitespace, split some long lines.
    • Dan Winship's avatar
      libnm-util, libnm-glib: standardize copyright/license headers · cb7e1893
      Dan Winship authored
      - Remove list of authors from files that had them; these serve no
        purpose except to quickly get out of date (and were only used in
        libnm-util and not libnm-glib anyway).
      - Just say "Copyright", not "(C) Copyright" or "Copyright (C)"
      - Put copyright statement after the license, not before
      - Remove "NetworkManager - Network link manager" from the few files
        that contained it, and "libnm_glib -- Access network status &
        information from glib applications" from the many files that
        contained it.
      - Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
        to files that were missing it.
  16. 19 Jun, 2014 1 commit
  17. 21 Feb, 2014 2 commits
  18. 31 Jan, 2014 1 commit
  19. 30 Jan, 2014 1 commit
  20. 27 Jan, 2014 1 commit
  21. 18 Nov, 2013 1 commit
  22. 09 Sep, 2013 1 commit
  23. 28 May, 2013 1 commit
  24. 19 Apr, 2013 1 commit
    • Martin Pitt's avatar
      Use %NULL macro in doc strings · 57a9fb3c
      Martin Pitt authored
      Mass-converted "NULL" to "%NULL" in docstrings with
        find -name '*.c'| xargs sed -i '/^ \*.*[^%]NULL/ s/NULL\b/%NULL/g'
  25. 08 Apr, 2013 2 commits
    • Dan Williams's avatar
      libnm-glib: use private connection before trying the system bus · a87b5a15
      Dan Williams authored
      Use the D-Bus connection helper whenever we need a connection to
      NM, which by default tries to use a private connection instead of
      the shared bus connection whenever the user is root.  Doing this
      by default will not change the behavior of libnm-glib, and allows
      tools like nmcli and libnm-glib-using clients to work in minimal
      environments (those without a bus daemon) by default.
    • Dan Williams's avatar
      libnm-glib: use helpers to create dbus proxies · 661d0985
      Dan Williams authored
      When using a private connection, we need to use dbus_g_proxy_new_for_peer()
      because the bus isn't involved.  Since many parts of libnm-glib create a
      proxy for their corresponding remote object, consolidate the proxy creation
      A later patch will add logic to use a private connection versus a bus-based
  26. 01 Apr, 2013 1 commit
  27. 07 Mar, 2013 1 commit
  28. 14 Feb, 2013 3 commits
  29. 17 Jul, 2012 1 commit
    • Dan Winship's avatar
      libnm-glib: fix GAsyncInitable implementations · 32046449
      Dan Winship authored
      If a class implements init_async, it should implement init_finish too,
      rather than assuming the default implementation will do the right
      thing (which it briefly didn't in glib 2.33).
  30. 23 Apr, 2012 1 commit
  31. 06 Feb, 2012 1 commit