wpamsg.h 654 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef WPAMSG_H
  2. #define WPAMSG_H
  3. class WpaMsg;
  4. #if QT_VERSION >= 0x040000
  5. #include <QDateTime>
  6. #include <QLinkedList>
  7. typedef QLinkedList<WpaMsg> WpaMsgList;
  8. #else
  9. #include <qdatetime.h>
  10. typedef QValueList<WpaMsg> WpaMsgList;
  11. #endif
  12. class WpaMsg {
  13. public:
  14. WpaMsg(const QString &_msg, int _priority = 2)
  15. : msg(_msg), priority(_priority)
  16. {
  17. timestamp = QDateTime::currentDateTime();
  18. }
  19. QString getMsg() const { return msg; }
  20. int getPriority() const { return priority; }
  21. QDateTime getTimestamp() const { return timestamp; }
  22. private:
  23. QString msg;
  24. int priority;
  25. QDateTime timestamp;
  26. };
  27. #endif /* WPAMSG_H */