jtamate added a comment.

  In D14302#296469 <https://phabricator.kde.org/D14302#296469>, @jtamate wrote:
  
  > I guess this is a Qt bug.
  >
  >   qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
  >   {
  >       qint64 ns = remainingTimeNSecs();
  >       return ns <= 0 ? ns : (ns + 999999) / (1000 * 1000);
  >   }
  >
  >
  > Shouldn't it be:
  >
  >   return ns <= 0 ? **0** : (ns + 999999) / (1000 * 1000);
  >
  
  
  I answer myself. It is ok. If remainingTimeNSecs() return -1 it also returns 
-1 (never expire), and in inremainingTimeNSecs() it can only be -1 or 0 or >0
  
    return raw < 0 ? 0 : raw;
  
  But
  (gdb) print timer.remainingTime()
  $11 = -1
  (gdb) print sleepTime
  $13 = 6400
  
  Therefore isForever() is returning true. Why?

REPOSITORY
  R271 KDBusAddons

REVISION DETAIL
  https://phabricator.kde.org/D14302

To: jtamate, dfaure, #frameworks, thiago
Cc: kde-frameworks-devel, michaelh, ngraham, bruns

Reply via email to