You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

unreadchecker.cpp 871 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "unreadchecker.h"
  2. #include <QTimerEvent>
  3. #include "platformdepend.h"
  4. REGISTER_PLUGIN("unread_checker", UnreadChecker)
  5. UnreadChecker::UnreadChecker()
  6. {
  7. }
  8. void UnreadChecker::timerEvent(QTimerEvent *event)
  9. {
  10. if (event->timerId() == mUnreadTimerId)
  11. {
  12. auto count = mFeiq->getUnreadCount();
  13. if (count > 0)
  14. PlatformDepend::instance().showNotify("未读提醒", QString("还有%1条未读消息").arg(count));
  15. }
  16. }
  17. void UnreadChecker::init(FeiqWin *feiqWin)
  18. {
  19. IPlugin::init(feiqWin);
  20. auto settings = mFeiq->settings();
  21. mUnreadTimerInterval = settings->value("plugin/unread_timer", "0").toInt();
  22. if (mUnreadTimerInterval > 0)
  23. mUnreadTimerId = startTimer(mUnreadTimerInterval*1000, Qt::VeryCoarseTimer);
  24. }
  25. void UnreadChecker::unInit()
  26. {
  27. if (mUnreadTimerId > 0)
  28. killTimer(mUnreadTimerId);
  29. }

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)