aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/list
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2011-01-01 20:19:56 +0000
committerGravatar Szymon Tomasz Stefanek2011-01-01 20:19:56 +0000
commitc601b5a27f74b16158adafe429faefbe573e64a2 (patch)
treea3cde3206a45628f8ac86e8dfbdab70b20c3a831 /src/modules/list
parentprobable compilation fix for rijndaled/crypto++ (diff)
downloadKVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.gz
KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.tar.bz2
KVIrc-c601b5a27f74b16158adafe429faefbe573e64a2.zip
The big rename for modules. Still some details remaining.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5284 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/list')
-rw-r--r--src/modules/list/CMakeLists.txt4
-rw-r--r--src/modules/list/ListWindow.cpp (renamed from src/modules/list/listwindow.cpp)106
-rw-r--r--src/modules/list/ListWindow.h (renamed from src/modules/list/listwindow.h)40
-rw-r--r--src/modules/list/libkvilist.cpp8
4 files changed, 79 insertions, 79 deletions
diff --git a/src/modules/list/CMakeLists.txt b/src/modules/list/CMakeLists.txt
index eb0ea0d56..43be14744 100644
--- a/src/modules/list/CMakeLists.txt
+++ b/src/modules/list/CMakeLists.txt
@@ -1,12 +1,12 @@
# CMakeLists for src/modules/list
SET(kvilist_MOC_HDRS
- listwindow.h
+ ListWindow.h
)
SET(kvilist_SRCS
libkvilist.cpp
- listwindow.cpp
+ ListWindow.cpp
)
# After this call, files will be moc'ed to moc_kvi_*.cpp
diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/ListWindow.cpp
index 1ddcc233a..3e596cb3c 100644
--- a/src/modules/list/listwindow.cpp
+++ b/src/modules/list/ListWindow.cpp
@@ -1,6 +1,6 @@
//=============================================================================
//
-// File : listwindow.cpp
+// File : ListWindow.cpp
// Creation date : Thu Oct 7 2001 13:27:55 CEST by Szymon Stefanek
//
// This file is part of the KVIrc irc client distribution
@@ -22,7 +22,7 @@
//
//=============================================================================
-#include "listwindow.h"
+#include "ListWindow.h"
#include "kvi_debug.h"
#include "KviIconManager.h"
@@ -54,21 +54,21 @@
#include <QByteArray>
#include <QTextDocument> // for Qt::escape
-extern KviPointerList<KviListWindow> * g_pListWindowList;
+extern KviPointerList<ListWindow> * g_pListWindowList;
-KviChannelTreeWidgetItemData::KviChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic)
+ChannelTreeWidgetItemData::ChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic)
{
m_szChan = szChan;
m_szUsers = szUsers;
m_szTopic = szTopic;
}
-KviChannelTreeWidgetItemData::~KviChannelTreeWidgetItemData()
+ChannelTreeWidgetItemData::~ChannelTreeWidgetItemData()
{
}
-KviChannelTreeWidgetItem::KviChannelTreeWidgetItem(QTreeWidget * v,KviChannelTreeWidgetItemData * pData)
+ChannelTreeWidgetItem::ChannelTreeWidgetItem(QTreeWidget * v,ChannelTreeWidgetItemData * pData)
: QTreeWidgetItem(v), m_pData(pData)
{
setToolTip(0, m_pData->m_szChan);
@@ -76,11 +76,11 @@ KviChannelTreeWidgetItem::KviChannelTreeWidgetItem(QTreeWidget * v,KviChannelTre
setToolTip(2, KviHtmlGenerator::convertToHtml(Qt::escape(m_pData->m_szTopic)));
}
-KviChannelTreeWidgetItem::~KviChannelTreeWidgetItem()
+ChannelTreeWidgetItem::~ChannelTreeWidgetItem()
{
}
-int KviChannelTreeWidgetItem::width(const QFontMetrics & fm, const QTreeWidget *, int iColumn) const
+int ChannelTreeWidgetItem::width(const QFontMetrics & fm, const QTreeWidget *, int iColumn) const
{
switch(iColumn)
{
@@ -100,38 +100,38 @@ int KviChannelTreeWidgetItem::width(const QFontMetrics & fm, const QTreeWidget *
}
}
-bool KviChannelTreeWidgetItem::operator<(const QTreeWidgetItem & other) const
+bool ChannelTreeWidgetItem::operator<(const QTreeWidgetItem & other) const
{
switch(treeWidget()->sortColumn())
{
case 0:
//channel
- return m_pData->m_szChan.toUpper() < ((KviChannelTreeWidgetItem*)&other)->itemData()->m_szChan.toUpper();
+ return m_pData->m_szChan.toUpper() < ((ChannelTreeWidgetItem*)&other)->itemData()->m_szChan.toUpper();
break;
case 1:
//users
- return m_pData->m_szUsers.toInt() < ((KviChannelTreeWidgetItem*)&other)->itemData()->m_szUsers.toInt();
+ return m_pData->m_szUsers.toInt() < ((ChannelTreeWidgetItem*)&other)->itemData()->m_szUsers.toInt();
break;
case 2:
default:
//topic
- return KviMircCntrl::stripControlBytes(m_pData->m_szTopic.toUpper()) < KviMircCntrl::stripControlBytes(((KviChannelTreeWidgetItem*)&other)->itemData()->m_szTopic.toUpper());
+ return KviMircCntrl::stripControlBytes(m_pData->m_szTopic.toUpper()) < KviMircCntrl::stripControlBytes(((ChannelTreeWidgetItem*)&other)->itemData()->m_szTopic.toUpper());
break;
}
}
-KviChannelTreeWidgetItemDelegate::KviChannelTreeWidgetItemDelegate(QTreeWidget * pWidget)
+ChannelTreeWidgetItemDelegate::ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget)
: QItemDelegate(pWidget)
{
}
-KviChannelTreeWidgetItemDelegate::~KviChannelTreeWidgetItemDelegate()
+ChannelTreeWidgetItemDelegate::~ChannelTreeWidgetItemDelegate()
{
}
-void KviChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const
+void ChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const
{
- KviChannelTreeWidgetItem* obj = static_cast<KviChannelTreeWidgetItem*>(index.internalPointer());
+ ChannelTreeWidgetItem* obj = static_cast<ChannelTreeWidgetItem*>(index.internalPointer());
if (option.state & QStyle::State_Selected)
p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) );
@@ -157,14 +157,14 @@ void KviChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionVie
}
}
-KviListWindow::KviListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole)
+ListWindow::ListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole)
: KviWindow(KVI_WINDOW_TYPE_LIST,lpFrm,"list",lpConsole), KviExternalServerDataParser()
{
g_pListWindowList->append(this);
m_pFlushTimer = 0;
- m_pItemList = new KviPointerList<KviChannelTreeWidgetItemData>;
+ m_pItemList = new KviPointerList<ChannelTreeWidgetItemData>;
m_pItemList->setAutoDelete(false);
m_pSplitter = new KviTalSplitter(Qt::Horizontal,this);
@@ -223,7 +223,7 @@ KviListWindow::KviListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole
m_pTreeWidget = new KviThemedTreeWidget(m_pVertSplitter, this, "list_treewidget");
m_pTreeWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
- m_pTreeWidget->setItemDelegate(new KviChannelTreeWidgetItemDelegate(m_pTreeWidget));
+ m_pTreeWidget->setItemDelegate(new ChannelTreeWidgetItemDelegate(m_pTreeWidget));
QStringList columnLabels;
columnLabels.append(__tr2qs("Channel"));
columnLabels.append(__tr2qs("Users"));
@@ -243,7 +243,7 @@ KviListWindow::KviListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole
connectionStateChange();
}
-KviListWindow::~KviListWindow()
+ListWindow::~ListWindow()
{
g_pListWindowList->removeRef(this);
m_pConsole->context()->setListWindowPointer(0);
@@ -254,12 +254,12 @@ KviListWindow::~KviListWindow()
delete m_pItemList;
}
-void KviListWindow::getBaseLogFileName(QString & szBuffer)
+void ListWindow::getBaseLogFileName(QString & szBuffer)
{
szBuffer.sprintf("LIST_%d",context()->id());
}
-void KviListWindow::requestList()
+void ListWindow::requestList()
{
if(m_pConsole->isConnected())
{
@@ -276,7 +276,7 @@ void KviListWindow::requestList()
}
}
-void KviListWindow::stoplistdownload()
+void ListWindow::stoplistdownload()
{
if(m_pConsole->isConnected())
{
@@ -287,7 +287,7 @@ void KviListWindow::stoplistdownload()
}
}
-void KviListWindow::connectionStateChange()
+void ListWindow::connectionStateChange()
{
KviIrcContext::State st = m_pConsole->context()->state();
m_pRequestButton->setEnabled(st == KviIrcContext::Connected);
@@ -304,34 +304,34 @@ void KviListWindow::connectionStateChange()
}
}
-QPixmap * KviListWindow::myIconPtr()
+QPixmap * ListWindow::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_LIST);
}
-void KviListWindow::resizeEvent(QResizeEvent *)
+void ListWindow::resizeEvent(QResizeEvent *)
{
int iHeight = m_pTopSplitter->sizeHint().height();
m_pTopSplitter->setGeometry(0,0,width(),iHeight);
m_pSplitter->setGeometry(0,iHeight,width(),height() - iHeight);
}
-QSize KviListWindow::sizeHint() const
+QSize ListWindow::sizeHint() const
{
return m_pSplitter->sizeHint();
}
-void KviListWindow::fillCaptionBuffers()
+void ListWindow::fillCaptionBuffers()
{
KviQString::sprintf(m_szPlainTextCaption,__tr2qs("Channel List [IRC Context %u]"),m_pConsole->context()->id());
}
-void KviListWindow::die()
+void ListWindow::die()
{
close();
}
-void KviListWindow::exportList()
+void ListWindow::exportList()
{
if(!m_pTreeWidget->topLevelItemCount())
{
@@ -371,10 +371,10 @@ void KviListWindow::exportList()
KviConfigurationFile cfg(szFile,KviConfigurationFile::Write);
cfg.clear();
- KviChannelTreeWidgetItem * it;
+ ChannelTreeWidgetItem * it;
for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++)
{
- it = (KviChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i);
+ it = (ChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i);
cfg.setGroup(it->itemData()->m_szChan);
// Write properties
cfg.writeEntry("topic",it->itemData()->m_szTopic);
@@ -383,7 +383,7 @@ void KviListWindow::exportList()
}
}
-void KviListWindow::importList()
+void ListWindow::importList()
{
QString szFile;
@@ -403,7 +403,7 @@ void KviListWindow::importList()
{
cfg.setGroup(it.currentKey());
m_pItemList->append(
- new KviChannelTreeWidgetItemData(
+ new ChannelTreeWidgetItemData(
it.currentKey(),
cfg.readEntry("users","0"),
cfg.readEntry("topic","")
@@ -415,7 +415,7 @@ void KviListWindow::importList()
}
}
-void KviListWindow::control(int iMsg)
+void ListWindow::control(int iMsg)
{
switch(iMsg)
{
@@ -431,12 +431,12 @@ void KviListWindow::control(int iMsg)
}
}
-void KviListWindow::reset()
+void ListWindow::reset()
{
outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Reset"));
}
-void KviListWindow::endOfList()
+void ListWindow::endOfList()
{
if(m_pFlushTimer)
{
@@ -448,7 +448,7 @@ void KviListWindow::endOfList()
flush(); // give it the last kick
}
-void KviListWindow::startOfList()
+void ListWindow::startOfList()
{
m_pItemList->setAutoDelete(true);
m_pItemList->clear();
@@ -459,14 +459,14 @@ void KviListWindow::startOfList()
m_pRequestButton->setEnabled(false);
}
-void KviListWindow::liveSearch(const QString & szText)
+void ListWindow::liveSearch(const QString & szText)
{
QRegExp res(szText,Qt::CaseInsensitive,QRegExp::Wildcard);
- KviChannelTreeWidgetItem * pItem=0;
+ ChannelTreeWidgetItem * pItem=0;
for(int i=0; i<m_pTreeWidget->topLevelItemCount(); i++)
{
- pItem = (KviChannelTreeWidgetItem*) m_pTreeWidget->topLevelItem(i);
+ pItem = (ChannelTreeWidgetItem*) m_pTreeWidget->topLevelItem(i);
if(pItem->itemData()->m_szChan.contains(res) ||
pItem->itemData()->m_szTopic.contains(res))
{
@@ -477,7 +477,7 @@ void KviListWindow::liveSearch(const QString & szText)
}
}
-void KviListWindow::processData(KviIrcMessage * pMsg)
+void ListWindow::processData(KviIrcMessage * pMsg)
{
if(!m_pFlushTimer)
{
@@ -490,7 +490,7 @@ void KviListWindow::processData(KviIrcMessage * pMsg)
if(m_pParamsEdit->text().isEmpty())
{
m_pItemList->append(
- new KviChannelTreeWidgetItemData(
+ new ChannelTreeWidgetItemData(
pMsg->connection()->decodeText(pMsg->safeParam(1)),
pMsg->connection()->decodeText(pMsg->safeParam(2)),
pMsg->connection()->decodeText(pMsg->safeTrailing()))
@@ -504,7 +504,7 @@ void KviListWindow::processData(KviIrcMessage * pMsg)
)
{
m_pItemList->append(
- new KviChannelTreeWidgetItemData(
+ new ChannelTreeWidgetItemData(
pMsg->connection()->decodeText(pMsg->safeParam(1)),
pMsg->connection()->decodeText(pMsg->safeParam(2)),
pMsg->connection()->decodeText(pMsg->safeTrailing())
@@ -520,21 +520,21 @@ void KviListWindow::processData(KviIrcMessage * pMsg)
}
}
-void KviListWindow::flush()
+void ListWindow::flush()
{
m_pTreeWidget->setUpdatesEnabled(true); /* for v_scroolbar */
- while(KviChannelTreeWidgetItemData * d = m_pItemList->first())
+ while(ChannelTreeWidgetItemData * d = m_pItemList->first())
{
- (void)new KviChannelTreeWidgetItem(m_pTreeWidget,d);
+ (void)new ChannelTreeWidgetItem(m_pTreeWidget,d);
m_pItemList->removeFirst();
}
m_pTreeWidget->setUpdatesEnabled(true);
m_pTreeWidget->viewport()->update();
}
-void KviListWindow::itemDoubleClicked(QTreeWidgetItem * it, int)
+void ListWindow::itemDoubleClicked(QTreeWidgetItem * it, int)
{
- QString szText = ((KviChannelTreeWidgetItem*)it)->itemData()->m_szChan;
+ QString szText = ((ChannelTreeWidgetItem*)it)->itemData()->m_szChan;
if(szText.isEmpty()) return;
if(!connection()) return;
@@ -549,7 +549,7 @@ void KviListWindow::itemDoubleClicked(QTreeWidgetItem * it, int)
//
//#warning "Load & save properties of this kind of window"
-//void KviListWindow::saveProperties()
+//void ListWindow::saveProperties()
//{
// KviWindowProperty p;
// p.rect = externalGeometry();
@@ -566,7 +566,7 @@ void KviListWindow::itemDoubleClicked(QTreeWidgetItem * it, int)
// g_pOptions->m_pWinPropertiesList->setProperty(caption(),&p);
//}
//
-//void KviListWindow::setProperties(KviWindowProperty *p)
+//void ListWindow::setProperties(KviWindowProperty *p)
//{
// QValueList<int> l;
// l.append(p->splitWidth1);
@@ -576,7 +576,7 @@ void KviListWindow::itemDoubleClicked(QTreeWidgetItem * it, int)
// m_pIrcView->setShowImages(p->imagesVisible);
//}
-void KviListWindow::applyOptions()
+void ListWindow::applyOptions()
{
m_pTreeWidget->applyOptions();
m_pIrcView->applyOptions();
@@ -586,5 +586,5 @@ void KviListWindow::applyOptions()
}
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
-#include "listwindow.moc"
+#include "ListWindow.moc"
#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/modules/list/listwindow.h b/src/modules/list/ListWindow.h
index 0ee5eda83..cf8cf3d17 100644
--- a/src/modules/list/listwindow.h
+++ b/src/modules/list/ListWindow.h
@@ -2,7 +2,7 @@
#define _LISTWINDOW_H_
//=============================================================================
//
-// File : listwindow.h
+// File : ListWindow.h
// Creation date : Thu Oct 7 2001 13:27:55 CEST by Szymon Stefanek
//
// This file is part of the KVIrc irc client distribution
@@ -41,48 +41,48 @@
class KviThemedLabel;
class KviThemedLineEdit;
-class KviChannelTreeWidgetItemDelegate : public QItemDelegate
+class ChannelTreeWidgetItemDelegate : public QItemDelegate
{
public:
- KviChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0);
- ~KviChannelTreeWidgetItemDelegate();
+ ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0);
+ ~ChannelTreeWidgetItemDelegate();
void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
};
-class KviChannelTreeWidgetItemData
+class ChannelTreeWidgetItemData
{
- friend class KviChannelTreeWidgetItem;
- friend class KviListWindow;
- friend class KviChannelTreeWidgetItemDelegate;
+ friend class ChannelTreeWidgetItem;
+ friend class ListWindow;
+ friend class ChannelTreeWidgetItemDelegate;
public:
- KviChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic);
- ~KviChannelTreeWidgetItemData();
+ ChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic);
+ ~ChannelTreeWidgetItemData();
protected:
QString m_szChan;
QString m_szUsers;
QString m_szTopic;
};
-class KviChannelTreeWidgetItem : public QTreeWidgetItem
+class ChannelTreeWidgetItem : public QTreeWidgetItem
{
- friend class KviListWindow;
+ friend class ListWindow;
public:
- KviChannelTreeWidgetItem(QTreeWidget * pWidget, KviChannelTreeWidgetItemData * pData);
- ~KviChannelTreeWidgetItem();
+ ChannelTreeWidgetItem(QTreeWidget * pWidget, ChannelTreeWidgetItemData * pData);
+ ~ChannelTreeWidgetItem();
private:
- KviChannelTreeWidgetItemData * m_pData;
+ ChannelTreeWidgetItemData * m_pData;
public:
int width (const QFontMetrics & fm, const QTreeWidget * pWidget, int iColumn) const;
bool operator<(const QTreeWidgetItem & other) const;
- inline KviChannelTreeWidgetItemData * itemData() { return m_pData; };
+ inline ChannelTreeWidgetItemData * itemData() { return m_pData; };
};
-class KviListWindow : public KviWindow, public KviExternalServerDataParser
+class ListWindow : public KviWindow, public KviExternalServerDataParser
{
Q_OBJECT
public:
- KviListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole);
- ~KviListWindow();
+ ListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole);
+ ~ListWindow();
protected:
QSplitter * m_pVertSplitter;
QSplitter * m_pTopSplitter;
@@ -94,7 +94,7 @@ protected:
QToolButton * m_pSaveButton;
KviThemedLabel * m_pInfoLabel;
QTimer * m_pFlushTimer;
- KviPointerList<KviChannelTreeWidgetItemData> * m_pItemList;
+ KviPointerList<ChannelTreeWidgetItemData> * m_pItemList;
public: // Methods
virtual void control(int iMsg);
virtual void processData(KviIrcMessage * pMsg);
diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp
index 1ea7a0d1a..9491b5bac 100644
--- a/src/modules/list/libkvilist.cpp
+++ b/src/modules/list/libkvilist.cpp
@@ -21,7 +21,7 @@
//
//=============================================================================
-#include "listwindow.h"
+#include "ListWindow.h"
#include "KviModule.h"
#include "KviMainWindow.h"
@@ -30,7 +30,7 @@
#include <QSplitter>
-KviPointerList<KviListWindow> * g_pListWindowList = 0;
+KviPointerList<ListWindow> * g_pListWindowList = 0;
/*
@@ -55,7 +55,7 @@ static bool list_kvs_cmd_open(KviKvsModuleCommandCall * c)
if(!(c->window()->context()->listWindow()))
{
- KviListWindow * w = new KviListWindow(c->window()->frame(),c->window()->console());
+ ListWindow * w = new ListWindow(c->window()->frame(),c->window()->console());
c->window()->frame()->addWindow(w);
} else {
c->warning(__tr2qs("List window already open for this IRC context"));
@@ -66,7 +66,7 @@ static bool list_kvs_cmd_open(KviKvsModuleCommandCall * c)
static bool list_module_init(KviModule * m)
{
- g_pListWindowList = new KviPointerList<KviListWindow>;
+ g_pListWindowList = new KviPointerList<ListWindow>;
g_pListWindowList->setAutoDelete(false);
KVSM_REGISTER_SIMPLE_COMMAND(m,"open",list_kvs_cmd_open);