void Kita::slotSetVestedNum(const KURL& threadURL, int resNum)
{
- qDebug("%s = %d", threadURL.prettyURL().latin1(), resNum);
+ m_cache->setVestedNum(threadURL, resNum);
+}
+
+KitaCacheInfo* Kita::getCache()
+{
+ return m_cache;
}
* Use this method to load whatever file/URL you have
*/
void load(const KURL& url);
+ KitaCacheInfo* getCache();
protected:
/**
#include <kurl.h>
-#include <qdict.h>
+#include <qmap.h>
KitaCacheInfo::KitaCacheInfo()
{
+ m_vestedDict = new QMap<QString, int>();
}
KitaCacheInfo::~KitaCacheInfo()
{
+ delete m_vestedDict;
}
-int KitaCacheInfo::getVestedNum(KURL& url)
+int KitaCacheInfo::getVestedNum(const KURL& url)
{
- return m_vestedDict[url.prettyURL()];
+ return 0;
}
-void KitaCacheInfo::setVestedNum(KURL& url, int num)
+void KitaCacheInfo::setVestedNum(const KURL& url, int num)
{
- m_vestedDict.insert(url.prettyURL(), num);
+ m_vestedDict->insert(url.prettyURL(), num);
}
public:
KitaCacheInfo();
~KitaCacheInfo();
- void setVestedNum(KURL& url, int num);
- int getVestedNum(KURL& url);
+ void setVestedNum(const KURL& url, int num);
+ int getVestedNum(const KURL& url);
private:
- QMap<QString, int> m_vestedDict;
+ QMap<QString, int>* m_vestedDict;
};
#endif
#include "kitasubjectview.h"
#include "kita.h"
+#include "kitacacheinfo.h"
enum SubjectViewRows {
Row_ID,
KitaSubjectView::KitaSubjectView(QWidget *parent, const char *name)
: KitaSubjectViewBase(parent, name)
{
+ m_parent = static_cast<Kita*>(parent);
{
SearchButton->setPixmap( SmallIcon("find") );
HideButton->setPixmap( SmallIcon("filter") );
QString line;
int row=1;
+ KitaCacheInfo* cache = m_parent->getCache();
+
while((line = stream.readLine()) != QString::null) {
int pos = regexp.search(line);
if(pos != -1) {
void slotLoadBoard(const KURL& url, const QString& boardName);
void slotHideButton(bool on);
private: // Private attributes
+ Kita* m_parent;
KURL m_boardURL;
QString m_boardName;
void insertSearchCombo();