mycache.h 842 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef MYCACHE_H
  2. #define MYCACHE_H
  3. #include <QObject>
  4. #include <QDir>
  5. #include "storevcard.h"
  6. class MyCache : public StoreVCard
  7. {
  8. Q_OBJECT
  9. QString pathMeegIMHome;
  10. QString pathMeegIMCache;
  11. QString appName;
  12. public:
  13. explicit MyCache(QObject *parent = 0);
  14. bool createHomeDir() const;
  15. inline bool existsCacheJid(const QString &jid) const {
  16. QDir jD( pathMeegIMCache + QDir::separator() + jid );
  17. return jD.exists();
  18. }
  19. bool addCacheJid( const QString &jid );
  20. bool setAvatarCache( const QString &jid, const QByteArray &avatar ) const;
  21. QString getAvatarCache( const QString &jid ) const;
  22. QString getMeegIMCachePath() const { return pathMeegIMCache; }
  23. QString getMeegIMHomePath() const { return pathMeegIMHome; }
  24. signals:
  25. public slots:
  26. };
  27. #endif // MYCACHE_H