summaryrefslogtreecommitdiffstats
path: root/plugins/logviewer
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
commit1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch)
tree38559cd68cd4f63023fb5f6375def9db3b8b491e /plugins/logviewer
parent894f94545727610df22c4f73911d62d58266f695 (diff)
downloadktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz
ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip
TQt4 port ktorrent
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'plugins/logviewer')
-rw-r--r--plugins/logviewer/logflags.cpp4
-rw-r--r--plugins/logviewer/logflags.h4
-rw-r--r--plugins/logviewer/logprefpage.cpp4
-rw-r--r--plugins/logviewer/logprefpage.h2
-rw-r--r--plugins/logviewer/logprefwidget.cpp12
-rw-r--r--plugins/logviewer/logprefwidget.h3
-rw-r--r--plugins/logviewer/logprefwidgetbase.ui70
-rw-r--r--plugins/logviewer/logviewer.cpp34
-rw-r--r--plugins/logviewer/logviewer.h7
-rw-r--r--plugins/logviewer/logviewerplugin.cpp6
-rw-r--r--plugins/logviewer/logviewerplugin.h5
11 files changed, 77 insertions, 74 deletions
diff --git a/plugins/logviewer/logflags.cpp b/plugins/logviewer/logflags.cpp
index ef1ba69..c6ab95b 100644
--- a/plugins/logviewer/logflags.cpp
+++ b/plugins/logviewer/logflags.cpp
@@ -24,7 +24,7 @@
#include <util/log.h>
#include <torrent/globals.h>
-#include <qstring.h>
+#include <tqstring.h>
using namespace bt;
@@ -137,7 +137,7 @@ namespace kt
m_log = log;
}
- QString& LogFlags::getFormattedMessage(unsigned int arg, QString& line)
+ TQString& LogFlags::getFormattedMessage(unsigned int arg, TQString& line)
{
if( (arg & LOG_ALL) == LOG_ALL)
{
diff --git a/plugins/logviewer/logflags.h b/plugins/logviewer/logflags.h
index 9d7245a..618a020 100644
--- a/plugins/logviewer/logflags.h
+++ b/plugins/logviewer/logflags.h
@@ -20,7 +20,7 @@
#ifndef KTLOGFLAGS_H
#define KTLOGFLAGS_H
-class QString;
+class TQString;
namespace kt
{
@@ -72,7 +72,7 @@ namespace kt
void setLog(LogViewer* log);
///Makes line rich text according to arg level.
- QString& getFormattedMessage(unsigned int arg, QString& line);
+ TQString& getFormattedMessage(unsigned int arg, TQString& line);
private:
LogFlags();
diff --git a/plugins/logviewer/logprefpage.cpp b/plugins/logviewer/logprefpage.cpp
index cc89a68..b49c4ce 100644
--- a/plugins/logviewer/logprefpage.cpp
+++ b/plugins/logviewer/logprefpage.cpp
@@ -46,9 +46,9 @@ namespace kt
return true;
}
- void LogPrefPage::createWidget(QWidget* parent)
+ void LogPrefPage::createWidget(TQWidget* tqparent)
{
- m_widget = new LogPrefWidget(parent);
+ m_widget = new LogPrefWidget(tqparent);
}
void LogPrefPage::updateData()
diff --git a/plugins/logviewer/logprefpage.h b/plugins/logviewer/logprefpage.h
index 3aed61b..cd8e6a8 100644
--- a/plugins/logviewer/logprefpage.h
+++ b/plugins/logviewer/logprefpage.h
@@ -38,7 +38,7 @@ namespace kt
virtual ~LogPrefPage();
virtual bool apply();
- virtual void createWidget(QWidget* parent);
+ virtual void createWidget(TQWidget* tqparent);
virtual void updateData();
virtual void deleteWidget();
diff --git a/plugins/logviewer/logprefwidget.cpp b/plugins/logviewer/logprefwidget.cpp
index 6bf99bd..215bce6 100644
--- a/plugins/logviewer/logprefwidget.cpp
+++ b/plugins/logviewer/logprefwidget.cpp
@@ -24,15 +24,15 @@
#include <kglobal.h>
#include <klocale.h>
-#include <qwidget.h>
-#include <qstring.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
+#include <tqwidget.h>
+#include <tqstring.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
namespace kt
{
- LogPrefWidget::LogPrefWidget(QWidget *parent, const char *name)
- :LogPrefWidgetBase(parent, name)
+ LogPrefWidget::LogPrefWidget(TQWidget *tqparent, const char *name)
+ :LogPrefWidgetBase(tqparent, name)
{
m_sysgen->setCurrentItem(getLevel(LogViewerPluginSettings::sysGEN()));
m_syscon->setCurrentItem(getLevel(LogViewerPluginSettings::sysCON()));
diff --git a/plugins/logviewer/logprefwidget.h b/plugins/logviewer/logprefwidget.h
index 35a6c06..4bb1030 100644
--- a/plugins/logviewer/logprefwidget.h
+++ b/plugins/logviewer/logprefwidget.h
@@ -27,8 +27,9 @@ namespace kt
class LogPrefWidget: public LogPrefWidgetBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- LogPrefWidget(QWidget *parent = 0, const char *name = 0);
+ LogPrefWidget(TQWidget *tqparent = 0, const char *name = 0);
bool apply();
private:
diff --git a/plugins/logviewer/logprefwidgetbase.ui b/plugins/logviewer/logprefwidgetbase.ui
index 76e7124..32ccf61 100644
--- a/plugins/logviewer/logprefwidgetbase.ui
+++ b/plugins/logviewer/logprefwidgetbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>LogPrefWidgetBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>LogPrefWidgetBase</cstring>
</property>
@@ -29,14 +29,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>110</height>
</size>
</property>
</spacer>
- <widget class="QButtonGroup" row="0" column="1">
+ <widget class="TQButtonGroup" row="0" column="1">
<property name="name">
<cstring>buttonGroup2</cstring>
</property>
@@ -47,7 +47,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QComboBox" row="0" column="1">
+ <widget class="TQComboBox" row="0" column="1">
<item>
<property name="text">
<string>All</string>
@@ -77,7 +77,7 @@
<cstring>m_sysipf</cstring>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@@ -88,7 +88,7 @@
<cstring>comboBox1_5</cstring>
</property>
</widget>
- <widget class="QComboBox" row="1" column="1">
+ <widget class="TQComboBox" row="1" column="1">
<item>
<property name="text">
<string>All</string>
@@ -118,7 +118,7 @@
<cstring>m_syssrc</cstring>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel2_2</cstring>
</property>
@@ -129,7 +129,7 @@
<cstring>comboBox1_6</cstring>
</property>
</widget>
- <widget class="QComboBox" row="2" column="1">
+ <widget class="TQComboBox" row="2" column="1">
<item>
<property name="text">
<string>All</string>
@@ -159,7 +159,7 @@
<cstring>m_syspnp</cstring>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>textLabel2_3</cstring>
</property>
@@ -170,7 +170,7 @@
<cstring>comboBox1_7</cstring>
</property>
</widget>
- <widget class="QLabel" row="3" column="0">
+ <widget class="TQLabel" row="3" column="0">
<property name="name">
<cstring>textLabel2_4</cstring>
</property>
@@ -181,7 +181,7 @@
<cstring>comboBox1_8</cstring>
</property>
</widget>
- <widget class="QComboBox" row="3" column="1">
+ <widget class="TQComboBox" row="3" column="1">
<item>
<property name="text">
<string>All</string>
@@ -211,7 +211,7 @@
<cstring>m_syssnf</cstring>
</property>
</widget>
- <widget class="QComboBox" row="4" column="1">
+ <widget class="TQComboBox" row="4" column="1">
<item>
<property name="text">
<string>All</string>
@@ -241,7 +241,7 @@
<cstring>m_sysscd</cstring>
</property>
</widget>
- <widget class="QLabel" row="4" column="0">
+ <widget class="TQLabel" row="4" column="0">
<property name="name">
<cstring>textLabel2_5</cstring>
</property>
@@ -252,7 +252,7 @@
<cstring>comboBox1_9</cstring>
</property>
</widget>
- <widget class="QComboBox" row="5" column="1">
+ <widget class="TQComboBox" row="5" column="1">
<item>
<property name="text">
<string>All</string>
@@ -282,7 +282,7 @@
<cstring>m_syspfi</cstring>
</property>
</widget>
- <widget class="QLabel" row="5" column="0">
+ <widget class="TQLabel" row="5" column="0">
<property name="name">
<cstring>textLabel2_6</cstring>
</property>
@@ -293,7 +293,7 @@
<cstring>comboBox1_10</cstring>
</property>
</widget>
- <widget class="QLabel" row="6" column="0">
+ <widget class="TQLabel" row="6" column="0">
<property name="name">
<cstring>textLabel2_7</cstring>
</property>
@@ -304,7 +304,7 @@
<cstring>comboBox1_11</cstring>
</property>
</widget>
- <widget class="QComboBox" row="6" column="1">
+ <widget class="TQComboBox" row="6" column="1">
<item>
<property name="text">
<string>All</string>
@@ -334,7 +334,7 @@
<cstring>m_sysinw</cstring>
</property>
</widget>
- <widget class="QLabel" row="7" column="0">
+ <widget class="TQLabel" row="7" column="0">
<property name="name">
<cstring>textLabel2_7_2</cstring>
</property>
@@ -345,7 +345,7 @@
<cstring>comboBox1_11</cstring>
</property>
</widget>
- <widget class="QComboBox" row="7" column="1">
+ <widget class="TQComboBox" row="7" column="1">
<item>
<property name="text">
<string>All</string>
@@ -375,7 +375,7 @@
<cstring>m_sysrss</cstring>
</property>
</widget>
- <widget class="QComboBox" row="8" column="1">
+ <widget class="TQComboBox" row="8" column="1">
<item>
<property name="text">
<string>All</string>
@@ -405,7 +405,7 @@
<cstring>m_sysweb</cstring>
</property>
</widget>
- <widget class="QLabel" row="8" column="0">
+ <widget class="TQLabel" row="8" column="0">
<property name="name">
<cstring>textLabel2_7_2_2</cstring>
</property>
@@ -418,7 +418,7 @@
</widget>
</grid>
</widget>
- <widget class="QButtonGroup" row="0" column="0">
+ <widget class="TQButtonGroup" row="0" column="0">
<property name="name">
<cstring>buttonGroup3</cstring>
</property>
@@ -429,7 +429,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -437,7 +437,7 @@
<string>General:</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel2_8</cstring>
</property>
@@ -445,7 +445,7 @@
<string>Connections:</string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>textLabel2_9</cstring>
</property>
@@ -453,7 +453,7 @@
<string>DHT:</string>
</property>
</widget>
- <widget class="QLabel" row="3" column="0">
+ <widget class="TQLabel" row="3" column="0">
<property name="name">
<cstring>textLabel2_10</cstring>
</property>
@@ -461,7 +461,7 @@
<string>Tracker:</string>
</property>
</widget>
- <widget class="QComboBox" row="0" column="1">
+ <widget class="TQComboBox" row="0" column="1">
<item>
<property name="text">
<string>All</string>
@@ -491,7 +491,7 @@
<cstring>m_sysgen</cstring>
</property>
</widget>
- <widget class="QComboBox" row="1" column="1">
+ <widget class="TQComboBox" row="1" column="1">
<item>
<property name="text">
<string>All</string>
@@ -521,7 +521,7 @@
<cstring>m_syscon</cstring>
</property>
</widget>
- <widget class="QComboBox" row="2" column="1">
+ <widget class="TQComboBox" row="2" column="1">
<item>
<property name="text">
<string>All</string>
@@ -551,7 +551,7 @@
<cstring>m_sysdht</cstring>
</property>
</widget>
- <widget class="QLabel" row="4" column="0">
+ <widget class="TQLabel" row="4" column="0">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
@@ -559,7 +559,7 @@
<string>Disk I/O:</string>
</property>
</widget>
- <widget class="QComboBox" row="3" column="1">
+ <widget class="TQComboBox" row="3" column="1">
<item>
<property name="text">
<string>All</string>
@@ -589,7 +589,7 @@
<cstring>m_systrk</cstring>
</property>
</widget>
- <widget class="QComboBox" row="4" column="1">
+ <widget class="TQComboBox" row="4" column="1">
<item>
<property name="text">
<string>All</string>
@@ -621,7 +621,7 @@
</widget>
</grid>
</widget>
- <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2">
+ <widget class="TQButtonGroup" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>buttonGroup3_2</cstring>
</property>
@@ -632,7 +632,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox" row="0" column="0">
+ <widget class="TQCheckBox" row="0" column="0">
<property name="name">
<cstring>m_useRich</cstring>
</property>
@@ -644,5 +644,5 @@
</widget>
</grid>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>
diff --git a/plugins/logviewer/logviewer.cpp b/plugins/logviewer/logviewer.cpp
index 5e6b16c..916af8e 100644
--- a/plugins/logviewer/logviewer.cpp
+++ b/plugins/logviewer/logviewer.cpp
@@ -19,7 +19,7 @@
***************************************************************************/
#include <kglobal.h>
#include <kconfig.h>
-#include <qapplication.h>
+#include <tqapplication.h>
#include "logviewer.h"
#include "logflags.h"
#include "logviewerpluginsettings.h"
@@ -28,33 +28,33 @@ namespace kt
{
const int LOG_EVENT_TYPE = 65432;
- class LogEvent : public QCustomEvent
+ class LogEvent : public TQCustomEvent
{
- QString str;
+ TQString str;
public:
- LogEvent(const QString & str) : QCustomEvent(LOG_EVENT_TYPE),str(str)
+ LogEvent(const TQString & str) : TQCustomEvent(LOG_EVENT_TYPE),str(str)
{}
virtual ~LogEvent()
{}
- const QString & msg() const {return str;}
+ const TQString & msg() const {return str;}
};
- LogViewer::LogViewer(QWidget *parent, const char *name)
- : KTextBrowser(parent, name), LogMonitorInterface()
+ LogViewer::LogViewer(TQWidget *tqparent, const char *name)
+ : KTextBrowser(tqparent, name), LogMonitorInterface()
{
/*
IMPORTANT: use LogText mode, so that setMaxLogLines will work, if not everything will be kept in memory.
*/
- setTextFormat(Qt::LogText);
+ setTextFormat(TQt::LogText);
setMaxLogLines(200);
- setMinimumSize(QSize(0,50));
- setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
+ setMinimumSize(TQSize(0,50));
+ tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
KGlobal::config()->setGroup("LogViewer");
if (KGlobal::config()->hasKey("LogViewerWidgetSize"))
{
- QSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0);
+ TQSize s = KGlobal::config()->readSizeEntry("LogViewerWidgetSize",0);
resize(s);
}
@@ -70,10 +70,10 @@ namespace kt
}
- void LogViewer::message(const QString& line, unsigned int arg)
+ void LogViewer::message(const TQString& line, unsigned int arg)
{
/*
- IMPORTANT: because QTextBrowser is not thread safe, we must use the Qt event mechanism
+ IMPORTANT: because TQTextBrowser is not thread safe, we must use the TQt event mechanism
to add strings to it, this will ensure that strings will only be added in the main application
thread.
*/
@@ -81,19 +81,19 @@ namespace kt
{
if(m_useRichText)
{
- QString tmp = line;
+ TQString tmp = line;
LogEvent* le = new LogEvent(LogFlags::instance().getFormattedMessage(arg, tmp));
- QApplication::postEvent(this,le);
+ TQApplication::postEvent(this,le);
}
else
{
LogEvent* le = new LogEvent(line);
- QApplication::postEvent(this,le);
+ TQApplication::postEvent(this,le);
}
}
}
- void LogViewer::customEvent(QCustomEvent* ev)
+ void LogViewer::customEvent(TQCustomEvent* ev)
{
if (ev->type() == LOG_EVENT_TYPE)
{
diff --git a/plugins/logviewer/logviewer.h b/plugins/logviewer/logviewer.h
index 4198215..ced8bf0 100644
--- a/plugins/logviewer/logviewer.h
+++ b/plugins/logviewer/logviewer.h
@@ -32,12 +32,13 @@ namespace kt
class LogViewer : public KTextBrowser, public LogMonitorInterface
{
Q_OBJECT
+ TQ_OBJECT
public:
- LogViewer(QWidget *parent = 0, const char *name = 0);
+ LogViewer(TQWidget *tqparent = 0, const char *name = 0);
virtual ~LogViewer();
- virtual void message(const QString& line, unsigned int arg);
- virtual void customEvent(QCustomEvent* ev);
+ virtual void message(const TQString& line, unsigned int arg);
+ virtual void customEvent(TQCustomEvent* ev);
void setRichText(bool val);
diff --git a/plugins/logviewer/logviewerplugin.cpp b/plugins/logviewer/logviewerplugin.cpp
index aa35d2f..5df9fac 100644
--- a/plugins/logviewer/logviewerplugin.cpp
+++ b/plugins/logviewer/logviewerplugin.cpp
@@ -40,8 +40,8 @@ K_EXPORT_COMPONENT_FACTORY(ktlogviewerplugin,KGenericFactory<kt::LogViewerPlugin
namespace kt
{
- LogViewerPlugin::LogViewerPlugin(QObject* parent, const char* qt_name, const QStringList& args)
- : Plugin(parent, qt_name, args, NAME,i18n("Log Viewer"), AUTHOR, EMAIL,
+ LogViewerPlugin::LogViewerPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args)
+ : Plugin(tqparent, qt_name, args, NAME,i18n("Log Viewer"), AUTHOR, EMAIL,
i18n("Displays ktorrent logging output"),"log")
{
lv = 0;
@@ -75,7 +75,7 @@ namespace kt
LogFlags::finalize();
}
- bool LogViewerPlugin::versionCheck(const QString & version) const
+ bool LogViewerPlugin::versionCheck(const TQString & version) const
{
return version == KT_VERSION_MACRO;
}
diff --git a/plugins/logviewer/logviewerplugin.h b/plugins/logviewer/logviewerplugin.h
index 9cd5af8..238121f 100644
--- a/plugins/logviewer/logviewerplugin.h
+++ b/plugins/logviewer/logviewerplugin.h
@@ -35,13 +35,14 @@ namespace kt
class LogViewerPlugin : public Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- LogViewerPlugin(QObject* parent, const char* qt_name, const QStringList& args);
+ LogViewerPlugin(TQObject* tqparent, const char* qt_name, const TQStringList& args);
virtual ~LogViewerPlugin();
virtual void load();
virtual void unload();
- virtual bool versionCheck(const QString& version) const;
+ virtual bool versionCheck(const TQString& version) const;
private:
LogViewer* lv;
LogPrefPage* pref;