X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fcurrentalertstablemodel.cpp;fp=src%2Fcurrentalertstablemodel.cpp;h=d0e70c30f35e5a51f51ae9adbed66ddeee535cfa;hb=e3d78d642357c3cbd65564b4784088d548b1ba6a;hp=62e83274c677e1fb10590aab4a252d9113898c6e;hpb=73af518a176ebf08522c7c843bef52d64be82578;p=kitchenalert diff --git a/src/currentalertstablemodel.cpp b/src/currentalertstablemodel.cpp index 62e8327..d0e70c3 100644 --- a/src/currentalertstablemodel.cpp +++ b/src/currentalertstablemodel.cpp @@ -113,15 +113,26 @@ QVariant CurrentAlertsTableModel::data(const QModelIndex &index, int role) const case timeRemainingColumnNumber_: + if (currentTimers_.at(index.row())->isRunning()) //timer running + { + allseconds = currentTimers_.at(index.row())->getRemainingTimeInSeconds(); - if (allseconds < 0) - { - timeAsText = tr("-", "negative sign"); - allseconds = -allseconds; + if (allseconds < 0) + { + timeAsText = tr("-", "negative sign"); + allseconds = -allseconds; + + } + } + + else //timer stopped or never started + { + //use original time + allseconds = currentTimers_.at(index.row())->getOriginalTimeInSeconds(); } hoursOnly.setNum( allseconds/(60*60)); @@ -146,7 +157,10 @@ QVariant CurrentAlertsTableModel::data(const QModelIndex &index, int role) const case statusColumnNumber_: if (currentTimers_.at(index.row())->isAlerting() == true) - return QString("ALERT!"); + return tr("ALERT!"); + + if (!currentTimers_.at(index.row())->isRunning()) + return tr("stopped"); else return QString();