diff options
| author | 2009-07-01 17:24:13 +0000 | |
|---|---|---|
| committer | 2009-07-01 17:24:13 +0000 | |
| commit | 74000a49e93dac9da64deda081b99e5b264642ad (patch) | |
| tree | baad8d6b243c654c12314b0c8b9655662a18c4e8 /src/modules | |
| parent | small fix for previous commit (diff) | |
| download | KVIrc-74000a49e93dac9da64deda081b99e5b264642ad.tar.gz KVIrc-74000a49e93dac9da64deda081b99e5b264642ad.tar.bz2 KVIrc-74000a49e93dac9da64deda081b99e5b264642ad.zip | |
improved hungarian notation;
added missing tooltips;
removed uselss definition of KviQCString
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3297 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/avatar/libkviavatar.cpp | 8 | ||||
| -rw-r--r-- | src/modules/dcc/chat.cpp | 9 | ||||
| -rw-r--r-- | src/modules/editor/scripteditor.cpp | 6 | ||||
| -rw-r--r-- | src/modules/editor/scripteditor.h | 6 | ||||
| -rw-r--r-- | src/modules/file/libkvifile.cpp | 4 | ||||
| -rw-r--r-- | src/modules/list/libkvilist.cpp | 6 | ||||
| -rw-r--r-- | src/modules/list/listwindow.cpp | 176 | ||||
| -rw-r--r-- | src/modules/list/listwindow.h | 54 | ||||
| -rw-r--r-- | src/modules/logview/logviewmdiwindow.cpp | 4 | ||||
| -rw-r--r-- | src/modules/mediaplayer/mp_interface.cpp | 10 | ||||
| -rw-r--r-- | src/modules/mediaplayer/mp_xmmsinterface.cpp | 2 | ||||
| -rw-r--r-- | src/modules/objects/class_socket.cpp | 12 | ||||
| -rw-r--r-- | src/modules/objects/class_xmlreader.cpp | 2 | ||||
| -rw-r--r-- | src/modules/perlcore/libkviperlcore.cpp | 5 | ||||
| -rw-r--r-- | src/modules/system/libkvisystem.cpp | 17 |
15 files changed, 172 insertions, 149 deletions
diff --git a/src/modules/avatar/libkviavatar.cpp b/src/modules/avatar/libkviavatar.cpp index 5f16c9517..e03a898c6 100644 --- a/src/modules/avatar/libkviavatar.cpp +++ b/src/modules/avatar/libkviavatar.cpp @@ -43,7 +43,6 @@ #include "kvi_sharedfiles.h" #include "kvi_out.h" #include "kvi_ircmask.h" -#include "kvi_qcstring.h" #include "kvi_tal_hbox.h" #include <QLineEdit> @@ -53,6 +52,7 @@ #include <QLabel> #include <QLayout> #include <QCloseEvent> +#include <QByteArray> static KviPointerList<KviAsyncAvatarSelectionDialog> * g_pAvatarSelectionDialogList = 0; extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; @@ -411,11 +411,11 @@ static bool avatar_kvs_cmd_notify(KviKvsModuleCommandCall * c) if(!c->switches()->find('q',"quiet")) c->window()->output(KVI_OUT_AVATAR,__tr2qs("Notifying avatar '%Q' to %Q"),&avatar,&szTarget); - KviQCString encodedTarget = c->window()->connection()->encodeText(szTarget); + QByteArray encodedTarget = c->window()->connection()->encodeText(szTarget); if(!avatar.isEmpty()) { - KviQCString encodedAvatar = c->window()->connection()->encodeText(avatar); + QByteArray encodedAvatar = c->window()->connection()->encodeText(avatar); if(o) { @@ -547,7 +547,7 @@ static bool avatar_kvs_cmd_query(KviKvsModuleCommandCall * c) KVSM_REQUIRE_CONNECTION(c) - KviQCString target = c->window()->connection()->encodeText(szName); + QByteArray target = c->window()->connection()->encodeText(szName); c->window()->connection()->sendFmtData("PRIVMSG %s :%cAVATAR%c",target.data(),0x01,0x01); return true; diff --git a/src/modules/dcc/chat.cpp b/src/modules/dcc/chat.cpp index 3f8a4e11a..a5ff51837 100644 --- a/src/modules/dcc/chat.cpp +++ b/src/modules/dcc/chat.cpp @@ -32,6 +32,7 @@ #endif #define _KVI_DEBUG_CHECK_RANGE_ + #include "kvi_debug.h" #include "kvi_options.h" #include "kvi_input.h" @@ -54,13 +55,13 @@ #include "kvi_ircconnection.h" #include "kvi_ircconnectionuserinfo.h" #include "kvi_kvs_eventtriggers.h" -#include "kvi_qcstring.h" -#include "kvi_tal_vbox.h" #include "kvi_mirccntrl.h" +#include "kvi_tal_vbox.h" #include <QSplitter> #include <QEvent> #include <QResizeEvent> +#include <QByteArray> #ifdef COMPILE_CRYPT_SUPPORT #include "kvi_crypt.h" @@ -303,7 +304,7 @@ void KviDccChat::ownMessage(const QString &text) return; } - KviQCString szData = encodeText(text); + QByteArray szData = encodeText(text); const char * d = szData.data(); if(!d)return; @@ -387,7 +388,7 @@ void KviDccChat::ownAction(const QString &text) szTmpBuffer = text; } - KviQCString szData = encodeText(szTmpBuffer); + QByteArray szData = encodeText(szTmpBuffer); const char * d = szData.data(); if(!d)return; KviStr buf(KviStr::Format,"%cACTION %s%c\r\n",0x01,d,0x01); diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp index a20c0a7a3..dd45d2c06 100644 --- a/src/modules/editor/scripteditor.cpp +++ b/src/modules/editor/scripteditor.cpp @@ -874,17 +874,17 @@ void KviScriptEditorImplementation::saveToFile() void KviScriptEditorImplementation::setText(const char * txt) { - setText(KviQCString(txt)); + setText(QByteArray(txt)); } -void KviScriptEditorImplementation::setText(const KviQCString & szText) +void KviScriptEditorImplementation::setText(const QByteArray & szText) { m_pEditor->setPlainText(szText.data()); m_pEditor->document()->setModified(false); updateRowColLabel(); } -void KviScriptEditorImplementation::getText(KviQCString & szText) +void KviScriptEditorImplementation::getText(QByteArray & szText) { szText = m_pEditor->toPlainText().toUtf8(); } diff --git a/src/modules/editor/scripteditor.h b/src/modules/editor/scripteditor.h index 2e5ee6c2b..7a66f1074 100644 --- a/src/modules/editor/scripteditor.h +++ b/src/modules/editor/scripteditor.h @@ -28,7 +28,6 @@ #include "kvi_scripteditor.h" #include "kvi_pointerlist.h" #include "kvi_selectors.h" -#include "kvi_qcstring.h" #include "kvi_tal_textedit.h" #include "kvi_tal_popupmenu.h" @@ -40,6 +39,7 @@ #include <QListWidget> #include <QCheckBox> #include <QSyntaxHighlighter> +#include <QByteArray> class QTimer; @@ -153,9 +153,9 @@ protected: public: virtual void setText(const char * txt); virtual void setText(const QString & szText); - virtual void setText(const KviQCString & szText); + virtual void setText(const QByteArray & szText); virtual void getText(QString & szText); - virtual void getText(KviQCString & szText); + virtual void getText(QByteArray & szText); virtual void setFindText(const QString & szText); virtual void setEnabled(bool bEnabled); virtual void setFocus(); diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 7e6ebb23b..2fa8d56ef 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -28,7 +28,6 @@ #include "kvi_malloc.h" #include "kvi_app.h" #include "kvi_options.h" -#include "kvi_qcstring.h" #include "kvi_kvs_arraycast.h" #include "kvi_file.h" @@ -36,6 +35,7 @@ #include <QDir> #include <QTextStream> #include <QTextCodec> +#include <QByteArray> /* @doc: file.copy @@ -919,7 +919,7 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) while(u < a.array()->size()) { KviKvsVariant * v = a.array()->at(u); - KviQCString dat; + QByteArray dat; if(v) { QString szDat; diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp index ebd9a1f91..a1d4c76c8 100644 --- a/src/modules/list/libkvilist.cpp +++ b/src/modules/list/libkvilist.cpp @@ -48,19 +48,19 @@ KviPointerList<KviListWindow> * g_pListWindowList = 0; The channel list window is opened automatically when a channel list is requested from the server. */ - static bool list_kvs_cmd_open(KviKvsModuleCommandCall * c) { - if(!c->window()->console())return c->context()->errorNoIrcContext(); + if(!c->window()->console()) return c->context()->errorNoIrcContext(); if(!(c->window()->context()->listWindow())) { - KviListWindow *w = new KviListWindow(c->window()->frame(),c->window()->console()); + KviListWindow * w = new KviListWindow(c->window()->frame(),c->window()->console()); c->window()->frame()->addWindow(w); } else { c->warning(__tr2qs("List window already open for this IRC context")); } + return true; } diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp index c52b5b31a..c2ea43a42 100644 --- a/src/modules/list/listwindow.cpp +++ b/src/modules/list/listwindow.cpp @@ -4,7 +4,7 @@ // Creation date : Thu Oct 7 2001 13:27:55 CEST by Szymon Stefanek // // This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2008 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2001-2009 Szymon Stefanek (pragma at kvirc dot net) // // This program is FREE software. You can redistribute it and/or // modify it under the lists of the GNU General Public License @@ -37,7 +37,6 @@ #include "kvi_ircconnection.h" #include "kvi_ircconnection.h" #include "kvi_qstring.h" -#include "kvi_qcstring.h" #include "kvi_topicw.h" #include "kvi_config.h" #include "kvi_filedialog.h" @@ -52,10 +51,11 @@ #include <QSplitter> #include <QToolTip> #include <QDateTime> +#include <QByteArray> extern KviPointerList<KviListWindow> * g_pListWindowList; -KviChannelTreeWidgetItemData::KviChannelTreeWidgetItemData(const QString &szChan,const QString &szUsers,const QString &szTopic) +KviChannelTreeWidgetItemData::KviChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic) { m_szChan = szChan; m_szUsers = szUsers; @@ -75,35 +75,34 @@ KviChannelTreeWidgetItem::KviChannelTreeWidgetItem(KviTalTreeWidget * v,KviChann setText(2, pData->m_szTopic); } - KviChannelTreeWidgetItem::~KviChannelTreeWidgetItem() { } -int KviChannelTreeWidgetItem::width ( const QFontMetrics & fm, const KviTalTreeWidget * , int column ) const +int KviChannelTreeWidgetItem::width(const QFontMetrics & fm, const KviTalTreeWidget *, int iColumn) const { - if(column==2) - return fm.width(KviMircCntrl::stripControlBytes(text(column))); - else return fm.width(text(column)); + if(iColumn == 2) + return fm.width(KviMircCntrl::stripControlBytes(text(iColumn))); + else return fm.width(text(iColumn)); } -bool KviChannelTreeWidgetItem::operator< ( const KviTalTreeWidgetItem & other ) const +bool KviChannelTreeWidgetItem::operator<(const KviTalTreeWidgetItem & other) const { - int sortCol = treeWidget()->sortColumn(); - switch (sortCol) + int iSortCol = treeWidget()->sortColumn(); + switch(iSortCol) { case 0: //channel - return text(sortCol).toUpper() < other.text(sortCol).toUpper(); + return text(iSortCol).toUpper() < other.text(iSortCol).toUpper(); break; case 1: //users - return text(sortCol).toInt() < other.text(sortCol).toInt(); + return text(iSortCol).toInt() < other.text(iSortCol).toInt(); break; case 2: default: //topic - return KviMircCntrl::stripControlBytes(text(sortCol)).toUpper() < KviMircCntrl::stripControlBytes(other.text(sortCol)).toUpper(); + return KviMircCntrl::stripControlBytes(text(iSortCol)).toUpper() < KviMircCntrl::stripControlBytes(other.text(iSortCol)).toUpper(); break; } } @@ -111,15 +110,24 @@ bool KviChannelTreeWidgetItem::operator< ( const KviTalTreeWidgetItem & other ) #define KVI_LABEL_DEF_BACK 100 #define KVI_LABEL_DEF_FORE 101 -void KviChannelTreeWidgetItemDelegate::paint( QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index ) const +KviChannelTreeWidgetItemDelegate::KviChannelTreeWidgetItemDelegate(KviTalTreeWidget * pWidget) +: QItemDelegate(pWidget) +{ +} + +KviChannelTreeWidgetItemDelegate::~KviChannelTreeWidgetItemDelegate() +{ +} + +void KviChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const { if (option.state & QStyle::State_Selected) p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) ); //reset the color - p->setPen( option.palette.text().color() ); + p->setPen(option.palette.text().color()); - switch (index.column()) + switch(index.column()) { case 0: //channel @@ -137,8 +145,9 @@ void KviChannelTreeWidgetItemDelegate::paint( QPainter * p, const QStyleOptionVi } } -KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole) -: KviWindow(KVI_WINDOW_TYPE_LIST,lpFrm,"list",lpConsole) , KviExternalServerDataParser() + +KviListWindow::KviListWindow(KviFrame * lpFrm, KviConsole * lpConsole) +: KviWindow(KVI_WINDOW_TYPE_LIST,lpFrm,"list",lpConsole), KviExternalServerDataParser() { g_pListWindowList->append(this); @@ -154,37 +163,45 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole) m_pVertSplitter = new QSplitter(Qt::Vertical,m_pSplitter); m_pVertSplitter->setObjectName("vsplitter"); - KviTalHBox * box = new KviTalHBox(m_pTopSplitter); - box->setSpacing(1); - box->setMargin(0); - m_pOpenButton = new QToolButton(box); + KviTalHBox * pBox = new KviTalHBox(m_pTopSplitter); + pBox->setSpacing(1); + pBox->setMargin(0); + + m_pOpenButton = new QToolButton(pBox); + m_pOpenButton->setObjectName("import_list"); + m_pOpenButton->setIconSize(QSize(16,16)); m_pOpenButton->setIcon(QIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN)))); + KviTalToolTip::add(m_pOpenButton,__tr2qs("Import List")); connect(m_pOpenButton,SIGNAL(clicked()),this,SLOT(importList())); - m_pSaveButton = new QToolButton(box); + m_pSaveButton = new QToolButton(pBox); + m_pSaveButton->setObjectName("export_list"); + m_pSaveButton->setIconSize(QSize(16,16)); m_pSaveButton->setIcon(QIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_SAVE)))); + KviTalToolTip::add(m_pSaveButton,__tr2qs("Export List")); connect(m_pSaveButton,SIGNAL(clicked()),this,SLOT(exportList())); - m_pRequestButton = new QToolButton(box); + m_pRequestButton = new QToolButton(pBox); m_pRequestButton->setObjectName("request_button"); m_pRequestButton->setIconSize(QSize(16,16)); m_pRequestButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LIST)))); - connect(m_pRequestButton,SIGNAL(clicked()),this,SLOT(requestList())); KviTalToolTip::add(m_pRequestButton,__tr2qs("Request List")); + connect(m_pRequestButton,SIGNAL(clicked()),this,SLOT(requestList())); - m_pStopListDownloadButton = new QToolButton(box); + m_pStopListDownloadButton = new QToolButton(pBox); m_pStopListDownloadButton->setObjectName("stoplistdownload_button"); m_pStopListDownloadButton->setIconSize(QSize(16,16)); m_pStopListDownloadButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NICKNAMEPROBLEM)))); - connect(m_pStopListDownloadButton,SIGNAL(clicked()),this,SLOT(stoplistdownload())); KviTalToolTip::add(m_pStopListDownloadButton,__tr2qs("Stop list download")); + connect(m_pStopListDownloadButton,SIGNAL(clicked()),this,SLOT(stoplistdownload())); - m_pParamsEdit = new QLineEdit(box); - box->setStretchFactor(m_pParamsEdit,1); + m_pParamsEdit = new QLineEdit(pBox); + pBox->setStretchFactor(m_pParamsEdit,1); KviTalToolTip::add(m_pParamsEdit,__tr2qs("<center><b>/LIST command parameters:</b><br>Many servers accept special parameters that " \ - "allow you to filter the returned entries.<br>" \ - "Commonly, masked channel names (*kvirc*) are accepted as parameters, as well as strings " \ - "like <b>c<n</b> or <b>c>n</b> where <b>n</b> is the minimum or maximum of users on the channel.</center>")); + "allow you to filter the returned entries.<br>" \ + "Commonly, masked channel names (*kvirc*) are accepted as parameters, as well as strings " \ + "like <b>c<n</b> or <b>c>n</b> where <b>n</b> is the minimum or maximum of users on the channel.</center>")); + m_pInfoLabel = new KviThemedLabel(m_pTopSplitter,"info_label"); @@ -201,15 +218,12 @@ KviListWindow::KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole) m_pTreeWidget->setAllColumnsShowFocus(TRUE); m_pTreeWidget->setSortingEnabled(TRUE); m_pTreeWidget->sortItems(0,Qt::AscendingOrder); - connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this); m_pConsole->context()->setListWindowPointer(this); - - connect(m_pConsole->context(),SIGNAL(stateChanged()), - this,SLOT(connectionStateChange())); + connect(m_pConsole->context(),SIGNAL(stateChanged()),this,SLOT(connectionStateChange())); connectionStateChange(); } @@ -218,14 +232,16 @@ KviListWindow::~KviListWindow() { g_pListWindowList->removeRef(this); m_pConsole->context()->setListWindowPointer(0); - if(m_pFlushTimer)delete m_pFlushTimer; + + if(m_pFlushTimer) + delete m_pFlushTimer; m_pItemList->setAutoDelete(true); delete m_pItemList; } -void KviListWindow::getBaseLogFileName(QString &buffer) +void KviListWindow::getBaseLogFileName(QString & szBuffer) { - buffer.sprintf("LIST_%d",context()->id()); + szBuffer.sprintf("LIST_%d",context()->id()); } void KviListWindow::requestList() @@ -233,8 +249,10 @@ void KviListWindow::requestList() if(m_pConsole->isConnected()) { KviStr parms = m_pParamsEdit->text(); - if(parms.isEmpty())m_pConsole->connection()->sendFmtData("list"); + if(parms.isEmpty()) + m_pConsole->connection()->sendFmtData("list"); else m_pConsole->connection()->sendFmtData("list %s",m_pConsole->connection()->encodeText(parms.ptr()).data()); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sent list request, waiting for reply...")); m_pRequestButton->setEnabled(false); } else { @@ -259,12 +277,12 @@ void KviListWindow::connectionStateChange() m_pRequestButton->setEnabled(st == KviIrcContext::Connected); if(st == KviIrcContext::Connected) { - QString tmp; - KviQString::sprintf(tmp, + QString szTmp; + KviQString::sprintf(szTmp, __tr2qs("Connected to %s (%s)"), m_pConsole->connection()->currentServerName().toUtf8().data(), m_pConsole->currentNetworkName().toUtf8().data()); - m_pInfoLabel->setText(tmp); + m_pInfoLabel->setText(szTmp); } else { m_pInfoLabel->setText(__tr2qs("List cannot be requested: Not connected to a server")); } @@ -277,9 +295,9 @@ QPixmap * KviListWindow::myIconPtr() void KviListWindow::resizeEvent(QResizeEvent *) { - int hght = m_pTopSplitter->sizeHint().height(); - m_pTopSplitter->setGeometry(0,0,width(),hght); - m_pSplitter->setGeometry(0,hght,width(),height() - hght); + 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 @@ -328,19 +346,19 @@ void KviListWindow::exportList() } else { szFile = __tr2qs("Channel list"); } - if(KviFileDialog::askForSaveFileName(szFile,__tr2qs("Choose filename"),szFile, - __tr2qs("Configuration files (*.kvc)"),false, - false,true,this)) + + if(KviFileDialog::askForSaveFileName(szFile,__tr2qs("Choose filename"),szFile,__tr2qs("Configuration files (*.kvc)"),false,false,true,this)) { - if(QFileInfo(szFile).completeSuffix()!="kvc") + if(QFileInfo(szFile).completeSuffix() != "kvc") szFile.append(".kvc"); + KviConfig cfg(szFile,KviConfig::Write); cfg.clear(); - KviChannelTreeWidgetItem *it; - for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++) + KviChannelTreeWidgetItem * it; + for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(KviChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (KviChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); cfg.setGroup(it->text(0)); // Write properties cfg.writeEntry("topic",it->text(2)); @@ -351,10 +369,9 @@ void KviListWindow::exportList() void KviListWindow::importList() { - QString szFile; - if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Choose filename"),QString(),KVI_FILTER_CONFIG,false, - false,this)) + + if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Choose filename"),QString(),KVI_FILTER_CONFIG,false,false,this)) { if(m_pConsole->isConnected()) { @@ -382,13 +399,19 @@ void KviListWindow::importList() } } -void KviListWindow::control(int message) +void KviListWindow::control(int iMsg) { - switch(message) + switch(iMsg) { - case EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET: reset(); break; - case EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA: startOfList(); break; - case EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA: endOfList(); break; + case EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET: + reset(); + break; + case EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA: + startOfList(); + break; + case EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA: + endOfList(); + break; } } @@ -420,7 +443,7 @@ void KviListWindow::startOfList() m_pRequestButton->setEnabled(false); } -void KviListWindow::processData(KviIrcMessage *msg) +void KviListWindow::processData(KviIrcMessage * pMsg) { if(!m_pFlushTimer) { @@ -430,19 +453,17 @@ void KviListWindow::processData(KviIrcMessage *msg) m_pRequestButton->setEnabled(false); } - QString sz2 = msg->connection()->decodeText(msg->safeParam(2)); - m_pItemList->append( new KviChannelTreeWidgetItemData( - msg->connection()->decodeText(msg->safeParam(1)), - msg->connection()->decodeText(msg->safeParam(2)), - msg->connection()->decodeText(msg->safeTrailing())) + pMsg->connection()->decodeText(pMsg->safeParam(1)), + pMsg->connection()->decodeText(pMsg->safeParam(2)), + pMsg->connection()->decodeText(pMsg->safeTrailing())) ); if(_OUTPUT_VERBOSE) { - QString zzz = msg->connection()->decodeText(msg->allParams()); - output(KVI_OUT_LIST,__tr2qs("Processing list: %Q"),&zzz); + QString szTmp = pMsg->connection()->decodeText(pMsg->allParams()); + output(KVI_OUT_LIST,__tr2qs("Processing list: %Q"),&szTmp); } } @@ -458,13 +479,16 @@ void KviListWindow::flush() m_pTreeWidget->viewport()->update(); } -void KviListWindow::itemDoubleClicked(KviTalTreeWidgetItem *it, int) +void KviListWindow::itemDoubleClicked(KviTalTreeWidgetItem * it, int) { - QString sz = it->text(0); - if(sz.isEmpty())return; - if(!connection())return; - KviQCString dat = connection()->encodeText(sz); - if(!dat.data())return; + QString szText = it->text(0); + + if(szText.isEmpty()) return; + if(!connection()) return; + + QByteArray dat = connection()->encodeText(szText); + if(!dat.data()) return; + m_pConsole->connection()->sendFmtData("join %s",dat.data()); } diff --git a/src/modules/list/listwindow.h b/src/modules/list/listwindow.h index a28f8cadc..45a229a6d 100644 --- a/src/modules/list/listwindow.h +++ b/src/modules/list/listwindow.h @@ -40,23 +40,21 @@ class KviThemedLabel; - class KviChannelTreeWidgetItemDelegate : public QItemDelegate { public: - KviChannelTreeWidgetItemDelegate(KviTalTreeWidget * pWidget=0) - : QItemDelegate(pWidget) {}; - ~KviChannelTreeWidgetItemDelegate(){}; - void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; - + KviChannelTreeWidgetItemDelegate(KviTalTreeWidget * pWidget = 0); + ~KviChannelTreeWidgetItemDelegate(); + void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; }; + class KviChannelTreeWidgetItemData { friend class KviChannelTreeWidgetItem; friend class KviListWindow; friend class KviChannelTreeWidgetItemDelegate; public: - KviChannelTreeWidgetItemData(const QString &szChan,const QString &szUsers,const QString &szTopic); + KviChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic); ~KviChannelTreeWidgetItemData(); protected: QString m_szChan; @@ -68,52 +66,50 @@ class KviChannelTreeWidgetItem : public KviTalTreeWidgetItem { friend class KviListWindow; public: - KviChannelTreeWidgetItem(KviTalTreeWidget * v,KviChannelTreeWidgetItemData * pData); + KviChannelTreeWidgetItem(KviTalTreeWidget * pWidget, KviChannelTreeWidgetItemData * pData); ~KviChannelTreeWidgetItem(); public: - int width ( const QFontMetrics & fm, const KviTalTreeWidget * lv, int column ) const; - bool operator< ( const KviTalTreeWidgetItem & other ) const; + int width (const QFontMetrics & fm, const KviTalTreeWidget * pWidget, int iColumn) const; + bool operator<(const KviTalTreeWidgetItem & other) const; }; - class KviListWindow : public KviWindow, public KviExternalServerDataParser { Q_OBJECT public: - KviListWindow(KviFrame * lpFrm,KviConsole * lpConsole); + KviListWindow(KviFrame * lpFrm, KviConsole * lpConsole); ~KviListWindow(); protected: - QSplitter * m_pVertSplitter; - QSplitter * m_pTopSplitter; - KviTalTreeWidget * m_pTreeWidget; - QLineEdit * m_pParamsEdit; - QToolButton * m_pRequestButton; - QToolButton * m_pStopListDownloadButton; - QToolButton * m_pOpenButton; - QToolButton * m_pSaveButton; - KviThemedLabel * m_pInfoLabel; - QTimer * m_pFlushTimer; + QSplitter * m_pVertSplitter; + QSplitter * m_pTopSplitter; + KviTalTreeWidget * m_pTreeWidget; + QLineEdit * m_pParamsEdit; + QToolButton * m_pRequestButton; + QToolButton * m_pStopListDownloadButton; + QToolButton * m_pOpenButton; + QToolButton * m_pSaveButton; + KviThemedLabel * m_pInfoLabel; + QTimer * m_pFlushTimer; KviPointerList<KviChannelTreeWidgetItemData> * m_pItemList; public: // Methods - virtual void control(int msg); - virtual void processData(KviIrcMessage * msg); + virtual void control(int iMsg); + virtual void processData(KviIrcMessage * pMsg); virtual void die(); + virtual QSize sizeHint() const; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void applyOptions(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual void resizeEvent(QResizeEvent * e); + virtual void getBaseLogFileName(QString & szBuffer); protected slots: void flush(); - void itemDoubleClicked(QTreeWidgetItem *it, int); + void itemDoubleClicked(QTreeWidgetItem * it, int); void requestList(); void stoplistdownload(); void connectionStateChange(); void exportList(); void importList(); -public: - virtual QSize sizeHint() const; private: void reset(); void endOfList(); diff --git a/src/modules/logview/logviewmdiwindow.cpp b/src/modules/logview/logviewmdiwindow.cpp index dc61f2038..fff5c1cb3 100644 --- a/src/modules/logview/logviewmdiwindow.cpp +++ b/src/modules/logview/logviewmdiwindow.cpp @@ -33,7 +33,6 @@ #include "kvi_frame.h" #include "kvi_ircview.h" #include "kvi_qstring.h" -#include "kvi_qcstring.h" #include "kvi_app.h" #include "kvi_fileutils.h" #include "kvi_tal_popupmenu.h" @@ -55,6 +54,7 @@ #include <QLabel> #include <QShortcut> #include <QMouseEvent> +#include <QByteArray> #ifdef COMPILE_ZLIB_SUPPORT #include <zlib.h> @@ -451,7 +451,7 @@ void KviLogFile::getText(QString & text,const QString& logDir){ { char buff[1025]; int len; - KviQCString data; + QByteArray data; //QCString data; len=gzread(file,buff,1024); while(len>0) diff --git a/src/modules/mediaplayer/mp_interface.cpp b/src/modules/mediaplayer/mp_interface.cpp index 452283478..fb108ee49 100644 --- a/src/modules/mediaplayer/mp_interface.cpp +++ b/src/modules/mediaplayer/mp_interface.cpp @@ -114,25 +114,25 @@ QString KviMediaPlayerInterface::amipEval(const QString &) QString KviMediaPlayerInterface::artist() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.artist)); + return pCodec->toUnicode(QByteArray(mp3.id3.artist)); } QString KviMediaPlayerInterface::title() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.title)); + return pCodec->toUnicode(QByteArray(mp3.id3.title)); } QString KviMediaPlayerInterface::genre() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(get_typegenre(mp3.id3.genre[0]))); + return pCodec->toUnicode(QByteArray(get_typegenre(mp3.id3.genre[0]))); } QString KviMediaPlayerInterface::comment() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.comment)); + return pCodec->toUnicode(QByteArray(mp3.id3.comment)); } QString KviMediaPlayerInterface::year() @@ -144,7 +144,7 @@ QString KviMediaPlayerInterface::year() QString KviMediaPlayerInterface::album() { SCAN_MP3_FILE - return pCodec->toUnicode(KviQCString(mp3.id3.album)); + return pCodec->toUnicode(QByteArray(mp3.id3.album)); } bool KviMediaPlayerInterface::playMrl(const QString &) diff --git a/src/modules/mediaplayer/mp_xmmsinterface.cpp b/src/modules/mediaplayer/mp_xmmsinterface.cpp index c6f0c5574..37d13f1b2 100644 --- a/src/modules/mediaplayer/mp_xmmsinterface.cpp +++ b/src/modules/mediaplayer/mp_xmmsinterface.cpp @@ -279,7 +279,7 @@ KviMediaPlayerInterface::PlayerStatus KviXmmsInterface::status() bool KviXmmsInterface::playMrl(const QString &mrl) { void (*sym)(int,char *) = (void (*)(int,char *))lookupSymbol("xmms_remote_playlist_add_url_string"); - KviQCString tmp = mrl.toLocal8Bit(); + QByteArray tmp = mrl.toLocal8Bit(); if(!tmp.isEmpty()) { if(sym) diff --git a/src/modules/objects/class_socket.cpp b/src/modules/objects/class_socket.cpp index ffbb0d6e0..e2453afdb 100644 --- a/src/modules/objects/class_socket.cpp +++ b/src/modules/objects/class_socket.cpp @@ -22,10 +22,13 @@ // //============================================================================= -#include "kvi_settings.h" -#include "kvi_qstring.h" +#include "class_socket.h" #include "class_memorybuffer.h" #include "class_file.h" + +#include "kvi_settings.h" +#include "kvi_qstring.h" + #define _KVI_DEBUG_CHECK_RANGE_ #include "kvi_debug.h" @@ -40,9 +43,8 @@ #include "kvi_malloc.h" #include "kvi_memmove.h" #include "kvi_databuffer.h" -#include "kvi_qcstring.h" -#include "class_socket.h" +#include <QByteArray> //#include <stdlib.h> @@ -531,7 +533,7 @@ KVSO_CLASS_FUNCTION(socket,write) pVariantData->asString(szData); if(!KviFileUtils::fileExists(szData)) { - KviQCString szData8 = szData.toUtf8(); + QByteArray szData8 = szData.toUtf8(); if(szData8.length() > 0) { m_pOutBuffer->append((const unsigned char*)szData8.data(),szData8.length()); diff --git a/src/modules/objects/class_xmlreader.cpp b/src/modules/objects/class_xmlreader.cpp index f49ea7e64..4e2a1605d 100644 --- a/src/modules/objects/class_xmlreader.cpp +++ b/src/modules/objects/class_xmlreader.cpp @@ -347,7 +347,7 @@ KVSO_CLASS_FUNCTION(xmlreader,parse) // We have a problem here.. most kvirc functions already interpret the data // read from files. We should have binary data handling features to get this to work correctly. // The following snippet of code tries to provide a best-effort workaround. - KviQCString utf8data = KviQString::toUtf8(szString); + QByteArray utf8data = KviQString::toUtf8(szString); QByteArray data = utf8data; data.truncate(utf8data.length()); // don't include the null terminator in data source.setData(data); diff --git a/src/modules/perlcore/libkviperlcore.cpp b/src/modules/perlcore/libkviperlcore.cpp index 2909d388a..29c3ce32d 100644 --- a/src/modules/perlcore/libkviperlcore.cpp +++ b/src/modules/perlcore/libkviperlcore.cpp @@ -31,9 +31,10 @@ #include "kvi_kvs_script.h" #include "kvi_kvs_variant.h" #include "kvi_userinput.h" -#include "kvi_qcstring.h" #include "kvi_pointerhashtable.h" +#include <QByteArray> + #ifdef DEBUG #undef DEBUG #endif @@ -239,7 +240,7 @@ bool KviPerlInterpreter::execute( g_lWarningList.clear(); - KviQCString szUtf8 = szCode.toUtf8(); + QByteArray szUtf8 = szCode.toUtf8(); PERL_SET_CONTEXT(m_pInterpreter); // clear the _ array diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp index 364079740..fd27085b8 100644 --- a/src/modules/system/libkvisystem.cpp +++ b/src/modules/system/libkvisystem.cpp @@ -30,14 +30,13 @@ #include "kvi_string.h" #include "kvi_thread.h" #include "kvi_locale.h" -#include "kvi_qcstring.h" #include "kvi_app.h" #include "kvi_env.h" #include "kvi_osinfo.h" -#include "kvi_qcstring.h" #include "kvi_modulemanager.h" #include <QClipboard> +#include <QByteArray> #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) #include <sys/utsname.h> @@ -206,7 +205,7 @@ static bool system_kvs_fnc_getenv(KviKvsModuleFunctionCall *c) KVSM_PARAMETER("variable",KVS_PT_NONEMPTYSTRING,0,szVariable) KVSM_PARAMETERS_END(c) - KviQCString szVar = szVariable.toLocal8Bit(); + QByteArray szVar = szVariable.toLocal8Bit(); /*#ifdef COMPILE_ON_WINDOWS QString env= getenv(szVar.data()); QString def= __tr2qs("No environment variable found, please don't use the %% in the request"); @@ -428,7 +427,7 @@ static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c) The parameters MUST be in the form "type=value" where "type" is the C++ type of the parameter and value is the string rappresentation of the parameter data. Currently - KVIrc supports only QString,KviQCString,bool,int and uint data types.[br] + KVIrc supports only QString,QByteArray,bool,int and uint data types.[br] The returned value is the string rappresentation of the returned data if the return type is known, otherwise it is the name of the data type returned. [br] @@ -500,9 +499,9 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) { QString ddd = tmp.ptr(); ds << ddd; - } else if(kvi_strEqualCI("KviQCString",szType.ptr())) + } else if(kvi_strEqualCI("QByteArray",szType.ptr())) { - KviQCString qcs = tmp.ptr(); + QByteArray qcs = tmp.ptr(); ds << qcs; } else if(kvi_strEqualCI("bool",szType.ptr())) { @@ -610,8 +609,8 @@ static bool system_kvs_cmd_setenv(KviKvsModuleCommandCall * c) KVSM_PARAMETER("value",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) KVSM_PARAMETERS_END(c) - KviQCString szVar = szVariable.toLocal8Bit(); - KviQCString szVal = szValue.toLocal8Bit(); + QByteArray szVar = szVariable.toLocal8Bit(); + QByteArray szVal = szValue.toLocal8Bit(); if(szVal.isEmpty())kvi_unsetenv(szVar.data()); else @@ -707,7 +706,7 @@ static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c) // check for empty szCommand if(!szCommand.isEmpty()) { - KviQCString szCmd = szCommand.toLocal8Bit(); + QByteArray szCmd = szCommand.toLocal8Bit(); #ifdef COMPILE_KDE_SUPPORT // We have invokeTerminal(). KToolInvocation::invokeTerminal(szCmd.data()); #else // No invokeTerminal() for us, we'll use a |
