After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789696 - Modernize code
Modernize code
Status: RESOLVED OBSOLETE
Product: bijiben
Classification: Applications
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Bijiben maintainer(s)
Bijiben maintainer(s)
Depends on: 792221
Blocks:
 
 
Reported: 2017-10-31 10:00 UTC by Mohammed Sadiq
Modified: 2018-05-04 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
color-button: Port to G_DECLARE_FINAL_TYPE (7.17 KB, patch)
2017-11-02 06:23 UTC, Mohammed Sadiq
committed Details | Review
load-more-button: Port to G_DECLARE_FINAL_TYPE (9.29 KB, patch)
2017-11-02 15:58 UTC, Mohammed Sadiq
committed Details | Review
load-more-button: Don't override dispose handler (1.45 KB, patch)
2017-11-02 15:58 UTC, Mohammed Sadiq
committed Details | Review
settings: Port to G_DECLARE_FINAL_TYPE (6.63 KB, patch)
2017-11-05 13:19 UTC, Mohammed Sadiq
committed Details | Review
controller: Port to G_DECLARE_FINAL_TYPE (22.98 KB, patch)
2017-11-05 13:19 UTC, Mohammed Sadiq
committed Details | Review
editor-toolbar: Remove unused variables (2.37 KB, patch)
2017-11-05 13:37 UTC, Mohammed Sadiq
committed Details | Review
import-dialog: Avoid setting application manually (4.21 KB, patch)
2017-11-06 09:06 UTC, Mohammed Sadiq
committed Details | Review
main-toolbar: Port to G_DECLARE_FINAL_TYPE (44.80 KB, patch)
2017-11-06 09:35 UTC, Mohammed Sadiq
committed Details | Review
import-dialog: Port to G_DECLARE_FINAL_TYPE (12.48 KB, patch)
2017-11-07 01:56 UTC, Mohammed Sadiq
committed Details | Review
main-view: Port to G_DECLARE_FINAL_TYPE (20.54 KB, patch)
2017-11-07 01:56 UTC, Mohammed Sadiq
committed Details | Review
note-view: Port to G_DECLARE_FINAL_TYPE (11.23 KB, patch)
2017-11-07 01:56 UTC, Mohammed Sadiq
committed Details | Review
organize-dialog: Port to G_DECLARE_FINAL_TYPE (13.45 KB, patch)
2017-11-07 01:56 UTC, Mohammed Sadiq
committed Details | Review
selection-toolbar: Port to G_DECLARE_FINAL_TYPE (19.30 KB, patch)
2017-11-07 01:57 UTC, Mohammed Sadiq
committed Details | Review
window-base: Port to G_DECLARE_FINAL_TYPE (21.74 KB, patch)
2017-11-07 02:14 UTC, Mohammed Sadiq
committed Details | Review
biji-item: Port to G_DECLARE_DERIVABLE_TYPE (5.25 KB, patch)
2017-11-07 05:26 UTC, Mohammed Sadiq
none Details | Review
notebook: port to G_DECLARE_FINAL_TYPE (11.01 KB, patch)
2017-11-07 07:29 UTC, Mohammed Sadiq
committed Details | Review
biji-item: Port to G_DECLARE_DERIVABLE_TYPE (5.46 KB, patch)
2017-11-08 04:37 UTC, Mohammed Sadiq
committed Details | Review
import-dialog: Use symbolic icons (5.24 KB, patch)
2017-11-14 07:30 UTC, Mohammed Sadiq
committed Details | Review
info-set: Don't manually reset struct members (1.05 KB, patch)
2017-11-14 13:49 UTC, Mohammed Sadiq
committed Details | Review
tomboy-reader: port to G_DECLARE_FINAL_TYPE (14.40 KB, patch)
2017-11-15 04:35 UTC, Mohammed Sadiq
committed Details | Review
note-id: Port to G_DECLARE_FINAL_TYPE (8.27 KB, patch)
2017-11-17 02:40 UTC, Mohammed Sadiq
committed Details | Review
manager: Port to G_DECLARE_FINAL_TYPE (15.49 KB, patch)
2017-11-19 14:06 UTC, Mohammed Sadiq
committed Details | Review
lazy-deserializer: Port to G_DECLARE_FINAL_TYPE (16.58 KB, patch)
2017-11-19 14:06 UTC, Mohammed Sadiq
committed Details | Review
lazy-serializer: Port to G_DECLARE_FINAL_TYPE (11.20 KB, patch)
2017-11-19 14:07 UTC, Mohammed Sadiq
committed Details | Review
note-obj: Port to G_DECLARE_DERIVABLE_TYPE (24.02 KB, patch)
2017-11-19 14:07 UTC, Mohammed Sadiq
committed Details | Review
controller: Fixed missing cast (994 bytes, patch)
2017-11-22 01:03 UTC, Isaque Galdino
rejected Details | Review
controller: Fixed missing cast (994 bytes, patch)
2017-11-22 01:07 UTC, Isaque Galdino
committed Details | Review
settings-dialog: Don't override getter and setter (1.92 KB, patch)
2017-11-24 09:17 UTC, Mohammed Sadiq
committed Details | Review
organize-dialog: Remove dead code (770 bytes, patch)
2017-11-24 12:12 UTC, Mohammed Sadiq
committed Details | Review
search-toolbar: Remove unused headers (715 bytes, patch)
2017-11-25 06:17 UTC, Mohammed Sadiq
committed Details | Review
provider: Port to G_DECLARE_DERIVABLE_TYPE (4.97 KB, patch)
2017-11-26 06:36 UTC, Mohammed Sadiq
committed Details | Review
local-provider: Port to G_DECLARE_FINAL_TYPE (10.67 KB, patch)
2017-11-26 06:36 UTC, Mohammed Sadiq
committed Details | Review
memo-provider: Port to G_DECLARE_FINAL_TYPE (12.91 KB, patch)
2017-11-26 06:36 UTC, Mohammed Sadiq
committed Details | Review
window-base: Simplify saving/loading window states (7.27 KB, patch)
2017-12-11 06:17 UTC, Mohammed Sadiq
committed Details | Review
main-toolbar: Don't handle window drag (1.49 KB, patch)
2017-12-13 04:46 UTC, Mohammed Sadiq
committed Details | Review
editor-toolbar: Remove private struct (11.81 KB, patch)
2017-12-18 08:23 UTC, Mohammed Sadiq
committed Details | Review
own-cloud-provider: Port to G_DECLARE_FINAL_TYPE (17.78 KB, patch)
2018-01-14 18:35 UTC, Isaque Galdino
none Details | Review
own-cloud-note: Port to G_DECLARE_FINAL_TYPE (9.87 KB, patch)
2018-01-14 18:37 UTC, Isaque Galdino
none Details | Review
own-cloud-provider: Port to G_DECLARE_FINAL_TYPE (17.73 KB, patch)
2018-01-15 19:42 UTC, Isaque Galdino
committed Details | Review
own-cloud-note: Port to G_DECLARE_FINAL_TYPE (9.87 KB, patch)
2018-01-15 19:48 UTC, Isaque Galdino
none Details | Review
own-cloud-note: Port to G_DECLARE_FINAL_TYPE (9.82 KB, patch)
2018-01-16 13:30 UTC, Isaque Galdino
committed Details | Review

Description Mohammed Sadiq 2017-10-31 10:00:31 UTC
The codebase of bijiben is pretty old. Let it be simplified by
1. Use G_DECLARE_*TYPE
2. Use private members only for Derivable classes
3. Don't initialize class instances with 0/NULL manually, as they are default.
4. Use GtkBuilder templates for UI
5. ...

The wip work is in the branch https://git.gnome.org/browse/bijiben/log/?h=wip/sadiq/modernize

Thanks
Comment 1 Isaque Galdino 2017-11-01 01:43:51 UTC
OK, here are a few comments so far:

1. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=b9d29ae75f1597b81061b76f780d1112df57cd33

1a. instead of "bjb-bijiben:..." in the commit title, please use "application:...";
 
1b. there are some files (bjb-controller.c, bjb-empty-results-box.c and bjb-import-dialog.c) that you just removed the #include "bjb-bijiben.h" header file, so I think you should keep that in another commit, to not mix it up with those that actually started to use the new bjb-application.h file;

2. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=486e40bf70eab58ee0e4d1ef6467c4ade53660d1

2a. I'd like to see a separated section for /org/gnome/bijiben/gtk, so we could keep only menus.ui there (bjb.gresource.xml);

2b. any reason for not using compressed="true" and preprocess="xml-stripblanks" properties?

3. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=66c1a8f95241b159600c24d029de5cd5d2e04cdd

OK

4. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=f7f2a8541de4f1d3706f0673634de3f2046fd0e9

OK

5. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=754314c91f73b370b7e8e91e7130eb5de8ecdc60

OK

6. https://git.gnome.org/browse/bijiben/commit/?h=wip/sadiq/modernize&id=9b03957dcbb3c0256af2658b3a9b9ab52cb9b92b

6a. please explain why we should avoid gd_tagged_entry in the commit message;

Also, it would be nice if the commit message were more verbose and follow the standard lengths (https://wiki.gnome.org/Newcomers/SubmitPatch). Please add a few lines explaining this is an initiative to clean up the code and keeping it maintainable.

As you can see, these are just small changes I would like to see, mainly for documentation purposes.

Once that is done I can push it to master (BTW, there were new translations, so you need to update your branch again :( )
Comment 2 Mohammed Sadiq 2017-11-01 10:49:46 UTC
(In reply to Isaque Galdino from comment #1)
> OK, here are a few comments so far:

> 2b. any reason for not using compressed="true" and
> preprocess="xml-stripblanks" properties?
> 
  No, I shall do that in some following commit.

> Once that is done I can push it to master (BTW, there were new translations,
> so you need to update your branch again :( )

There is a conflict with master. The last unicode change commit[0] might have to be reverted.


[0] https://git.gnome.org/browse/bijiben/commit/?id=bf3c4c3bb382f23e6263fb57d0d7350894cf9901
Comment 3 Piotr Drąg 2017-11-01 20:21:20 UTC
(In reply to Mohammed Sadiq from comment #2)
> There is a conflict with master. The last unicode change commit[0] might
> have to be reverted.
> 

Any reason why the branch can’t be rebased and the conflict resolved?
Comment 4 Mohammed Sadiq 2017-11-02 01:21:58 UTC
(In reply to Piotr Drąg from comment #3)
> (In reply to Mohammed Sadiq from comment #2)
> > There is a conflict with master. The last unicode change commit[0] might
> > have to be reverted.
> > 
> 
> Any reason why the branch can’t be rebased and the conflict resolved?

Not much of an issue. Since the commit was smaller, I hoped reverting that would be an easier solution. Anyway, the conflict has been resolved.
Comment 5 Mohammed Sadiq 2017-11-02 06:23:03 UTC
Created attachment 362793 [details] [review]
color-button: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference
* Also, to be consistant with gnome coding standards, use
  'self' as identifier name when referencing self.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 6 Mohammed Sadiq 2017-11-02 15:58:17 UTC
Created attachment 362842 [details] [review]
load-more-button: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 7 Mohammed Sadiq 2017-11-02 15:58:41 UTC
Created attachment 362843 [details] [review]
load-more-button: Don't override dispose handler

Nothing was done in the overridden dispose handler,
So just avoid it.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 8 Mohammed Sadiq 2017-11-05 13:19:31 UTC
Created attachment 363011 [details] [review]
settings: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 9 Mohammed Sadiq 2017-11-05 13:19:43 UTC
Created attachment 363012 [details] [review]
controller: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 10 Mohammed Sadiq 2017-11-05 13:37:52 UTC
Created attachment 363013 [details] [review]
editor-toolbar: Remove unused variables

Many widget ids from templates are set, but never used.
Let it be removed. We can re-introduce them in case we
use them some day

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 11 Mohammed Sadiq 2017-11-06 09:06:22 UTC
Created attachment 363037 [details] [review]
import-dialog: Avoid setting application manually

There is no need of passing and storing the default application
details. They can be abtained with g_application_get_default().

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 12 Mohammed Sadiq 2017-11-06 09:35:07 UTC
Created attachment 363039 [details] [review]
main-toolbar: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 13 Isaque Galdino 2017-11-06 13:50:16 UTC
Review of attachment 362793 [details] [review]:

It looks good.
Comment 14 Isaque Galdino 2017-11-06 13:53:49 UTC
Review of attachment 362842 [details] [review]:

Good.
Comment 15 Isaque Galdino 2017-11-06 13:54:37 UTC
Review of attachment 362843 [details] [review]:

Good.
Comment 16 Isaque Galdino 2017-11-06 13:57:12 UTC
Review of attachment 363011 [details] [review]:

In other patches you changed whatever object name as self in class methods, so I was expecting you to do the same here.
For the patch itself it's good, but it would be nice if you have done that change as well. Or you can create a new one with those changes, whatever suites you better.
Comment 17 Isaque Galdino 2017-11-06 14:01:54 UTC
Review of attachment 363012 [details] [review]:

Good.
Comment 18 Isaque Galdino 2017-11-06 14:04:27 UTC
Review of attachment 363037 [details] [review]:

Nice one, very good, thanks!
Comment 19 Isaque Galdino 2017-11-06 14:35:46 UTC
Review of attachment 363039 [details] [review]:

Good.
Comment 20 Isaque Galdino 2017-11-06 14:47:19 UTC
Review of attachment 363013 [details] [review]:

Good.
Comment 21 Mohammed Sadiq 2017-11-07 00:02:52 UTC
Comment on attachment 363011 [details] [review]
settings: Port to G_DECLARE_FINAL_TYPE

Committed with suggested changes
Comment 22 Mohammed Sadiq 2017-11-07 00:04:06 UTC
All patches commmitted. Thanks for the review.
Comment 23 Mohammed Sadiq 2017-11-07 01:56:19 UTC
Created attachment 363111 [details] [review]
import-dialog: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 24 Mohammed Sadiq 2017-11-07 01:56:31 UTC
Created attachment 363112 [details] [review]
main-view: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 25 Mohammed Sadiq 2017-11-07 01:56:41 UTC
Created attachment 363113 [details] [review]
note-view: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 26 Mohammed Sadiq 2017-11-07 01:56:51 UTC
Created attachment 363114 [details] [review]
organize-dialog: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 27 Mohammed Sadiq 2017-11-07 01:57:02 UTC
Created attachment 363115 [details] [review]
selection-toolbar: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 28 Mohammed Sadiq 2017-11-07 02:14:20 UTC
Created attachment 363118 [details] [review]
window-base: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 29 Mohammed Sadiq 2017-11-07 05:26:45 UTC
Created attachment 363127 [details] [review]
biji-item: Port to G_DECLARE_DERIVABLE_TYPE

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 30 Mohammed Sadiq 2017-11-07 07:29:31 UTC
Created attachment 363130 [details] [review]
notebook: port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.
* Adapt main-view and controller accordingly

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 31 Isaque Galdino 2017-11-07 23:20:02 UTC
Review of attachment 363111 [details] [review]:

Good.
Comment 32 Isaque Galdino 2017-11-07 23:24:24 UTC
Review of attachment 363112 [details] [review]:

Good.
Comment 33 Isaque Galdino 2017-11-07 23:26:58 UTC
Review of attachment 363113 [details] [review]:

Good.
Comment 34 Isaque Galdino 2017-11-07 23:35:24 UTC
Review of attachment 363114 [details] [review]:

Good.
Comment 35 Isaque Galdino 2017-11-07 23:38:32 UTC
Review of attachment 363115 [details] [review]:

Good.
Comment 36 Isaque Galdino 2017-11-07 23:42:10 UTC
Review of attachment 363118 [details] [review]:

Good.
Comment 37 Isaque Galdino 2017-11-07 23:45:57 UTC
Review of attachment 363127 [details] [review]:

Thanks for your patch. Would you please explain a little bit more what does your patch did? Thanks.
Comment 38 Isaque Galdino 2017-11-07 23:47:56 UTC
Review of attachment 363130 [details] [review]:

Good.
Comment 39 Mohammed Sadiq 2017-11-08 04:37:00 UTC
Created attachment 363188 [details] [review]
biji-item: Port to G_DECLARE_DERIVABLE_TYPE

* Use G_DECLARE_DERIVABLE_TYPE to avoid boilerplate code
* Adapt private member identifier names to suite with
  G_DECLARE_DERIVABLE_TYPE signature
* Adapt bjb-controller to avoid warnings with non-const
  variables

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 40 Isaque Galdino 2017-11-09 23:41:12 UTC
Review of attachment 363188 [details] [review]:

Thanks for your patch. It fixed compilation in my box, so it's a winner. Please push it ASAP.
Comment 41 Isaque Galdino 2017-11-09 23:41:13 UTC
Review of attachment 363188 [details] [review]:

Thanks for your patch. It fixed compilation in my box, so it's a winner. Please push it ASAP.
Comment 42 Mohammed Sadiq 2017-11-10 03:41:52 UTC
Comment on attachment 363188 [details] [review]
biji-item: Port to G_DECLARE_DERIVABLE_TYPE

Thanks for the review. Pushed to master
Comment 43 Mohammed Sadiq 2017-11-14 07:30:07 UTC
Created attachment 363556 [details] [review]
import-dialog: Use symbolic icons

Using symbolic icons will improve the UI, and help us remove
some old code that was looking for the application icons manually.

Let us not care whether those application is actually installed,
but only check if their data directory is present. Which means
that even the application (Gnote/Tomboy) got uninstalled, their
notes can be imported in Bijiben.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 44 Mohammed Sadiq 2017-11-14 13:49:56 UTC
Created attachment 363585 [details] [review]
info-set: Don't manually reset struct members

g_slice_new0() sets allocated memory to 0. It is thus redundant
to set them again to 0.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 45 Mohammed Sadiq 2017-11-15 04:35:40 UTC
Created attachment 363653 [details] [review]
tomboy-reader: port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 46 Mohammed Sadiq 2017-11-17 02:40:30 UTC
Created attachment 363875 [details] [review]
note-id: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.
* Don't intialize members explicitly with NULL/0.
  Because all members are initialized with NULL/0 by default.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 47 Isaque Galdino 2017-11-17 20:01:55 UTC
Review of attachment 363556 [details] [review]:

Hi Sadiq, thanks for your patch. Although I understand this is related to our effort to modernize code, I rather would related it to a new bug fix, just for import-dialog, because this looks like more of a feature change than a code clean up.

I'll approve it anyway, but for other stuff that sound like changing behaviour or feature, please open an specific bug, so we can track it a little better.
Comment 48 Isaque Galdino 2017-11-17 20:02:54 UTC
Review of attachment 363585 [details] [review]:

Good.
Comment 49 Isaque Galdino 2017-11-17 20:05:55 UTC
Review of attachment 363653 [details] [review]:

Good.
Comment 50 Isaque Galdino 2017-11-17 20:07:28 UTC
Review of attachment 363875 [details] [review]:

Good.
Comment 51 Mohammed Sadiq 2017-11-18 03:30:37 UTC
Comment on attachment 363556 [details] [review]
import-dialog: Use symbolic icons

Thanks for the review. I shall file new bugs for such changes next time onwards.
Comment 52 Mohammed Sadiq 2017-11-19 14:06:41 UTC
Created attachment 364003 [details] [review]
manager: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 53 Mohammed Sadiq 2017-11-19 14:06:52 UTC
Created attachment 364004 [details] [review]
lazy-deserializer: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 54 Mohammed Sadiq 2017-11-19 14:07:03 UTC
Created attachment 364005 [details] [review]
lazy-serializer: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 55 Mohammed Sadiq 2017-11-19 14:07:21 UTC
Created attachment 364006 [details] [review]
note-obj: Port to G_DECLARE_DERIVABLE_TYPE

* Use G_DECLARE_DERIVABLE_TYPE to avoid boilerplate code
* Adapt private member identifier names to suite with
  G_DECLARE_DERIVABLE_TYPE signature

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 56 Isaque Galdino 2017-11-20 23:15:20 UTC
Review of attachment 364003 [details] [review]:

In this patch you only commented out BIJI_MANAGER_PRIVATE define instead of removing it. Please take a look:

@@ -77,7 +79,7 @@ static GParamSpec *properties[BIJI_MANAGER_PROPERTIES] = { NULL, };
 static void biji_manager_initable_iface_init (GInitableIface *iface);
 static void biji_manager_async_initable_iface_init (GAsyncInitableIface *iface);
 
-#define BIJI_MANAGER_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), BIJI_TYPE_MANAGER, BijiManagerPrivate))
+/* #define BIJI_MANAGER_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), BIJI_TYPE_MANAGER, BijiManagerPrivate)) */
Comment 57 Isaque Galdino 2017-11-20 23:20:10 UTC
Review of attachment 364004 [details] [review]:

Good.
Comment 58 Isaque Galdino 2017-11-20 23:22:59 UTC
Review of attachment 364005 [details] [review]:

Good.
Comment 59 Isaque Galdino 2017-11-20 23:30:30 UTC
Review of attachment 364006 [details] [review]:

Good.
Comment 60 Mohammed Sadiq 2017-11-21 05:24:11 UTC
Comment on attachment 364003 [details] [review]
manager: Port to G_DECLARE_FINAL_TYPE

Thanks for the review. Pushed with changes.
Comment 61 Isaque Galdino 2017-11-22 01:03:02 UTC
Created attachment 364157 [details] [review]
controller: Fixed missing cast

In commit 63f883710b91fbe8db3fd51fd48370f1e06cb2fe, it was added a
regression. Build was failing due to a missing cast in
most_recent_item_first method of BjbController object.

This patch adds the missing cast, so the code can be build again.
Comment 62 Isaque Galdino 2017-11-22 01:07:39 UTC
Created attachment 364158 [details] [review]
controller: Fixed missing cast

In commit 63f883710b91fbe8db3fd51fd48370f1e06cb2fe, it was added a
regression. Build was failing due to a missing cast in
most_recent_item_first method of BjbController object.

This patch adds the missing cast, so the code can be build again.
Comment 63 Isaque Galdino 2017-11-22 01:11:29 UTC
Review of attachment 364157 [details] [review]:

This commit was duplicated here!
Comment 64 Isaque Galdino 2017-11-22 01:13:13 UTC
Review of attachment 364158 [details] [review]:

Pushed to master.
Comment 65 Isaque Galdino 2017-11-22 01:15:37 UTC
Review of attachment 364158 [details] [review]:

Pushed to master.
Comment 66 Isaque Galdino 2017-11-22 01:15:48 UTC
Review of attachment 364158 [details] [review]:

Pushed to master.
Comment 67 Isaque Galdino 2017-11-22 01:16:58 UTC
Review of attachment 364158 [details] [review]:

Pushed to master.
Comment 68 Mohammed Sadiq 2017-11-24 09:17:42 UTC
Created attachment 364310 [details] [review]
settings-dialog: Don't override getter and setter

The overridden function didn't do anything useful. So better
not override.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 69 Mohammed Sadiq 2017-11-24 12:12:03 UTC
Created attachment 364318 [details] [review]
organize-dialog: Remove dead code
Comment 70 Mohammed Sadiq 2017-11-25 06:17:16 UTC
Created attachment 364375 [details] [review]
search-toolbar: Remove unused headers
Comment 71 Mohammed Sadiq 2017-11-26 06:36:34 UTC
Created attachment 364410 [details] [review]
provider: Port to G_DECLARE_DERIVABLE_TYPE

* Use G_DECLARE_DERIVABLE_TYPE to avoid boilerplate code
* Adapt private member identifier names to suite with
  G_DECLARE_DERIVABLE_TYPE signature

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 72 Mohammed Sadiq 2017-11-26 06:36:47 UTC
Created attachment 364411 [details] [review]
local-provider: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 73 Mohammed Sadiq 2017-11-26 06:36:58 UTC
Created attachment 364412 [details] [review]
memo-provider: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 74 Isaque Galdino 2017-12-01 11:27:34 UTC
Review of attachment 364310 [details] [review]:

Good.
Comment 75 Isaque Galdino 2017-12-01 11:28:02 UTC
Review of attachment 364318 [details] [review]:

Good.
Comment 76 Isaque Galdino 2017-12-01 11:28:34 UTC
Review of attachment 364375 [details] [review]:

Good.
Comment 77 Isaque Galdino 2017-12-01 11:29:09 UTC
Review of attachment 364318 [details] [review]:

Good.
Comment 78 Isaque Galdino 2017-12-01 11:29:36 UTC
Review of attachment 364410 [details] [review]:

Good.
Comment 79 Isaque Galdino 2017-12-01 11:32:10 UTC
Review of attachment 364411 [details] [review]:

Good.
Comment 80 Isaque Galdino 2017-12-01 11:32:53 UTC
Review of attachment 364412 [details] [review]:

Good.
Comment 81 Isaque Galdino 2017-12-01 11:33:08 UTC
Review of attachment 364410 [details] [review]:

Good.
Comment 82 Mohammed Sadiq 2017-12-01 11:54:53 UTC
Thanks for the review, pushed to master.

Attachment 364310 [details] pushed as 0e3c6c9 - settings-dialog: Don't override getter and setter
Attachment 364318 [details] pushed as 6b79c04 - organize-dialog: Remove dead code
Attachment 364375 [details] pushed as e5ecec7 - search-toolbar: Remove unused headers
Attachment 364410 [details] pushed as 7aa5f24 - provider: Port to G_DECLARE_DERIVABLE_TYPE
Attachment 364411 [details] pushed as 7254ce2 - local-provider: Port to G_DECLARE_FINAL_TYPE
Attachment 364412 [details] pushed as dd325ce - memo-provider: Port to G_DECLARE_FINAL_TYPE
Comment 83 Mohammed Sadiq 2017-12-11 06:17:33 UTC
Created attachment 365347 [details] [review]
window-base: Simplify saving/loading window states

Follow https://wiki.gnome.org/HowDoI/SaveWindowState

* Use tuples in gsetting schema to save size and position.
* Save changes to variable instead of saving to gsettings after every
  timemout.
* Save the changes back to gsettings when the window is destroyed.
Comment 84 Mohammed Sadiq 2017-12-13 04:46:03 UTC
Created attachment 365470 [details] [review]
main-toolbar: Don't handle window drag

Dragging window by clicking GtkHeaderBar is done by default.
Don't redo it.
Comment 85 Mohammed Sadiq 2017-12-18 08:23:33 UTC
Created attachment 365672 [details] [review]
editor-toolbar: Remove private struct

* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more
maintainable.
Comment 86 Isaque Galdino 2017-12-19 13:49:42 UTC
Review of attachment 365347 [details] [review]:

Good.
Comment 87 Isaque Galdino 2017-12-19 13:55:42 UTC
Review of attachment 365470 [details] [review]:

Good, thx.
Comment 88 Isaque Galdino 2017-12-19 14:03:35 UTC
Review of attachment 365672 [details] [review]:

Good.
Comment 89 Isaque Galdino 2018-01-14 18:35:01 UTC
Created attachment 366796 [details] [review]
own-cloud-provider: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more maintainable.
Comment 90 Isaque Galdino 2018-01-14 18:37:35 UTC
Created attachment 366797 [details] [review]
own-cloud-note: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more maintainable.
Comment 91 Mohammed Sadiq 2018-01-15 00:33:26 UTC
Review of attachment 366796 [details] [review]:

lgtm. Push to master after the suggested change

::: src/libbiji/provider/biji-own-cloud-provider.c
@@ +836,3 @@
+  self->queue = g_queue_new ();
+  self->path = NULL;
+  self->folder = NULL;

Instance struct members are 0/NULL initialized by default. So the two lines can be removed.
Comment 92 Mohammed Sadiq 2018-01-15 00:42:23 UTC
Review of attachment 366797 [details] [review]:

lgtm. Push to master after the suggested changes

::: src/libbiji/provider/biji-own-cloud-note.c
@@ -321,3 +320,3 @@
-  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, BIJI_TYPE_OWN_CLOUD_NOTE, BijiOwnCloudNotePrivate);
-  self->priv->cancellable = g_cancellable_new ();
-  self->priv->id = NULL;
+  self->cancellable = g_cancellable_new ();
+  self->id = NULL;
+  self->needs_save = FALSE;

Same as above (remove id and needs_save line)
Comment 93 Isaque Galdino 2018-01-15 19:42:00 UTC
Created attachment 366858 [details] [review]
own-cloud-provider: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more maintainable.
Comment 94 Isaque Galdino 2018-01-15 19:48:23 UTC
Created attachment 366860 [details] [review]
own-cloud-note: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more maintainable.
Comment 95 Mohammed Sadiq 2018-01-16 01:07:39 UTC
Review of attachment 366858 [details] [review]:

lgtm. Please push to master. Thanks
Comment 96 Mohammed Sadiq 2018-01-16 01:07:41 UTC
Review of attachment 366858 [details] [review]:

lgtm. Please push to master. Thanks
Comment 97 Mohammed Sadiq 2018-01-16 01:07:44 UTC
Review of attachment 366858 [details] [review]:

lgtm. Please push to master. Thanks
Comment 98 Mohammed Sadiq 2018-01-16 01:09:10 UTC
Review of attachment 366860 [details] [review]:

Please update the patch and push to master. Thanks

::: src/libbiji/provider/biji-own-cloud-note.c
@@ -321,3 +320,3 @@
-  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, BIJI_TYPE_OWN_CLOUD_NOTE, BijiOwnCloudNotePrivate);
-  self->priv->cancellable = g_cancellable_new ();
-  self->priv->id = NULL;
+  self->cancellable = g_cancellable_new ();
+  self->id = NULL;
+  self->needs_save = FALSE;

Did you forget to make the change?
Comment 99 Isaque Galdino 2018-01-16 13:30:34 UTC
Created attachment 366882 [details] [review]
own-cloud-note: Port to G_DECLARE_FINAL_TYPE

* Use G_DECLARE_FINAL_TYPE to avoid boilerplate code
* Don't use private members.
  This class isn't derivable. So there isn't any difference.

This is a part of effort to clean up codebase and make the code more maintainable.
Comment 100 Isaque Galdino 2018-01-16 13:31:58 UTC
(In reply to Mohammed Sadiq from comment #98)
> Review of attachment 366860 [details] [review] [review]:
> 
> Please update the patch and push to master. Thanks
> 
> ::: src/libbiji/provider/biji-own-cloud-note.c
> @@ -321,3 +320,3 @@
> -  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, BIJI_TYPE_OWN_CLOUD_NOTE,
> BijiOwnCloudNotePrivate);
> -  self->priv->cancellable = g_cancellable_new ();
> -  self->priv->id = NULL;
> +  self->cancellable = g_cancellable_new ();
> +  self->id = NULL;
> +  self->needs_save = FALSE;
> 
> Did you forget to make the change?

My mistake. Fixed.
Comment 101 Mohammed Sadiq 2018-01-16 14:41:20 UTC
Review of attachment 366882 [details] [review]:

lgtm. push to master
Comment 102 Isaque Galdino 2018-01-16 15:25:29 UTC
Review of attachment 366858 [details] [review]:

Thx.
Comment 103 Isaque Galdino 2018-01-16 15:25:53 UTC
Review of attachment 366882 [details] [review]:

Thx.
Comment 104 GNOME Infrastructure Team 2018-05-04 13:10:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-notes/issues/82.