Add calls-application class
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
Activity
- Resolved by Mohammed Sadiq
mentioned in merge request !18 (merged)
- Resolved by Bob Ham
- Resolved by Mohammed Sadiq
added 3 commits
-
9d3b8df2...340aa85b - 2 commits from branch
Librem5:master
- 4a2e6304 - Add calls-application class
-
9d3b8df2...340aa85b - 2 commits from branch
mentioned in issue #17 (closed)
added 33 commits
-
0041fe18...e04fa0ae - 32 commits from branch
Librem5:master
- 4be9888a - Add calls-application class
-
0041fe18...e04fa0ae - 32 commits from branch
- Resolved by Mohammed Sadiq
- Resolved by Mohammed Sadiq
- src/calls-application.c 0 → 100644
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) 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 Hamchanged this line in version 7 of the diff
I use GNU global for code navigation. When I ask it to list the methods named
finalize
it will show me many matches. Whilecalls_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:
Tried in libhandy!138 (merged)
- Resolved by Mohammed Sadiq
mentioned in commit 21d45ec9
mentioned in issue libhandy#53 (closed)