Handle kabc deprecated classes in kabc->kcontact porting script
Review Request #125570 - Created Oct. 9, 2015 and submitted
A lot of KABC classes are deprecated in KF5. The porting script only replaces kabc occurences to kcontacts, but overlooks if the class being used still exists in kcontact or not. This leads to a lot of compile time #include<> errors. I feel this should and can be avoided by modifying the script. Was this overlooked on purpose or did we just miss it out ?
I've really no prior knowledge or experience of working with perl and I've tried to handle the above mentioned scenario, by manually checking for deprecated classnames and replacing them with a blank space or commenting them out.
Ran the script on the kopete codebase which uses deprecated classes like addressbook, stdaddressbook, resource etc.
Works fine, but takes a bit of time to execute.
you could use
$giat the end to make the match case-insensitive, thus saving one regexp per each file :)
This will still break build (as expected):
You will still need to port the code, but by removing the class name you just make it harder for yourself to find what the variable actually represented and what has to be done about it.
I would say it's better to keep the deprecated classes references in the code to make porting easier and to avoid unnecessary porting mistakes.
Looks good to me, although this could all be a single perl script instead of a bash script calling perl so many times ;) But that's unrelated to this commit.
Also in its current form, it should be a .sh rather than a .pl ....