Пример #1
0
bool tst_Events::cancelEvent(const uint cookie)
{
    Maemo::Timed::Interface timedIface;
    QDBusReply<bool> cancelReply = timedIface.cancel_sync(cookie);
    if (!cancelReply.isValid()) {
        qWarning() << "Failed to cancel event, DBus error:" << timedIface.lastError();
        return false;
    }

    bool retval = cancelReply;
    return retval;
}
Пример #2
0
int cancel_event(unsigned cookie)
{
  Maemo::Timed::Interface iface ;
  if(!iface.isValid())
  {
    qDebug() << "not valid interface:" << iface.lastError() ;
    return 1 ;
  }
  QDBusReply<bool> res = iface.cancel_sync(cookie) ;

  if(!res.isValid())
  {
    qDebug() << "dbus call failed:" << iface.lastError() ;
    return 1 ;
  }

  bool res_value = res.value() ;

  return res_value ? 0 : 1 ;
}