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 681028 - Remove some of the copy/pasted code in miners
Remove some of the copy/pasted code in miners
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-01 23:40 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-08-07 17:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Move some tracker helpers to gd-miner-tracker.c (15.53 KB, patch)
2012-08-01 23:41 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
miner: Reduce copy/pasted code with inheritance (90.85 KB, patch)
2012-08-01 23:41 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-08-01 23:40:59 UTC
Replace it with proper code sharing, which is inheritance.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-08-01 23:41:01 UTC
Created attachment 220108 [details] [review]
Move some tracker helpers to gd-miner-tracker.c

Remove the amount of code duplication here.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-08-01 23:41:04 UTC
Created attachment 220109 [details] [review]
miner: Reduce copy/pasted code with inheritance

A large amount of the code in each miner is copy/pasted. We can do
better than this. Define a base subclass that does most of the work,
and override the parts that are different in each subclass.

While we're at it, deduplicate the miner main start, as well.
Comment 3 Cosimo Cecchi 2012-08-07 17:47:22 UTC
Attachment 220108 [details] pushed as 9482646 - Move some tracker helpers to gd-miner-tracker.c
Attachment 220109 [details] pushed as 32686b5 - miner: Reduce copy/pasted code with inheritance

Thanks a lot Jasper, this cleanup was long overdue and makes the code so much nicer!
Since I wanted to include these in today's release, I pushed them with a couple of fixes to git master.