summaryrefslogtreecommitdiffstats
path: root/src/modules/logview
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/modules/logview
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/modules/logview')
-rw-r--r--src/modules/logview/libkvilogview.cpp18
-rw-r--r--src/modules/logview/logviewmdiwindow.cpp228
-rw-r--r--src/modules/logview/logviewmdiwindow.h79
-rw-r--r--src/modules/logview/logviewwidget.cpp14
-rw-r--r--src/modules/logview/logviewwidget.h18
5 files changed, 179 insertions, 178 deletions
diff --git a/src/modules/logview/libkvilogview.cpp b/src/modules/logview/libkvilogview.cpp
index 2aa56a66..cf5c7a95 100644
--- a/src/modules/logview/libkvilogview.cpp
+++ b/src/modules/logview/libkvilogview.cpp
@@ -32,7 +32,7 @@
#include "kvi_locale.h"
#include "kvi_app.h"
-static QRect g_rectLogViewGeometry;
+static TQRect g_rectLogViewGeometry;
KviLogViewMDIWindow * g_pLogViewWindow = 0;
#define LOGVIEW_MODULE_EXTENSION_NAME "Log viewer extension"
@@ -66,11 +66,11 @@ static bool logview_kvs_cmd_open(KviKvsModuleCommandCall * c)
KviModuleExtensionDescriptor * d = c->module()->findExtensionDescriptor("tool",LOGVIEW_MODULE_EXTENSION_NAME);
if(d)
{
- KviPointerHashTable<QString,QVariant> dict(17,true);
+ KviPointerHashTable<TQString,TQVariant> dict(17,true);
dict.setAutoDelete(true);
- QString dummy;
- dict.replace("bCreateMinimized",new QVariant(c->hasSwitch('m',dummy)));
- dict.replace("bNoRaise",new QVariant(c->hasSwitch('n',dummy)));
+ TQString dummy;
+ dict.tqreplace("bCreateMinimized",new TQVariant(c->hasSwitch('m',dummy)));
+ dict.tqreplace("bNoRaise",new TQVariant(c->hasSwitch('n',dummy)));
d->allocate(c->window(),&dict,0);
} else {
@@ -88,11 +88,11 @@ static KviModuleExtension * logview_extension_alloc(KviModuleExtensionAllocStruc
{
if(s->pParams)
{
- if(QVariant * v = s->pParams->find("bCreateMinimized"))
+ if(TQVariant * v = s->pParams->tqfind("bCreateMinimized"))
{
if(v->isValid())
{
- if(v->type() == QVariant::Bool)
+ if(v->type() == TQVariant::Bool)
{
bCreateMinimized = v->toBool();
}
@@ -108,11 +108,11 @@ static KviModuleExtension * logview_extension_alloc(KviModuleExtensionAllocStruc
if(s->pParams)
{
- if(QVariant * v = s->pParams->find("bNoRaise"))
+ if(TQVariant * v = s->pParams->tqfind("bNoRaise"))
{
if(v)
{
- if(v->isValid() && v->type() == QVariant::Bool)
+ if(v->isValid() && v->type() == TQVariant::Bool)
bNoRaise = v->toBool();
}
}
diff --git a/src/modules/logview/logviewmdiwindow.cpp b/src/modules/logview/logviewmdiwindow.cpp
index 20a2a232..bdc40838 100644
--- a/src/modules/logview/logviewmdiwindow.cpp
+++ b/src/modules/logview/logviewmdiwindow.cpp
@@ -33,33 +33,33 @@
#include "kvi_app.h"
#include "kvi_fileutils.h"
#ifdef COMPILE_USE_QT4
- #include <q3progressdialog.h>
+ #include <tq3progressdialog.h>
#else
- #include <qprogressdialog.h>
+ #include <tqprogressdialog.h>
#endif
#include "kvi_valuelist.h"
#include "kvi_accel.h"
-#include <qpixmap.h>
-#include <qsplitter.h>
-#include <qtoolbutton.h>
+#include <tqpixmap.h>
+#include <tqsplitter.h>
+#include <tqtoolbutton.h>
#include "kvi_tal_listview.h"
-#include <qfileinfo.h>
-#include <qdir.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
#include "kvi_tal_popupmenu.h"
-#include <qcursor.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
+#include <tqcursor.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
#ifdef COMPILE_ZLIB_SUPPORT
#include <zlib.h>
#endif
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include "kvi_styled_controls.h"
-#include <qdatetimeedit.h>
-#include <qlineedit.h>
-#include <qlabel.h>
+#include <tqdatetimeedit.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
extern KviLogViewMDIWindow * g_pLogViewWindow;
@@ -69,11 +69,11 @@ KviLogViewMDIWindow::KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFra
g_pLogViewWindow = this;
// m_pLogViewWidget = new KviLogViewWidget(this);
#ifdef COMPILE_USE_QT4
- m_pSplitter = new QSplitter(Qt::Horizontal,this,"main_splitter");
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter");
#else
- m_pSplitter = new QSplitter(QSplitter::Horizontal,this,"main_splitter");
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter");
#endif
- m_pTabWidget = new QTabWidget(m_pSplitter);
+ m_pTabWidget = new TQTabWidget(m_pSplitter);
m_pIndexTab = new KviTalVBox(m_pTabWidget);
m_pTabWidget->insertTab(m_pIndexTab,__tr2qs_ctx("Index","logview"));
@@ -84,79 +84,79 @@ KviLogViewMDIWindow::KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFra
m_pListView->setMultiSelection(false);
m_pListView->setShowSortIndicator(true);
m_pListView->setRootIsDecorated(true);
- connect(m_pListView,SIGNAL(selectionChanged(KviTalListViewItem *)),this,SLOT(itemSelected(KviTalListViewItem *)));
- connect(m_pListView,SIGNAL(rightButtonClicked ( KviTalListViewItem * , const QPoint &, int )),this,SLOT(rightButtonClicked ( KviTalListViewItem * , const QPoint &, int )));
+ connect(m_pListView,TQT_SIGNAL(selectionChanged(KviTalListViewItem *)),this,TQT_SLOT(itemSelected(KviTalListViewItem *)));
+ connect(m_pListView,TQT_SIGNAL(rightButtonClicked ( KviTalListViewItem * , const TQPoint &, int )),this,TQT_SLOT(rightButtonClicked ( KviTalListViewItem * , const TQPoint &, int )));
- m_pSearchTab = new QWidget(m_pTabWidget);
+ m_pSearchTab = new TQWidget(m_pTabWidget);
m_pTabWidget->insertTab(m_pSearchTab,__tr2qs_ctx("Filter","logview"));
- QGridLayout *layout = new QGridLayout(m_pSearchTab,10,2,3,5);
+ TQGridLayout *tqlayout = new TQGridLayout(m_pSearchTab,10,2,3,5);
m_pShowChannelsCheck = new KviStyledCheckBox(__tr2qs_ctx("Show channel logs","logview"),m_pSearchTab);
m_pShowChannelsCheck->setChecked(true);
- layout->addMultiCellWidget(m_pShowChannelsCheck,0,0,0,1);
+ tqlayout->addMultiCellWidget(m_pShowChannelsCheck,0,0,0,1);
m_pShowQueryesCheck = new KviStyledCheckBox(__tr2qs_ctx("Show query logs","logview"),m_pSearchTab);
m_pShowQueryesCheck->setChecked(true);
- layout->addMultiCellWidget(m_pShowQueryesCheck,1,1,0,1);
+ tqlayout->addMultiCellWidget(m_pShowQueryesCheck,1,1,0,1);
m_pShowConsolesCheck = new KviStyledCheckBox(__tr2qs_ctx("Show console logs","logview"),m_pSearchTab);
m_pShowConsolesCheck->setChecked(true);
- layout->addMultiCellWidget(m_pShowConsolesCheck,2,2,0,1);
+ tqlayout->addMultiCellWidget(m_pShowConsolesCheck,2,2,0,1);
m_pShowDccChatCheck = new KviStyledCheckBox(__tr2qs_ctx("Show DCC chat logs","logview"),m_pSearchTab);
m_pShowDccChatCheck->setChecked(true);
- layout->addMultiCellWidget(m_pShowDccChatCheck,3,3,0,1);
+ tqlayout->addMultiCellWidget(m_pShowDccChatCheck,3,3,0,1);
m_pShowOtherCheck = new KviStyledCheckBox(__tr2qs_ctx("Show other logs","logview"),m_pSearchTab);
m_pShowOtherCheck->setChecked(true);
- layout->addMultiCellWidget(m_pShowOtherCheck,4,4,0,1);
+ tqlayout->addMultiCellWidget(m_pShowOtherCheck,4,4,0,1);
- QLabel *l;
- l = new QLabel(__tr2qs_ctx("Contents filter","logview"),m_pSearchTab);
- layout->addMultiCellWidget(l,5,5,0,1);
-
- l = new QLabel(__tr2qs_ctx("Log name mask:","logview"),m_pSearchTab);
- m_pFileNameMask = new QLineEdit(m_pSearchTab);
- connect(m_pFileNameMask,SIGNAL(returnPressed()),this,SLOT(applyFilter()));
- layout->addWidget(l,6,0);
- layout->addWidget(m_pFileNameMask,6,1);
-
- l = new QLabel(__tr2qs_ctx("Log contents mask:","logview"),m_pSearchTab);
- m_pContentsMask = new QLineEdit(m_pSearchTab);
- connect(m_pContentsMask,SIGNAL(returnPressed()),this,SLOT(applyFilter()));
- layout->addWidget(l,7,0);
- layout->addWidget(m_pContentsMask,7,1);
+ TQLabel *l;
+ l = new TQLabel(__tr2qs_ctx("Contents filter","logview"),m_pSearchTab);
+ tqlayout->addMultiCellWidget(l,5,5,0,1);
+
+ l = new TQLabel(__tr2qs_ctx("Log name tqmask:","logview"),m_pSearchTab);
+ m_pFileNameMask = new TQLineEdit(m_pSearchTab);
+ connect(m_pFileNameMask,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(applyFilter()));
+ tqlayout->addWidget(l,6,0);
+ tqlayout->addWidget(m_pFileNameMask,6,1);
+
+ l = new TQLabel(__tr2qs_ctx("Log contents tqmask:","logview"),m_pSearchTab);
+ m_pContentsMask = new TQLineEdit(m_pSearchTab);
+ connect(m_pContentsMask,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(applyFilter()));
+ tqlayout->addWidget(l,7,0);
+ tqlayout->addWidget(m_pContentsMask,7,1);
m_pEnableFromFilter = new KviStyledCheckBox(__tr2qs_ctx("Only older than","logview"),m_pSearchTab);
- m_pFromDateEdit = new QDateEdit(m_pSearchTab);
- m_pFromDateEdit->setDate(QDate::currentDate());
- layout->addWidget(m_pEnableFromFilter,8,0);
- layout->addWidget(m_pFromDateEdit,8,1);
- connect(m_pEnableFromFilter,SIGNAL(toggled(bool)),m_pFromDateEdit,SLOT(setEnabled(bool)));
+ m_pFromDateEdit = new TQDateEdit(m_pSearchTab);
+ m_pFromDateEdit->setDate(TQDate::tqcurrentDate());
+ tqlayout->addWidget(m_pEnableFromFilter,8,0);
+ tqlayout->addWidget(m_pFromDateEdit,8,1);
+ connect(m_pEnableFromFilter,TQT_SIGNAL(toggled(bool)),m_pFromDateEdit,TQT_SLOT(setEnabled(bool)));
m_pFromDateEdit->setEnabled(false);
m_pEnableToFilter = new KviStyledCheckBox(__tr2qs_ctx("Only newier than","logview"),m_pSearchTab);
- m_pToDateEdit = new QDateEdit(m_pSearchTab);
- m_pToDateEdit->setDate(QDate::currentDate());
- layout->addWidget(m_pEnableToFilter,9,0);
- layout->addWidget(m_pToDateEdit,9,1);
- connect(m_pEnableToFilter,SIGNAL(toggled(bool)),m_pToDateEdit,SLOT(setEnabled(bool)));
+ m_pToDateEdit = new TQDateEdit(m_pSearchTab);
+ m_pToDateEdit->setDate(TQDate::tqcurrentDate());
+ tqlayout->addWidget(m_pEnableToFilter,9,0);
+ tqlayout->addWidget(m_pToDateEdit,9,1);
+ connect(m_pEnableToFilter,TQT_SIGNAL(toggled(bool)),m_pToDateEdit,TQT_SLOT(setEnabled(bool)));
m_pToDateEdit->setEnabled(false);
- QPushButton *pb = new QPushButton(__tr2qs_ctx("Apply filter","logview"),m_pSearchTab);
- connect(pb,SIGNAL(clicked()),this,SLOT(applyFilter()));
- layout->addWidget(pb,10,1);
+ TQPushButton *pb = new TQPushButton(__tr2qs_ctx("Apply filter","logview"),m_pSearchTab);
+ connect(pb,TQT_SIGNAL(clicked()),this,TQT_SLOT(applyFilter()));
+ tqlayout->addWidget(pb,10,1);
- QWidget *w = new QWidget(m_pSearchTab);
- w->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
- layout->addWidget(w,11,1);
+ TQWidget *w = new TQWidget(m_pSearchTab);
+ w->tqsetSizePolicy(TQSizePolicy::Ignored,TQSizePolicy::Ignored);
+ tqlayout->addWidget(w,11,1);
m_pIrcView = new KviIrcView(m_pSplitter,g_pFrame,this);
#ifdef COMPILE_USE_QT4
- m_pIrcView->setFocusPolicy(Qt::ClickFocus);
+ m_pIrcView->setFocusPolicy(TTQ_ClickFocus);
#else
- m_pIrcView->setFocusPolicy(QWidget::ClickFocus);
+ m_pIrcView->setFocusPolicy(TQ_ClickFocus);
#endif
KviValueList<int> li;
li.append(110);
@@ -164,14 +164,14 @@ KviLogViewMDIWindow::KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFra
m_pSplitter->setSizes(li);
g_pApp->getLocalKvircDirectory(m_szLogDirectory,KviApp::Log);
- KviQString::ensureLastCharIs(m_szLogDirectory,'/'); // Does this work on Windows?
+ KviTQString::ensureLastCharIs(m_szLogDirectory,'/'); // Does this work on Windows?
cacheFileList();
setupItemList();
KviAccel *a = new KviAccel( this );
- a->connectItem( a->insertItem(Qt::Key_F+Qt::CTRL),
+ a->connectItem( a->insertItem(TQt::Key_F+TQt::CTRL),
m_pIrcView,
- SLOT(toggleToolWidget()) );
+ TQT_SLOT(toggleToolWidget()) );
}
@@ -187,13 +187,13 @@ void KviLogViewMDIWindow::applyFilter()
}
-QPixmap * KviLogViewMDIWindow::myIconPtr()
+TQPixmap * KviLogViewMDIWindow::myIconPtr()
{
return g_pIconManager->getSmallIcon(KVI_SMALLICON_LOG);
}
-void KviLogViewMDIWindow::resizeEvent(QResizeEvent *e)
+void KviLogViewMDIWindow::resizeEvent(TQResizeEvent *e)
{
m_pSplitter->setGeometry(0,0,width(),height());
}
@@ -202,11 +202,11 @@ void KviLogViewMDIWindow::fillCaptionBuffers()
{
m_szPlainTextCaption = __tr2qs_ctx("Log Viewer","logview");
- m_szHtmlActiveCaption = QString("<nobr><font color=\"%1\"><b>").arg(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii());
+ m_szHtmlActiveCaption = TQString("<nobr><font color=\"%1\"><b>").tqarg(TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name()).ascii());
m_szHtmlActiveCaption.append(m_szPlainTextCaption);
m_szHtmlActiveCaption.append("</b></font></nobr>");
- m_szHtmlInactiveCaption = QString("<nobr><font color=\"%1\"><b>").arg(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii());
+ m_szHtmlInactiveCaption = TQString("<nobr><font color=\"%1\"><b>").tqarg(TQString(KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name()).ascii());
m_szHtmlInactiveCaption.append(m_szPlainTextCaption);
m_szHtmlInactiveCaption.append("</b></font></nobr>");
}
@@ -216,9 +216,9 @@ void KviLogViewMDIWindow::die()
close();
}
-QSize KviLogViewMDIWindow::sizeHint() const
+TQSize KviLogViewMDIWindow::tqsizeHint() const
{
- QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height());
+ TQSize ret(m_pSplitter->tqsizeHint().width(),m_pIrcView->tqsizeHint().height());
return ret;
}
@@ -229,8 +229,8 @@ void KviLogViewMDIWindow::setupItemList()
//m_logList.begin();
KviLogListViewItem *pLastCategory=0;
KviLogListViewItemFolder *pLastGroupItem;
- QString szLastGroup;
- QString szCurGroup;
+ TQString szLastGroup;
+ TQString szCurGroup;
const bool bShowChannel=m_pShowChannelsCheck->isChecked();
const bool bShowQuery=m_pShowQueryesCheck->isChecked();
const bool bShowConsole=m_pShowConsolesCheck->isChecked();
@@ -240,22 +240,22 @@ void KviLogViewMDIWindow::setupItemList()
const bool filterFromDate=m_pEnableFromFilter->isChecked();
const bool filterToDate=m_pEnableToFilter->isChecked();
- const QString nameFilterText = m_pFileNameMask->text();
+ const TQString nameFilterText = m_pFileNameMask->text();
const bool enableNameFilter = !nameFilterText.isEmpty();
- const QString contentFilterText = m_pContentsMask->text();
+ const TQString contentFilterText = m_pContentsMask->text();
const bool enableContentFilter = !contentFilterText.isEmpty();
- QDate fromDate = m_pFromDateEdit->date();
- QDate toDate = m_pToDateEdit->date();
+ TQDate fromDate = m_pFromDateEdit->date();
+ TQDate toDate = m_pToDateEdit->date();
- QString textBuffer;
+ TQString textBuffer;
#ifdef COMPILE_USE_QT4
Q3ProgressDialog progress( __tr2qs_ctx("Filtering files...","logview"),
__tr2qs_ctx("Abort filtering","logview"), m_logList.count(),
this, "progress", TRUE );
#else
- QProgressDialog progress( __tr2qs_ctx("Filtering files...","logview"),
+ TQProgressDialog progress( __tr2qs_ctx("Filtering files...","logview"),
__tr2qs_ctx("Abort filtering","logview"), m_logList.count(),
this, "progress", TRUE );
#endif
@@ -291,13 +291,13 @@ void KviLogViewMDIWindow::setupItemList()
continue;
if(enableNameFilter)
- if(!KviQString::matchStringCI(nameFilterText,pFile->name()))
+ if(!KviTQString::matchStringCI(nameFilterText,pFile->name()))
continue;
if(enableContentFilter)
{
pFile->getText(textBuffer,m_szLogDirectory);
- if(!KviQString::matchStringCI(contentFilterText,textBuffer))
+ if(!KviTQString::matchStringCI(contentFilterText,textBuffer))
continue;
}
@@ -309,7 +309,7 @@ void KviLogViewMDIWindow::setupItemList()
pLastCategory = new KviLogListViewItemType(m_pListView,pFile->type());
}
- KviQString::sprintf(szCurGroup,__tr2qs_ctx("%Q on %Q","logview"),&(pFile->name()),
+ KviTQString::sprintf(szCurGroup,__tr2qs_ctx("%Q on %Q","logview"),&(pFile->name()),
&(pFile->network())
);
@@ -324,14 +324,14 @@ void KviLogViewMDIWindow::setupItemList()
void KviLogViewMDIWindow::cacheFileList()
{
- QStringList m_pFileNames = getFileNames();
+ TQStringList m_pFileNames = getFileNames();
m_pFileNames.sort();
- QString szFname;
+ TQString szFname;
- for(QStringList::Iterator it = m_pFileNames.begin(); it != m_pFileNames.end(); ++it)
+ for(TQStringList::Iterator it = m_pFileNames.begin(); it != m_pFileNames.end(); ++it)
{
szFname=(*it);
- QFileInfo fi(szFname);
+ TQFileInfo fi(szFname);
if(fi.extension(false)=="gz" || fi.extension(false)=="log")
m_logList.append(new KviLogFile(szFname));
}
@@ -340,46 +340,46 @@ void KviLogViewMDIWindow::cacheFileList()
void KviLogViewMDIWindow::itemSelected(KviTalListViewItem * it)
{
bool bCompressed=0;
- //A parent node
+ //A tqparent node
m_pIrcView->clearBuffer();
- if(!it || !it->parent() || !(((KviLogListViewItem *)it)->m_pFileData) )
+ if(!it || !it->tqparent() || !(((KviLogListViewItem *)it)->m_pFileData) )
{
return;
}
- QString text;
+ TQString text;
((KviLogListViewItem *)it)->m_pFileData->getText(text,m_szLogDirectory);
- QStringList lines=QStringList::split('\n',text);
+ TQStringList lines=TQStringList::split('\n',text);
bool bOk;
int iMsgType;
- for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
- QString num=(*it).section(' ',0,0);
+ for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) {
+ TQString num=(*it).section(' ',0,0);
iMsgType=num.toInt(&bOk);
if(bOk)
outputNoFmt(iMsgType,(*it).section(' ',1),KviIrcView::NoRepaint | KviIrcView::NoTimestamp);
else
outputNoFmt(0,*it,KviIrcView::NoRepaint | KviIrcView::NoTimestamp);
}
- m_pIrcView->repaint(false);
+ m_pIrcView->tqrepaint(false);
}
-QStringList KviLogViewMDIWindow::getFileNames()
+TQStringList KviLogViewMDIWindow::getFileNames()
{
- QString logPath;
+ TQString logPath;
g_pApp->getLocalKvircDirectory(logPath,KviApp::Log);
- QString qPath(logPath);
- QDir logDir(qPath);
+ TQString qPath(logPath);
+ TQDir logDir(qPath);
return logDir.entryList();
}
-void KviLogViewMDIWindow::rightButtonClicked ( KviTalListViewItem * it, const QPoint &, int )
+void KviLogViewMDIWindow::rightButtonClicked ( KviTalListViewItem * it, const TQPoint &, int )
{
if(!it) return;
if(((KviLogListViewItem *)it)->fileName(0).isEmpty()) return;
KviTalPopupMenu* popup = new KviTalPopupMenu(this);
- popup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUIT)),__tr2qs_ctx("Remove file","logview"),this,SLOT(deleteCurrent()));
- popup->exec( QCursor::pos() );
+ popup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUIT)),__tr2qs_ctx("Remove file","logview"),this,TQT_SLOT(deleteCurrent()));
+ popup->exec( TQCursor::pos() );
}
void KviLogViewMDIWindow::deleteCurrent()
@@ -389,7 +389,7 @@ void KviLogViewMDIWindow::deleteCurrent()
{
if(!pItem->fileName(0).isNull())
{
- QString szFname;
+ TQString szFname;
g_pApp->getLocalKvircDirectory(szFname,KviApp::Log,pItem->m_pFileData->fileName());
KviFileUtils::removeFile(szFname);
delete pItem;
@@ -398,20 +398,20 @@ void KviLogViewMDIWindow::deleteCurrent()
}
}
-KviLogFile::KviLogFile(const QString& name)
+KviLogFile::KviLogFile(const TQString& name)
{
m_szFilename=name;
- QFileInfo fi(m_szFilename);
+ TQFileInfo fi(m_szFilename);
m_bCompressed=(fi.extension(false)=="gz");
- QString typeToken = m_szFilename.section('_',0,0);
+ TQString typeToken = m_szFilename.section('_',0,0);
// Ignore non-logs files, this includes '.' and '..'
- if( KviQString::equalCI(typeToken,"channel") )
+ if( KviTQString::equalCI(typeToken,"channel") )
m_type = Channel;
- else if( KviQString::equalCI(typeToken,"console") )
+ else if( KviTQString::equalCI(typeToken,"console") )
m_type = Console;
- else if( KviQString::equalCI(typeToken,"dccchat") )
+ else if( KviTQString::equalCI(typeToken,"dccchat") )
m_type = DccChat;
- else if( KviQString::equalCI(typeToken,"query") )
+ else if( KviTQString::equalCI(typeToken,"query") )
m_type = Query;
else
m_type = Other;
@@ -423,7 +423,7 @@ KviLogFile::KviLogFile(const QString& name)
undecoded = m_szFilename.section('.',1,1).section('_',0,0);
m_szNetwork = undecoded.hexDecode(undecoded.ptr()).ptr();
- QString szDate = m_szFilename.section('.',1,3).section('_',1,1);
+ TQString szDate = m_szFilename.section('.',1,3).section('_',1,1);
int iYear = szDate.section('.',0,0).toInt();
int iMonth = szDate.section('.',1,1).toInt();
int iDay = szDate.section('.',2,2).toInt();
@@ -432,9 +432,9 @@ KviLogFile::KviLogFile(const QString& name)
//debug("type=%i, name=%s, net=%s, date=%i %i %i",m_type,m_szName.ascii(),m_szNetwork.ascii(),iYear,iMonth,iDay);
}
-void KviLogFile::getText(QString & text,const QString& logDir){
- QString logName = logDir;
- QFile logFile;
+void KviLogFile::getText(TQString & text,const TQString& logDir){
+ TQString logName = logDir;
+ TQFile logFile;
logName.append(fileName());
#ifdef COMPILE_ZLIB_SUPPORT
if(m_bCompressed)
@@ -444,8 +444,8 @@ void KviLogFile::getText(QString & text,const QString& logDir){
{
char buff[1025];
int len;
- KviQCString data;
- //QCString data;
+ KviTQCString data;
+ //TQCString data;
len=gzread(file,buff,1024);
while(len>0)
{
@@ -454,7 +454,7 @@ void KviLogFile::getText(QString & text,const QString& logDir){
len=gzread(file,buff,1024);
}
gzclose(file);
- text = QString::fromUtf8(data);
+ text = TQString::fromUtf8(data);
} else {
debug("Cannot open compressed file %s",logName.local8Bit().data());
}
@@ -465,9 +465,9 @@ void KviLogFile::getText(QString & text,const QString& logDir){
if(!logFile.open(IO_ReadOnly))
return;
- QByteArray bytes;
+ TQByteArray bytes;
bytes=logFile.readAll();
- text = QString::fromUtf8(bytes.data(), bytes.size());
+ text = TQString::fromUtf8(bytes.data(), bytes.size());
logFile.close();
#ifdef COMPILE_ZLIB_SUPPORT
}
diff --git a/src/modules/logview/logviewmdiwindow.h b/src/modules/logview/logviewmdiwindow.h
index df4bb245..8a2a503f 100644
--- a/src/modules/logview/logviewmdiwindow.h
+++ b/src/modules/logview/logviewmdiwindow.h
@@ -29,15 +29,15 @@
#include "kvi_tal_vbox.h"
#include "kvi_tal_listview.h"
#include "kvi_pointerlist.h"
-#include <qtabwidget.h>
-#include <qdatetime.h>
+#include <tqtabwidget.h>
+#include <tqdatetime.h>
class KviTalListView;
-class QStringList;
+class TQStringList;
class KviLogViewWidget;
-class QCheckBox;
-class QLineEdit;
-class QDateEdit;
+class TQCheckBox;
+class TQLineEdit;
+class TQDateEdit;
class KviLogFile {
@@ -51,28 +51,29 @@ public:
Other
};
- KviLogFile(const QString& name);
+ KviLogFile(const TQString& name);
- const QString & fileName() { return m_szFilename; };
- const QString & name() { return m_szName; };
- const QString & network() { return m_szNetwork; };
- const QDate & date() { return m_date; };
+ const TQString & fileName() { return m_szFilename; };
+ const TQString & name() { return m_szName; };
+ const TQString & network() { return m_szNetwork; };
+ const TQDate & date() { return m_date; };
- void getText(QString & text,const QString& logDir);
+ void getText(TQString & text,const TQString& logDir);
KviLogTypes type() { return m_type; };
private:
KviLogTypes m_type;
- QString m_szFilename;
+ TQString m_szFilename;
bool m_bCompressed;
- QString m_szName;
- QString m_szNetwork;
- QDate m_date;
+ TQString m_szName;
+ TQString m_szNetwork;
+ TQDate m_date;
};
class KviLogViewMDIWindow : public KviWindow , public KviModuleExtension
{
Q_OBJECT
+ TQ_OBJECT
public:
KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFrame * lpFrm);
~KviLogViewMDIWindow();
@@ -82,40 +83,40 @@ protected:
KviTalListView * m_pListView;
// Type filter
- QCheckBox * m_pShowChannelsCheck;
- QCheckBox * m_pShowQueryesCheck;
- QCheckBox * m_pShowConsolesCheck;
- QCheckBox * m_pShowOtherCheck;
- QCheckBox * m_pShowDccChatCheck;
+ TQCheckBox * m_pShowChannelsCheck;
+ TQCheckBox * m_pShowQueryesCheck;
+ TQCheckBox * m_pShowConsolesCheck;
+ TQCheckBox * m_pShowOtherCheck;
+ TQCheckBox * m_pShowDccChatCheck;
// Content filter
- QLineEdit * m_pFileNameMask;
- QLineEdit * m_pContentsMask;
-
- // Date/time mask
- QCheckBox * m_pEnableFromFilter;
- QCheckBox * m_pEnableToFilter;
- QDateEdit * m_pFromDateEdit;
- QDateEdit * m_pToDateEdit;
-
- QStringList * m_pFileNames;
- QString m_szLogDirectory;
- QTabWidget * m_pTabWidget;
+ TQLineEdit * m_pFileNameMask;
+ TQLineEdit * m_pContentsMask;
+
+ // Date/time tqmask
+ TQCheckBox * m_pEnableFromFilter;
+ TQCheckBox * m_pEnableToFilter;
+ TQDateEdit * m_pFromDateEdit;
+ TQDateEdit * m_pToDateEdit;
+
+ TQStringList * m_pFileNames;
+ TQString m_szLogDirectory;
+ TQTabWidget * m_pTabWidget;
KviTalVBox * m_pIndexTab;
- QWidget * m_pSearchTab;
+ TQWidget * m_pSearchTab;
protected:
- QStringList getFileNames();
+ TQStringList getFileNames();
void setupItemList();
void cacheFileList();
- virtual QPixmap * myIconPtr();
- virtual void resizeEvent(QResizeEvent *e);
+ virtual TQPixmap * myIconPtr();
+ virtual void resizeEvent(TQResizeEvent *e);
virtual void fillCaptionBuffers();
virtual void die();
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
protected slots:
- void rightButtonClicked ( KviTalListViewItem *, const QPoint &, int );
+ void rightButtonClicked ( KviTalListViewItem *, const TQPoint &, int );
void itemSelected(KviTalListViewItem * it);
void deleteCurrent();
void applyFilter();
diff --git a/src/modules/logview/logviewwidget.cpp b/src/modules/logview/logviewwidget.cpp
index fc5c8abc..31da5033 100644
--- a/src/modules/logview/logviewwidget.cpp
+++ b/src/modules/logview/logviewwidget.cpp
@@ -22,9 +22,9 @@
#include "logviewwidget.h"
-#include <qsplitter.h>
-#include <qlayout.h>
-#include <qdir.h>
+#include <tqsplitter.h>
+#include <tqlayout.h>
+#include <tqdir.h>
//#include "kvi_debug.h"
#include "kvi_locale.h"
@@ -35,9 +35,9 @@
#ifdef COMPILE_ZLIB_SUPPORT
#include <zlib.h>
#endif
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
-const QPixmap * KviLogListViewItemType::pixmap(int col) const
+const TQPixmap * KviLogListViewItemType::pixmap(int col) const
{
switch(m_type)
@@ -45,7 +45,7 @@ const QPixmap * KviLogListViewItemType::pixmap(int col) const
case KviLogFile::Channel:
return g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL);
case KviLogFile::Query:
- return g_pIconManager->getSmallIcon(KVI_SMALLICON_QUERY);
+ return g_pIconManager->getSmallIcon(KVI_SMALLICON_TQUERY);
case KviLogFile::DccChat:
return g_pIconManager->getSmallIcon(KVI_SMALLICON_DCCMSG);
case KviLogFile::Console:
@@ -55,7 +55,7 @@ const QPixmap * KviLogListViewItemType::pixmap(int col) const
}
}
-QString KviLogListViewItemType::text(int col) const
+TQString KviLogListViewItemType::text(int col) const
{
switch(m_type)
{
diff --git a/src/modules/logview/logviewwidget.h b/src/modules/logview/logviewwidget.h
index 1b5eff97..c925e502 100644
--- a/src/modules/logview/logviewwidget.h
+++ b/src/modules/logview/logviewwidget.h
@@ -44,19 +44,19 @@ public:
KviLogFile::KviLogTypes m_type;
KviLogFile* m_pFileData;
- virtual QString fileName(int col) const { return m_pFileData ? m_pFileData->name() : QString::null; };
- virtual QString text(int col) const { return m_pFileData ? m_pFileData->name() : QString::null; };
+ virtual TQString fileName(int col) const { return m_pFileData ? m_pFileData->name() : TQString(); };
+ virtual TQString text(int col) const { return m_pFileData ? m_pFileData->name() : TQString(); };
};
class KviLogListViewItemFolder : public KviLogListViewItem
{
public:
- KviLogListViewItemFolder(KviTalListViewItem * par, const QString& label)
+ KviLogListViewItemFolder(KviTalListViewItem * par, const TQString& label)
: KviLogListViewItem(par,KviLogFile::Other,0),m_szLabel(label) {};
~KviLogListViewItemFolder() {};
public:
- QString m_szLabel;
- virtual QString text(int col) const { return m_szLabel; };
+ TQString m_szLabel;
+ virtual TQString text(int col) const { return m_szLabel; };
};
class KviLogListViewItemType : public KviLogListViewItem
@@ -66,8 +66,8 @@ public:
: KviLogListViewItem(par,type,0) {};
~KviLogListViewItemType() {};
public:
- virtual const QPixmap * pixmap(int col) const;
- virtual QString text(int col) const;
+ virtual const TQPixmap * pixmap(int col) const;
+ virtual TQString text(int col) const;
};
@@ -77,8 +77,8 @@ public:
KviLogListViewLog(KviTalListViewItem * par, KviLogFile::KviLogTypes type, KviLogFile * fileData)
: KviLogListViewItem(par,type,fileData){};
~KviLogListViewLog() {};
- virtual QString key ( int column, bool ascending ) const { return m_pFileData->date().toString("yyyy.MM.dd"); };
- virtual QString text(int col) const { return m_pFileData->date().toString("dd.MM.yyyy"); };
+ virtual TQString key ( int column, bool ascending ) const { return m_pFileData->date().toString("yyyy.MM.dd"); };
+ virtual TQString text(int col) const { return m_pFileData->date().toString("dd.MM.yyyy"); };
};