Skip to content
Snippets Groups Projects

Add calls-application class

Merged Mohammed Sadiq requested to merge sadiq/calls:wip/sadiq/app-fix into master
1 unresolved thread

Move application specific code to a new class for finer controls.

This commit also fixes 2 leaks, and presents an existing window if available (instead of always creating a new window).

Merge request reports

Pipeline #1343 passed

Pipeline passed for 08f19de3 on sadiq:wip/sadiq/app-fix

Merged by Bob HamBob Ham 6 years ago (Oct 4, 2018 1:41pm UTC)

Loading

Pipeline #1344 passed

Pipeline passed for 21d45ec9 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Mohammed Sadiq added 1 commit

    added 1 commit

    Compare with previous version

  • Mohammed Sadiq resolved all discussions

    resolved all discussions

  • Bob Ham mentioned in merge request !18 (merged)

    mentioned in merge request !18 (merged)

  • Bob Ham
  • Bob Ham
  • Mohammed Sadiq added 3 commits

    added 3 commits

    Compare with previous version

  • Mohammed Sadiq added 1 commit

    added 1 commit

    Compare with previous version

  • Mohammed Sadiq resolved all discussions

    resolved all discussions

  • Bob Ham mentioned in issue #17 (closed)

    mentioned in issue #17 (closed)

  • Mohammed Sadiq added 33 commits

    added 33 commits

    Compare with previous version

  • Bob Ham
  • Bob Ham
  • Mohammed Sadiq added 1 commit

    added 1 commit

    Compare with previous version

  • Mohammed Sadiq resolved all discussions

    resolved all discussions

  • 50 * @include: "calls-application.h"
    51 */
    52
    53 struct _CallsApplication
    54 {
    55 GtkApplication parent_instance;
    56
    57 GDBusConnection *connection;
    58 CallsProvider *provider;
    59 };
    60
    61 G_DEFINE_TYPE (CallsApplication, calls_application, GTK_TYPE_APPLICATION)
    62
    63
    64 static void
    65 calls_application_finalize (GObject *object)
    • Contributor

      These static functions are all prefixed with "calls_application" which I'd prefer to drop. Please see https://source.puri.sm/Librem5/libhandy/blob/master/HACKING.md#static-functions . Calls takes its style cues from libhandy.

      I haven't been as watchful with other merge requests so there are files containing static functions whose names are prefixed. I'd like to ensure the situation doesn't get any worse.

      Edited by Bob Ham
    • changed this line in version 7 of the diff

    • Author Contributor

      I use GNU global for code navigation. When I ask it to list the methods named finalize it will show me many matches. While calls_application_finalize will be present only once, and my editor visits the file and puts the cursor there (Well, it's a bug with GNU global to not distinguish static functions).

      Also, I'm used to gtk+ and glib conventions. That was why I did so. Anyway, I have changed it.

    • To be fair libhandy does it a bit differently: For finalize, dispose, constructed it uses

      <object_name>_{constructed,finalize,dispose}()

      while for other static methods that are actually called form within the same fie it drops the prefix. While this is a bit harder to grasp it makes static method calls short (and usually unique) while things like those function pointers above are never called directly but only assigned once within class_init(). It also makes these consistent with <object_name>_init().

      I'm bad at phrasing these things in english so I'm happy to take a patch:

      libhandy#53 (closed)

    • Please register or sign in to reply
  • Bob Ham
  • Mohammed Sadiq added 1 commit

    added 1 commit

    Compare with previous version

  • Mohammed Sadiq resolved all discussions

    resolved all discussions

  • Bob Ham mentioned in commit 21d45ec9

    mentioned in commit 21d45ec9

  • merged

  • Contributor

    Merged, thanks! :-)

  • Please register or sign in to reply
    Loading