Bug 160419 - [PATCH] Bovo doesn't draw placed marks, plus a bunch of cleanup
Summary: [PATCH] Bovo doesn't draw placed marks, plus a bunch of cleanup
Status: RESOLVED FIXED
Alias: None
Product: bovo
Classification: Applications
Component: general (show other bugs)
Version: 0.6
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Aron Boström
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-05 18:47 UTC by David Benjamin
Modified: 2008-08-28 11:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the patch (10.59 KB, patch)
2008-04-05 18:47 UTC, David Benjamin
Details
remove a few more demandRepaints (11.33 KB, patch)
2008-04-06 19:09 UTC, David Benjamin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Benjamin 2008-04-05 18:47:14 UTC
Version:           0.6 (using Devel)
Installed from:    Compiled sources
OS:                Linux

In SVN trunk, bovo doesn't draw entries in the grid when they're placed... this makes it somewhat difficult to win the game, and so I have around 16 losses to 1 win. Such a statistic may upset users.

Attached below is a patch that fixes this. It also does some cleanup, and is one big thing because SVN hates me. I can try to split it up if you like. It...

1. makes Mark and HintItem use QGraphicsItem's boundingRect, pos, etc. This allows Qt to optimize their redraw, and makes their position not so confusing. (This fixes the bug.)
2. Renames Mark::x() and y() to row() and col(), respectively, to avoid confusion with QGraphicsItem::x() and y(). (The functions are not virtual, so reimplementing them didn't do anything special anyway.
3. Removes Scene::resizeScene and makes the view resize how it's looking at the scene. This is less complicated, and presumably allows Qt to handle things more intelligently. I set m_curCellSize to 10, since it needed some value. I'm not sure if that was the "correct" way to do it.
4. Changes a few iterator magics to foreach loops
5. Changes some of the Scene::demandRepaint()s to QGraphicsItem::update() and adds a bit of bounds checking to Scene::drawForeground(). I'll try to remove more later.
6. Exposes some cell-size methods in Scene to decrease some duplicated code. I'll see if I can refactor some more later. Particularly, HintItem should probably be a subclass of Mark or something...
Comment 1 David Benjamin 2008-04-05 18:47:41 UTC
Created attachment 24203 [details]
the patch
Comment 2 David Benjamin 2008-04-06 19:09:10 UTC
Created attachment 24247 [details]
remove a few more demandRepaints

A lot of the repaint demands become unnecessary with the QGraphicsItem usage,
so I went ahead and removed them altogether.
Comment 3 Patrick ALLAERT 2008-05-18 15:13:22 UTC
I confirm having the bug where markers are not displayed under: Windows and Kubuntu 8.04 (Hardy).

Markers are well displayed under my Gentoo box.
Comment 4 Muktabh 2008-07-29 17:41:59 UTC
I don't see any marker when I click on the board. This makes the game unplayable. Not fixed in 4.1.00 release in opensuse packages. 
Comment 5 mbc111 2008-07-31 03:10:20 UTC
Same problem here in kubuntu hardy with Kde 4.1
Comment 6 Kevin Kofler 2008-08-08 02:51:06 UTC
Confirming, see https://bugzilla.redhat.com/show_bug.cgi?id=457944
Ping? Any news from the maintainer? If this is not committed soon, I will commit it so this gets fixed in 4.1.1, unless the maintainer can explain what's wrong with the patch.
Comment 7 Thomas Kamps 2008-08-26 10:13:39 UTC
Same problem for me under openSuse 11.0 using  KDE 4.1.1 (KDE 4.1.0 (4.1 >= 20080722)) "release 26.5" and Bovo 0.6
Comment 8 Kevin Kofler 2008-08-28 01:35:23 UTC
Given the lack of objections and the fact that 4.1.1 is scheduled to be tagged in mere minutes, I'm committing this now.
Comment 9 Kevin Kofler 2008-08-28 11:14:41 UTC
Fixed in revision 853590 for trunk and 853591 for 4.1 (looks like BUG and CCBUG aren't working anymore with the new Bugzilla).