[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdegames/kmines
From: Nicolas Roffet <nicolas-kde () roffet ! com>
Date: 2008-04-03 20:05:55
Message-ID: 1207253155.575411.1735.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 793385 by roffet:
OK, to avoid inconsistent states, if the number of mines is too high, let's force it \
too be the maximum allowed. So, we don't need the "error" message anymore. (Next step \
would be to improve the widget in the setting dialogue to forbid the user to put too \
many mines on the field...)
CCMAIL:piacentini@kde.org
CCMAIL:dimsuz@gmail.com
M +1 -1 minefielditem.cpp
M +0 -7 scene.cpp
--- trunk/KDE/kdegames/kmines/minefielditem.cpp #793384:793385
@@ -32,7 +32,7 @@
void MineFieldItem::initField( int numRows, int numCols, int numMines )
{
- Q_ASSERT( numMines + MINIMAL_FREE <= numRows*numCols );
+ numMines = qMin(numMines, numRows*numCols - MINIMAL_FREE );
m_firstClick = true;
m_gameOver = false;
--- trunk/KDE/kdegames/kmines/scene.cpp #793384:793385
@@ -71,13 +71,6 @@
void KMinesScene::startNewGame(int rows, int cols, int numMines)
{
- if(numMines + MineFieldItem::MINIMAL_FREE > rows*cols)
- {
- m_messageItem->showMessage(i18n("Custom game can not be started.<br />Number \
of mines is too big for current field."), \
KGamePopupItem::BottomLeft);
- return;
- }
- if(m_messageItem->isVisible())
- m_messageItem->forceHide(KGamePopupItem::AnimatedHide);
m_fieldItem->initField(rows, cols, numMines);
// reposition items
resizeScene((int)sceneRect().width(), (int)sceneRect().height());
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic