Bug 247610 - Timer resets when F5 is pressed but not on ctl-Z
Summary: Timer resets when F5 is pressed but not on ctl-Z
Status: RESOLVED NOT A BUG
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: 0.8
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Mauricio Piacentini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-13 07:46 UTC by garypark38
Modified: 2018-11-21 22:23 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description garypark38 2010-08-13 07:46:41 UTC
Version:           0.8 (using KDE 4.4.2) 
OS:                Linux

When F5 is pressed the game timer is reset resulting in the fact that the game time does not reflect the total time that has been spent working on the current puzzle. I feel it should not reset the timer to press F5 any more than it does to press ctl-z.

Reproducible: Didn't try

Steps to Reproduce:
Play a few tiles, note the timer, press F5 or in fact just press F5 at any time and note that the timer resets.
Comment 1 Peter Penz 2010-08-19 17:15:10 UTC
*** Bug 245878 has been marked as a duplicate of this bug. ***
Comment 2 Antonis Tsiapaliokas 2010-11-01 20:44:22 UTC
Hello

I have try to reproduce this bug and i have found something that it is not correct.. First of all the F5 button is working like the ctr+R (this is the refresh button). So when someone press the F5 button then the timer is reset but also all the game is reset... And the undo button (ctr+Z) it doesn't designed to undo something which is reset but something which is done... So from this point of view there is no bug... Now as regards the use of the F5 (the refresh action) i think that this is also a bug because the player loses all the game actions... So what do you think... When someone press the F5 should it work like now or we should create a patch, which will disable that action?
Comment 3 garypark38 2010-11-02 05:04:26 UTC
I am sorry Antonis, but I am not sure I understand your point. The normal function of F5 in all KDE games seems to be to restart the game "as if" one had pressed ctl-z until all moves were undone. That function of KMahjongg works fine. My only concern, complaint if you will is that it also resets the game timer which makes the best times list rather meaningless.
Comment 4 Antonis Tsiapaliokas 2010-11-02 06:32:57 UTC
ok. Let's start from the beginning. Let's say that you have done 5 moves and you press the F5 then then game is restarting. But you cannot undo the restart because this is the point of restart. So with the restart of the game (and not able to undo the restart) the time is reset... So what is meaningless?
Comment 5 Christian Krippendorf 2011-11-24 10:06:36 UTC
He wants the same action on restart as on ctrl-z. That means...

If pressing F5 the game should just reset the tiles, not the time. As if you always play the same game with reset timer, you maybe be that fast in future (cause you know all the steps) anyone could get a really good time.

When pressing F5 the time should still go on, but the tiles should reset. I think that is what he wants.

Best Regards
Comment 6 Yogesh Marwaha 2013-02-18 14:43:13 UTC
(In reply to comment #5)
> He wants the same action on restart as on ctrl-z. That means...
> 
> If pressing F5 the game should just reset the tiles, not the time. As if you
> always play the same game with reset timer, you maybe be that fast in future
> (cause you know all the steps) anyone could get a really good time.
> 
> When pressing F5 the time should still go on, but the tiles should reset. I
> think that is what he wants.
> 
> Best Regards
The game also offers an option to start a "New Numbered Game". So, even if the suggestion at op is accepted, one can (i) Note  the game number (ii) Game-> Quit (iii) Run game (iv) Start New Numbered Game.
But what do think, how many steps one can practically remember? And if one is so eager to get a good score, he can record a game and then replay it. Even better, edit the score file itself (really?). What will be the advantage? Scores are not (yet?) uploaded anywhere. He'll end up cheating himself.

IMHO, this should be closed.
Regards
Comment 7 Andrew Crouthamel 2018-11-10 03:10:30 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Andrew Crouthamel 2018-11-20 04:00:21 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 9 garypark38 2018-11-21 17:27:02 UTC
I have been trying to determine what the most recent version of the game is. The most recent I have access to it 0.9. As provided by Fedora 28. The problem persists in that version. F5 or the corresponding menu entry still restarts the timer. 

This is a solitaire game, it therefor seems strange to make in into any sort of a competition. But I still wish to have an accurate accounting of how much of my life I have wasted play this dumb game.

GP
Comment 10 garypark38 2018-11-21 21:53:22 UTC
Unfortunately at this time I cannot build hello world KDE. Neither Fedora 28 nor Mint 18.3 make that at all easy.

But I believe the following will work

 from git-hub lines 565 - 570 of kmahjongg.cpp

void KMahjongg::restartGame()
{
    if (m_gameView->gameGenerated()) {
        m_gameView->createNewGame(m_gameView->getGameNumber());
        m_gameTimer->restart();
        updateState(GameState::Gameplay);
    }
}

should become : 

void KMahjongg::restartGame()
{
    while(m_gameView->undo()); // undo returns false when all undone.
}

// This should make it totally clear what I think the code should do.
Comment 11 Albert Astals Cid 2018-11-21 22:23:15 UTC
I don't see your point.

Restarting the game, restart the game, it is *not* doing undo all the way, since after restarting the game, you can not "redo", all your history is gone.

Any reason you think that restarting means "undoing until the beginning" is something in your head, but it is not what "restart" means.