summaryrefslogtreecommitdiffstats
path: root/noatun/modules/infrared
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /noatun/modules/infrared
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/infrared')
-rw-r--r--noatun/modules/infrared/infrared.cpp12
-rw-r--r--noatun/modules/infrared/infrared.h4
-rw-r--r--noatun/modules/infrared/irprefs.cpp96
-rw-r--r--noatun/modules/infrared/irprefs.h14
-rw-r--r--noatun/modules/infrared/lirc.cpp38
-rw-r--r--noatun/modules/infrared/lirc.h22
6 files changed, 93 insertions, 93 deletions
diff --git a/noatun/modules/infrared/infrared.cpp b/noatun/modules/infrared/infrared.cpp
index 60ea145c..c9b31230 100644
--- a/noatun/modules/infrared/infrared.cpp
+++ b/noatun/modules/infrared/infrared.cpp
@@ -6,7 +6,7 @@
#include <noatun/app.h>
#include <klocale.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include "infrared.h"
#include "lirc.h"
@@ -22,18 +22,18 @@ extern "C"
InfraRed::InfraRed()
- : QObject(),
+ : TQObject(),
Plugin()
{
NOATUNPLUGINC(InfraRed);
m_lirc = new Lirc(this);
connect(m_lirc,
- SIGNAL(commandReceived(const QString &, const QString &, int)),
- SLOT(slotCommand(const QString &, const QString &, int)));
+ TQT_SIGNAL(commandReceived(const TQString &, const TQString &, int)),
+ TQT_SLOT(slotCommand(const TQString &, const TQString &, int)));
IRPrefs::s_lirc = m_lirc;
volume=0;
- QTimer::singleShot(0, this, SLOT(start()));
+ TQTimer::singleShot(0, this, TQT_SLOT(start()));
}
InfraRed::~InfraRed()
@@ -45,7 +45,7 @@ void InfraRed::start()
new IRPrefs(this);
}
-void InfraRed::slotCommand(const QString &remote, const QString &button, int repeat)
+void InfraRed::slotCommand(const TQString &remote, const TQString &button, int repeat)
{
switch (IRPrefs::actionFor(remote, button, repeat))
{
diff --git a/noatun/modules/infrared/infrared.h b/noatun/modules/infrared/infrared.h
index 37e97735..870efbd5 100644
--- a/noatun/modules/infrared/infrared.h
+++ b/noatun/modules/infrared/infrared.h
@@ -8,7 +8,7 @@
class NoatunPreferences;
class Lirc;
-class InfraRed : public QObject, public Plugin
+class InfraRed : public TQObject, public Plugin
{
Q_OBJECT
NOATUNPLUGIND
@@ -17,7 +17,7 @@ public:
~InfraRed();
private slots:
- void slotCommand(const QString &, const QString &, int);
+ void slotCommand(const TQString &, const TQString &, int);
void start();
diff --git a/noatun/modules/infrared/irprefs.cpp b/noatun/modules/infrared/irprefs.cpp
index 409fa94e..548fd27d 100644
--- a/noatun/modules/infrared/irprefs.cpp
+++ b/noatun/modules/infrared/irprefs.cpp
@@ -1,7 +1,7 @@
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
#include <noatun/app.h>
#include <kdialog.h>
@@ -17,17 +17,17 @@
class CommandItem : public QListViewItem
{
public:
- CommandItem(QListViewItem *remote, const QString &name,
+ CommandItem(TQListViewItem *remote, const TQString &name,
IRPrefs::Action action, int interval)
- : QListViewItem(remote, name, IRPrefs::actionName(action),
- interval ? QString().setNum(interval) : QString::null),
+ : TQListViewItem(remote, name, IRPrefs::actionName(action),
+ interval ? TQString().setNum(interval) : TQString::null),
m_name(remote->text(0) + "::" + name),
m_action(action),
m_interval(interval)
{
}
- const QString &name() const { return m_name; }
+ const TQString &name() const { return m_name; }
IRPrefs::Action action() const { return m_action; }
int interval() const { return m_interval; }
void setAction(IRPrefs::Action action)
@@ -37,44 +37,44 @@ public:
}
void setInterval(int interval)
{
- setText(2, interval ? QString().setNum(interval) : QString::null);
+ setText(2, interval ? TQString().setNum(interval) : TQString::null);
m_interval = interval;
}
private:
- QString m_name;
+ TQString m_name;
IRPrefs::Action m_action;
int m_interval;
};
Lirc *IRPrefs::s_lirc = 0;
bool IRPrefs::s_configRead = false;
-QMap<QString, IRPrefs::Command> IRPrefs::s_commands;
+TQMap<TQString, IRPrefs::Command> IRPrefs::s_commands;
-IRPrefs::IRPrefs(QObject *parent)
+IRPrefs::IRPrefs(TQObject *parent)
: CModule(i18n("Infrared Control"), i18n("Configure Infrared Commands"), "remote", parent)
{
- QGridLayout *layout = new QGridLayout(this, 3, 5, KDialog::marginHint(), KDialog::spacingHint());
+ TQGridLayout *layout = new TQGridLayout(this, 3, 5, KDialog::marginHint(), KDialog::spacingHint());
layout->setColStretch(1, 1);
- QLabel *label = new QLabel(i18n("Remote control &commands:"), this);
+ TQLabel *label = new TQLabel(i18n("Remote control &commands:"), this);
layout->addMultiCellWidget(label, 0, 0, 0, 4);
label->setBuddy(m_commands = new KListView(this));
layout->addMultiCellWidget(m_commands, 1, 1, 0, 4);
- label = new QLabel(i18n("&Action:"), this);
+ label = new TQLabel(i18n("&Action:"), this);
layout->addWidget(label, 2, 0);
label->setBuddy(m_action = new KComboBox(this));
m_action->setEnabled(false);
layout->addWidget(m_action, 2, 1);
- m_repeat = new QCheckBox(i18n("&Repeat"), this);
+ m_repeat = new TQCheckBox(i18n("&Repeat"), this);
m_repeat->setEnabled(false);
layout->addWidget(m_repeat, 2, 2);
- label = new QLabel(i18n("&Interval:"), this);
+ label = new TQLabel(i18n("&Interval:"), this);
layout->addWidget(label, 2, 3);
label->setBuddy(m_interval = new KIntSpinBox(this));
@@ -84,19 +84,19 @@ IRPrefs::IRPrefs(QObject *parent)
m_interval->setEnabled(false);
layout->addWidget(m_interval, 2, 4);
- connect(s_lirc, SIGNAL(remotesRead()), SLOT(reopen()));
+ connect(s_lirc, TQT_SIGNAL(remotesRead()), TQT_SLOT(reopen()));
connect(m_commands,
- SIGNAL(selectionChanged(QListViewItem *)),
- SLOT(slotCommandSelected(QListViewItem *)));
+ TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ TQT_SLOT(slotCommandSelected(TQListViewItem *)));
connect(m_action,
- SIGNAL(activated(int)),
- SLOT(slotActionActivated(int)));
+ TQT_SIGNAL(activated(int)),
+ TQT_SLOT(slotActionActivated(int)));
connect(m_repeat,
- SIGNAL(toggled(bool)),
- SLOT(slotRepeatToggled(bool)));
+ TQT_SIGNAL(toggled(bool)),
+ TQT_SLOT(slotRepeatToggled(bool)));
connect(m_interval,
- SIGNAL(valueChanged(int)),
- SLOT(slotIntervalChanged(int)));
+ TQT_SIGNAL(valueChanged(int)),
+ TQT_SLOT(slotIntervalChanged(int)));
reopen();
}
@@ -107,11 +107,11 @@ void IRPrefs::save()
KConfigGroupSaver groupSaver(c, "Infrared");
c->writeEntry("CommandCount", s_commands.count());
int i = 1;
- for (QMap<QString, Command>::ConstIterator it = s_commands.begin(); it != s_commands.end(); ++it)
+ for (TQMap<TQString, Command>::ConstIterator it = s_commands.begin(); it != s_commands.end(); ++it)
{
- c->writePathEntry(QString("Command_%1").arg(i), it.key());
- c->writeEntry(QString("Action_%1").arg(i), (int)((*it).action));
- c->writeEntry(QString("Interval_%1").arg(i), (*it).interval);
+ c->writePathEntry(TQString("Command_%1").arg(i), it.key());
+ c->writeEntry(TQString("Action_%1").arg(i), (int)((*it).action));
+ c->writeEntry(TQString("Interval_%1").arg(i), (*it).interval);
++i;
}
}
@@ -120,7 +120,7 @@ void IRPrefs::reopen()
{
readConfig();
- QStringList remotes = s_lirc->remotes();
+ TQStringList remotes = s_lirc->remotes();
m_commands->clear();
while (m_commands->columns()) m_commands->removeColumn(0);
if (!remotes.count())
@@ -129,13 +129,13 @@ void IRPrefs::reopen()
m_commands->setSorting(-1);
if (s_lirc->isConnected())
{
- new QListViewItem(m_commands, i18n("You do not have any remote control configured."));
- new QListViewItem(m_commands, i18n("Please make sure lirc is setup correctly."));
+ new TQListViewItem(m_commands, i18n("You do not have any remote control configured."));
+ new TQListViewItem(m_commands, i18n("Please make sure lirc is setup correctly."));
}
else
{
- new QListViewItem(m_commands, i18n("Connection could not be established."));
- new QListViewItem(m_commands, i18n("Please make sure lirc is setup correctly and lircd is running."));
+ new TQListViewItem(m_commands, i18n("Connection could not be established."));
+ new TQListViewItem(m_commands, i18n("Please make sure lirc is setup correctly and lircd is running."));
}
m_commands->setEnabled(false);
return;
@@ -145,13 +145,13 @@ void IRPrefs::reopen()
m_commands->addColumn(i18n("Action"));
m_commands->addColumn(i18n("Interval"));
m_commands->setSorting(0);
- for (QStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it)
+ for (TQStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it)
{
- QListViewItem *remote = new QListViewItem(m_commands, *it);
- const QStringList &buttons = s_lirc->buttons(*it);
- for (QStringList::ConstIterator btn = buttons.begin(); btn != buttons.end(); ++btn)
+ TQListViewItem *remote = new TQListViewItem(m_commands, *it);
+ const TQStringList &buttons = s_lirc->buttons(*it);
+ for (TQStringList::ConstIterator btn = buttons.begin(); btn != buttons.end(); ++btn)
{
- QString key = *it + "::" + *btn;
+ TQString key = *it + "::" + *btn;
if (s_commands.contains(key))
new CommandItem(remote, *btn, s_commands[key].action, s_commands[key].interval);
else
@@ -163,7 +163,7 @@ void IRPrefs::reopen()
m_action->clear();
for (int i = 0; ; ++i)
{
- QString action = actionName((Action)i);
+ TQString action = actionName((Action)i);
if (action.isNull())
break;
if (action.isEmpty())
@@ -175,7 +175,7 @@ void IRPrefs::reopen()
}
-void IRPrefs::slotCommandSelected(QListViewItem *item)
+void IRPrefs::slotCommandSelected(TQListViewItem *item)
{
CommandItem *cmd = dynamic_cast<CommandItem *>(item);
if (cmd)
@@ -242,12 +242,12 @@ void IRPrefs::slotIntervalChanged(int value)
s_commands[cmd->name()].interval = cmd->interval();
}
-const QString IRPrefs::actionName(Action action)
+const TQString IRPrefs::actionName(Action action)
{
switch (action)
{
case None:
- return QString("");
+ return TQString("");
case Play:
return i18n("Play");
case Stop:
@@ -275,7 +275,7 @@ const QString IRPrefs::actionName(Action action)
case PreviousSection:
return i18n("Previous Section");
}
- return QString::null;
+ return TQString::null;
}
void IRPrefs::readConfig()
@@ -288,14 +288,14 @@ void IRPrefs::readConfig()
for (int i = 1; i <= count; ++i)
{
Command cmd;
- cmd.action = (Action)(c->readNumEntry(QString("Action_%1").arg(i)));
- cmd.interval = c->readNumEntry(QString("Interval_%1").arg(i));
- s_commands.insert(c->readPathEntry(QString("Command_%1").arg(i)), cmd);
+ cmd.action = (Action)(c->readNumEntry(TQString("Action_%1").arg(i)));
+ cmd.interval = c->readNumEntry(TQString("Interval_%1").arg(i));
+ s_commands.insert(c->readPathEntry(TQString("Command_%1").arg(i)), cmd);
}
s_configRead = true;
}
-IRPrefs::Action IRPrefs::actionFor(const QString &remote, const QString &button, int repeat)
+IRPrefs::Action IRPrefs::actionFor(const TQString &remote, const TQString &button, int repeat)
{
readConfig();
Command cmd = s_commands[remote + "::" + button];
diff --git a/noatun/modules/infrared/irprefs.h b/noatun/modules/infrared/irprefs.h
index 7f813ac8..1d7196a9 100644
--- a/noatun/modules/infrared/irprefs.h
+++ b/noatun/modules/infrared/irprefs.h
@@ -2,7 +2,7 @@
#ifndef _IRPREFS_H_
#define _IRPREFS_H_
-#include <qmap.h>
+#include <tqmap.h>
#include <noatun/pref.h>
class QCheckBox;
@@ -24,19 +24,19 @@ public:
NextSection, PreviousSection
};
- IRPrefs(QObject *parent);
+ IRPrefs(TQObject *parent);
virtual void save();
- static const QString actionName(Action);
- static Action actionFor(const QString &, const QString &, int);
+ static const TQString actionName(Action);
+ static Action actionFor(const TQString &, const TQString &, int);
public slots:
static Lirc *s_lirc;
private slots:
virtual void reopen();
- void slotCommandSelected(QListViewItem *);
+ void slotCommandSelected(TQListViewItem *);
void slotActionActivated(int);
void slotRepeatToggled(bool);
void slotIntervalChanged(int);
@@ -46,7 +46,7 @@ private:
KListView *m_commands;
KComboBox *m_action;
- QCheckBox *m_repeat;
+ TQCheckBox *m_repeat;
KIntSpinBox *m_interval;
struct Command
@@ -55,7 +55,7 @@ private:
int interval;
};
static bool s_configRead;
- static QMap<QString, Command> s_commands;
+ static TQMap<TQString, Command> s_commands;
};
#endif
diff --git a/noatun/modules/infrared/lirc.cpp b/noatun/modules/infrared/lirc.cpp
index 857c07e2..657172d5 100644
--- a/noatun/modules/infrared/lirc.cpp
+++ b/noatun/modules/infrared/lirc.cpp
@@ -4,7 +4,7 @@
#include <sys/socket.h>
#include <errno.h>
-#include <qsocket.h>
+#include <tqsocket.h>
#include <kdebug.h>
#include <klocale.h>
@@ -12,8 +12,8 @@
#include "lirc.h"
-Lirc::Lirc(QObject *parent)
- : QObject(parent),
+Lirc::Lirc(TQObject *parent)
+ : TQObject(parent),
m_socket(0)
{
int sock = ::socket(PF_UNIX, SOCK_STREAM, 0);
@@ -34,7 +34,7 @@ Lirc::Lirc(QObject *parent)
m_socket = new QSocket;
m_socket->setSocket(sock);
- connect(m_socket, SIGNAL(readyRead()), SLOT(slotRead()));
+ connect(m_socket, TQT_SIGNAL(readyRead()), TQT_SLOT(slotRead()));
update();
}
@@ -43,9 +43,9 @@ Lirc::~Lirc()
delete m_socket;
}
-const QStringList Lirc::remotes() const
+const TQStringList Lirc::remotes() const
{
- QStringList result;
+ TQStringList result;
for (Remotes::ConstIterator it = m_remotes.begin(); it != m_remotes.end(); ++it)
result.append(it.key());
result.sort();
@@ -56,7 +56,7 @@ void Lirc::slotRead()
{
while (m_socket->bytesAvailable())
{
- QString line = readLine();
+ TQString line = readLine();
if (line == "BEGIN")
{
// BEGIN
@@ -84,7 +84,7 @@ void Lirc::slotRead()
while (!line.isEmpty() && line != "END");
return;
}
- QStringList remotes;
+ TQStringList remotes;
int count = readLine().toInt();
for (int i = 0; i < count; ++i)
remotes.append(readLine());
@@ -92,7 +92,7 @@ void Lirc::slotRead()
while (!line.isEmpty() && line != "END");
if (line.isEmpty())
return; // abort on corrupt data
- for (QStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it)
+ for (TQStringList::ConstIterator it = remotes.begin(); it != remotes.end(); ++it)
sendCommand("LIST " + *it);
return;
}
@@ -105,13 +105,13 @@ void Lirc::slotRead()
while (!line.isEmpty() && line != "END");
return;
}
- QString remote = line.mid(5);
- QStringList buttons;
+ TQString remote = line.mid(5);
+ TQStringList buttons;
int count = readLine().toInt();
for (int i = 0; i < count; ++i)
{
// <code> <name>
- QString btn = readLine();
+ TQString btn = readLine();
buttons.append(btn.mid(17));
}
m_remotes.insert(remote, buttons);
@@ -136,7 +136,7 @@ void Lirc::slotRead()
pos = line.find(' ');
if (pos < 0)
return;
- QString btn = line.left(pos);
+ TQString btn = line.left(pos);
line.remove(0, pos + 1);
emit commandReceived(line, btn, repeat);
@@ -150,22 +150,22 @@ void Lirc::update()
sendCommand("LIST");
}
-const QString Lirc::readLine()
+const TQString Lirc::readLine()
{
if (!m_socket->bytesAvailable())
- return QString::null;
+ return TQString::null;
- QString line = m_socket->readLine();
+ TQString line = m_socket->readLine();
if (line.isEmpty())
- return QString::null;
+ return TQString::null;
line.remove(line.length() - 1, 1);
return line;
}
-void Lirc::sendCommand(const QString &command)
+void Lirc::sendCommand(const TQString &command)
{
- QString cmd = command + "\n";
+ TQString cmd = command + "\n";
m_socket->writeBlock(cmd.latin1(), cmd.length());
}
diff --git a/noatun/modules/infrared/lirc.h b/noatun/modules/infrared/lirc.h
index e5380c5c..de9665fd 100644
--- a/noatun/modules/infrared/lirc.h
+++ b/noatun/modules/infrared/lirc.h
@@ -2,13 +2,13 @@
#ifndef _LIRC_H_
#define _LIRC_H_
-#include <qobject.h>
-#include <qstringlist.h>
-#include <qmap.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
class QSocket;
-typedef QMap<QString, QStringList> Remotes;
+typedef TQMap<TQString, TQStringList> Remotes;
class Lirc : public QObject
{
@@ -17,7 +17,7 @@ public:
/**
* Constructor
*/
- Lirc(QObject *parent);
+ Lirc(TQObject *parent);
/**
* Destructor
*/
@@ -30,12 +30,12 @@ public:
/**
* The names of the remote configured controls
*/
- const QStringList remotes() const;
+ const TQStringList remotes() const;
/**
* The names of the buttons for the specified
* remote control
*/
- const QStringList buttons(const QString &remote) const
+ const TQStringList buttons(const TQString &remote) const
{
return m_remotes[remote];
}
@@ -56,18 +56,18 @@ signals:
* The repeat counter starts with 0 and increases
* every time this signal is emitted.
*/
- void commandReceived(const QString &, const QString &, int);
+ void commandReceived(const TQString &, const TQString &, int);
private slots:
void slotRead();
private:
void update();
- const QString readLine();
- void sendCommand(const QString &);
+ const TQString readLine();
+ void sendCommand(const TQString &);
private:
- QSocket *m_socket;
+ TQSocket *m_socket;
Remotes m_remotes;
};