[Kde-games-devel] KMahjongg archaeology

Ian Wadham iandw.au at gmail.com
Wed Jan 21 10:55:10 UTC 2015


On 21/01/2015, at 2:17 PM, Roney Gomes wrote:
> Good news comrades!
> 
> Today I gave our first step towards porting the QGraphicsView version
> of KMahjongg to Frameworks. I decided to begin by rebasing 'qgraphic'
> to frameworks' current HEAD then proceed solving the inevitable
> conflicts as they arrived.

The plan was to merge master into qgraphic first, and then merge qgraphic
into frameworks when we are happy with it, IIRC.

> The history is now looking as if Christian
> started working after the KF5 porting was done.

Huh?  How can this be? Christian did his work years ago.

> I just fixed the last compilation error and now we have a running
> version of KMahjongg under Frameworks. Still untested as I didn't have
> the time to look for eventual bugs. That's just the first step though,
> we still need to see what Christian left pending and what pieces of
> code are using the old API's.

Yes, we do.

Well I have been reading the QGraphics code, before merging master into
it as originally planned.  And there are a few problems…

A simple one is that part of the game's Editor is still using KGameCanvas
and part is using QGraphicsView.  They seem to co-exist OK, but the problem
should be easy to fix anyway.

More seriously, the factoring of control, scene, view, model and engine
(e.g. puzzle generator) is questionable, IMHO.

The code for the GameView class is very large and contains several things
that really belong in the model and engine (GameData and BoardLayout
classes) and maybe some things that belong in a control class.  Also there
seem to be many things that really belong in the GameScene class, not
the view.

The code itself reads as *correct* for performing the required functions and it
certainly runs correctly so far, though I have not yet done exhaustive testing.

The endlessly repeating redo-undo animation at the end of a won game is
intentional, not a bug, but the current version of the game does it once only.

So I am wondering what is the best thing to do.  We do not have anyone
who can refactor the code at present.  That would be a large job and
might introduce new bugs.  OTOH if it stays as is, maintainability could be
affected.  KMahjongg is a VERY mature product, so I do not see a big need
for maintenance in the future, apart from Jan-Peter Nilsson's bug fixes.  But
perhaps someone will want to port it to QML 2(?).

So I think the best thing would be to merge master into qgraphic as planned,
test and fix the qgraphic branch as it stands (with no re-factoring), introduce
Jan-Peter's fixes and finally merge into the frameworks branch as planned.

I would be happy to continue doing all that over the next few weeks.  Maybe
Roney and I can share this work.

We would be left with a situation where, if anybody wants to port KMahjongg
to QML in the future, then they might have to do some re-factoring first…  But
at least the game would not be using an obsolete graphics library and would
perform much better --- as well as becoming available with KF5.

> However, there's a problem: I cannot submit my work. As rebasing
> rewrites history and I'm not KMahjongg's project manager I cannot
> "push force" my changes nor set up a new branch. So I'm stuck for now,
> what do you suggest?

Let's deal with merging into frameworks down the track a way.

All the best, Ian W.




More information about the kde-games-devel mailing list