From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kget/logwindow.cpp | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'kget/logwindow.cpp') diff --git a/kget/logwindow.cpp b/kget/logwindow.cpp index 5d6f77ad..09490134 100644 --- a/kget/logwindow.cpp +++ b/kget/logwindow.cpp @@ -25,8 +25,8 @@ ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -37,25 +37,25 @@ #include "logwindow.h" #include -#include +#include // // Replace regular space with nbsp -// QString replaceSpaces(const QString &str) { -// QString res = str; +// TQString replaceSpaces(const TQString &str) { +// TQString res = str; // res.simplifyWhiteSpace(); // int pos; // while ( (pos = res.find(' ')) != -1) { -// res.replace(pos, 1, new QChar( 0x00a0 ), 1); +// res.replace(pos, 1, new TQChar( 0x00a0 ), 1); // } // return res; // } -static QString removeHTML(const QString & str) +static TQString removeHTML(const TQString & str) { - QString res = str; + TQString res = str; int pos; // replace
with a newline @@ -77,18 +77,18 @@ static QString removeHTML(const QString & str) } -SeparatedLog::SeparatedLog(QWidget * parent):QWidget(parent) +SeparatedLog::SeparatedLog(TQWidget * parent):TQWidget(parent) { idSelected = 0; - QGridLayout *topGridLayout = new QGridLayout(this, 1, 2, 0, KDialog::spacingHint()); + TQGridLayout *topGridLayout = new TQGridLayout(this, 1, 2, 0, KDialog::spacingHint()); topGridLayout->setRowStretch(0, 5); topGridLayout->setColStretch(0, 3); topGridLayout->setColStretch(1, 10); - lv_log = new QListView(this); + lv_log = new TQListView(this); lv_log->setMultiSelection(false); lv_log->setAllColumnsShowFocus(true); lv_log->setSorting(-1); @@ -98,26 +98,26 @@ SeparatedLog::SeparatedLog(QWidget * parent):QWidget(parent) topGridLayout->addWidget(lv_log, 0, 0); - connect(lv_log, SIGNAL(selectionChanged(QListViewItem *)), SLOT(transferSelected(QListViewItem *))); + connect(lv_log, TQT_SIGNAL(selectionChanged(TQListViewItem *)), TQT_SLOT(transferSelected(TQListViewItem *))); - ml_log = new QTextEdit(this); + ml_log = new TQTextEdit(this); ml_log->setTextFormat(LogText); ml_log->setMinimumSize(300, 200); - ml_log->setVScrollBarMode(QScrollView::Auto); - ml_log->setWordWrap(QTextEdit::NoWrap); + ml_log->setVScrollBarMode(TQScrollView::Auto); + ml_log->setWordWrap(TQTextEdit::NoWrap); topGridLayout->addWidget(ml_log, 0, 1); } -void SeparatedLog::addLog(uint id, const QString & filename, const QString & message) +void SeparatedLog::addLog(uint id, const TQString & filename, const TQString & message) { if (!trMap.contains(id)) { trMap.insert(id, message); - QListViewItem *last=lv_log->lastItem(); - new QListViewItem(lv_log, last); + TQListViewItem *last=lv_log->lastItem(); + new TQListViewItem(lv_log, last); last=lv_log->lastItem(); - last->setText(0, QString::number(id)); + last->setText(0, TQString::number(id)); last->setText(1, filename); // if I don't do this, ID#10 gets sorted between ID#1 and ID#2, ugly. } else { @@ -130,7 +130,7 @@ void SeparatedLog::addLog(uint id, const QString & filename, const QString & mes } -void SeparatedLog::transferSelected(QListViewItem * item) +void SeparatedLog::transferSelected(TQListViewItem * item) { if (item) { idSelected = item->text(0).toUInt(); @@ -160,27 +160,27 @@ LogWindow::LogWindow():KDialogBase(Tabbed, i18n("Log Window"), Close, Close, 0, { // add pages - QFrame *page = addPage(i18n("Mixed")); - QVBoxLayout *topLayout = new QVBoxLayout(page, 0, spacingHint()); + TQFrame *page = addPage(i18n("Mixed")); + TQVBoxLayout *topLayout = new TQVBoxLayout(page, 0, spacingHint()); - mixed_log = new QTextEdit(page); + mixed_log = new TQTextEdit(page); mixed_log->setTextFormat(LogText); - mixed_log->setVScrollBarMode(QScrollView::Auto); - mixed_log->setWordWrap(QTextEdit::NoWrap); + mixed_log->setVScrollBarMode(TQScrollView::Auto); + mixed_log->setWordWrap(TQTextEdit::NoWrap); topLayout->addWidget(mixed_log); page = addPage(i18n("Separated")); - topLayout = new QVBoxLayout(page, 0, spacingHint()); + topLayout = new TQVBoxLayout(page, 0, spacingHint()); sep_log = new SeparatedLog(page); topLayout->addWidget(sep_log); - connect(this, SIGNAL(closeClicked()), this, SLOT(close())); + connect(this, TQT_SIGNAL(closeClicked()), this, TQT_SLOT(close())); // resize( 500, 300 ); } -void LogWindow::closeEvent(QCloseEvent *e) +void LogWindow::closeEvent(TQCloseEvent *e) { kmain->m_paShowLog->setChecked(false); kmain->b_viewLogWindow = false; @@ -188,29 +188,29 @@ void LogWindow::closeEvent(QCloseEvent *e) } -void LogWindow::logGeneral(const QString & message) +void LogWindow::logGeneral(const TQString & message) { - QString tmps = "" + QTime::currentTime().toString() + " : " + message + ""; + TQString tmps = "" + TQTime::currentTime().toString() + " : " + message + ""; mixed_log->append(tmps); } -void LogWindow::logTransfer(uint id, const QString & filename, const QString & message) +void LogWindow::logTransfer(uint id, const TQString & filename, const TQString & message) { - QString mixed_msg, single_msg, job_id; + TQString mixed_msg, single_msg, job_id; - job_id = QString("Job[%1] : ").arg(id); - mixed_msg = "" + QTime::currentTime().toString() + " : " + job_id + message; + job_id = TQString("Job[%1] : ").arg(id); + mixed_msg = "" + TQTime::currentTime().toString() + " : " + job_id + message; - single_msg = "" + QTime::currentTime().toString() + " : " + message; + single_msg = "" + TQTime::currentTime().toString() + " : " + message; mixed_log->append(mixed_msg); sep_log->addLog(id, filename, single_msg); } -QString LogWindow::getText() const +TQString LogWindow::getText() const { return removeHTML(mixed_log->text()); } -- cgit v1.2.1