diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kcontrol/view1394 | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/view1394')
-rw-r--r-- | kcontrol/view1394/view1394.cpp | 72 | ||||
-rw-r--r-- | kcontrol/view1394/view1394.h | 22 |
2 files changed, 47 insertions, 47 deletions
diff --git a/kcontrol/view1394/view1394.cpp b/kcontrol/view1394/view1394.cpp index 87089b321..b178e07e3 100644 --- a/kcontrol/view1394/view1394.cpp +++ b/kcontrol/view1394/view1394.cpp @@ -18,11 +18,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlistview.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlistview.h> +#include <tqfile.h> +#include <tqtextstream.h> #include <kdialog.h> #include <kglobal.h> @@ -58,7 +58,7 @@ int my_reset_handler(raw1394handle_t handle, unsigned int ) } -View1394::View1394(QWidget *parent, const char *name) +View1394::View1394(TQWidget *parent, const char *name) :KCModule(parent,name) ,m_insideRescanBus(false) { @@ -79,15 +79,15 @@ View1394::View1394(QWidget *parent, const char *name) setButtons( KCModule::Help ); m_ouiDb=new OuiDb(); - QVBoxLayout *box=new QVBoxLayout(this, 0, KDialog::spacingHint()); + TQVBoxLayout *box=new TQVBoxLayout(this, 0, KDialog::spacingHint()); m_view=new View1394Widget(this); for (int i=2; i<8; i++) m_view->m_listview->setColumnAlignment(i, AlignHCenter); m_view->m_listview->setColumnAlignment(8, AlignRight); m_view->m_listview->setColumnAlignment(9, AlignRight); box->addWidget(m_view); - connect(m_view->m_busResetPb, SIGNAL(clicked()), this, SLOT(generateBusReset())); - connect(&m_rescanTimer, SIGNAL(timeout()), this, SLOT(rescanBus())); + connect(m_view->m_busResetPb, TQT_SIGNAL(clicked()), this, TQT_SLOT(generateBusReset())); + connect(&m_rescanTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(rescanBus())); m_notifiers.setAutoDelete(true); rescanBus(); } @@ -143,7 +143,7 @@ bool View1394::readConfigRom(raw1394handle_t handle, nodeid_t nodeid, quadlet_t& void View1394::callRaw1394EventLoop(int fd) { - for (QValueList<raw1394handle_t>::iterator it= m_handles.begin(); it!=m_handles.end(); ++it) + for (TQValueList<raw1394handle_t>::iterator it= m_handles.begin(); it!=m_handles.end(); ++it) if (raw1394_get_fd(*it)==fd) { raw1394_loop_iterate(*it); @@ -162,7 +162,7 @@ void View1394::rescanBus() // static int depth=0; // depth++; m_notifiers.clear(); - for (QValueList<raw1394handle_t>::iterator it=m_handles.begin(); it!=m_handles.end(); ++it) + for (TQValueList<raw1394handle_t>::iterator it=m_handles.begin(); it!=m_handles.end(); ++it) raw1394_destroy_handle(*it); m_handles.clear(); m_view->m_listview->clear(); @@ -188,12 +188,12 @@ void View1394::rescanBus() } raw1394_set_userdata(handle, this); raw1394_set_bus_reset_handler(handle, my_reset_handler); - QSocketNotifier *notif=new QSocketNotifier(raw1394_get_fd(handle),QSocketNotifier::Read); - connect(notif, SIGNAL(activated(int)), this, SLOT(callRaw1394EventLoop(int))); + TQSocketNotifier *notif=new TQSocketNotifier(raw1394_get_fd(handle),TQSocketNotifier::Read); + connect(notif, TQT_SIGNAL(activated(int)), this, TQT_SLOT(callRaw1394EventLoop(int))); m_notifiers.append(notif); m_handles.append(handle); - QListViewItem *card=new QListViewItem(m_view->m_listview,i18n("Port %1:\"%2\"").arg(i).arg(p_info[i].name)); + TQListViewItem *card=new TQListViewItem(m_view->m_listview,i18n("Port %1:\"%2\"").arg(i).arg(p_info[i].name)); int num_of_nodes=raw1394_get_nodecount(handle); int localNodeId=raw1394_get_local_id(handle); @@ -206,34 +206,34 @@ void View1394::rescanBus() quadlet_t cap=0; bool success=readConfigRom(handle, j, firstQuad, cap, guid); - QString nodeStr=i18n("Node %1").arg(j); + TQString nodeStr=i18n("Node %1").arg(j); if (!success) { - new QListViewItem(card,nodeStr, i18n("Not ready")); + new TQListViewItem(card,nodeStr, i18n("Not ready")); continue; } if (((firstQuad>>24) & 0xff)==1) //minimal config rom { - QString guidStr=QString::number(firstQuad,16); + TQString guidStr=TQString::number(firstQuad,16); guidStr="0x"+guidStr.rightJustify(6,'0'); - new QListViewItem(card,nodeStr, guidStr); + new TQListViewItem(card,nodeStr, guidStr); } else //general config rom { - QString guidStr; + TQString guidStr; char buf[32]; snprintf(buf, 32, "%"PRIX64, guid); guidStr=buf; guidStr="0x"+guidStr.rightJustify(16,'0'); - QString local=((j | 0xffc0) == localNodeId)?"X":""; - QString irmStr=(cap & 0x80000000) ? "X":""; - QString cmStr=(cap & 0x40000000) ? "X":""; - QString isStr=(cap & 0x20000000) ? "X":""; - QString bmStr=(cap & 0x10000000) ? "X":""; - QString pmStr=(cap & 0x08000000) ? "X":""; - QString accStr=QString::number((cap &0x00ff0000)>>16); + TQString local=((j | 0xffc0) == localNodeId)?"X":""; + TQString irmStr=(cap & 0x80000000) ? "X":""; + TQString cmStr=(cap & 0x40000000) ? "X":""; + TQString isStr=(cap & 0x20000000) ? "X":""; + TQString bmStr=(cap & 0x10000000) ? "X":""; + TQString pmStr=(cap & 0x08000000) ? "X":""; + TQString accStr=TQString::number((cap &0x00ff0000)>>16); int speed=( cap & 0x00000007); - QString speedStr; + TQString speedStr; switch(speed) { case(3): @@ -250,7 +250,7 @@ void View1394::rescanBus() speedStr="100"; break; } - QListViewItem* node=new QListViewItem(card); + TQListViewItem* node=new TQListViewItem(card); node->setText(0,nodeStr); node->setText(1, guidStr); node->setText(2,local); @@ -272,21 +272,21 @@ void View1394::rescanBus() void View1394::generateBusReset() { - for (QValueList<raw1394handle_t>::iterator it=m_handles.begin(); it!=m_handles.end(); ++it) + for (TQValueList<raw1394handle_t>::iterator it=m_handles.begin(); it!=m_handles.end(); ++it) raw1394_reset_bus(*it); } OuiDb::OuiDb() { - QString filename=locate("data","kcmview1394/oui.db"); + TQString filename=locate("data","kcmview1394/oui.db"); if (filename.isEmpty()) return; - QFile f(filename); + TQFile f(filename); if (!f.open(IO_ReadOnly)) return; - QByteArray ba=f.readAll(); + TQByteArray ba=f.readAll(); int bytesLeft=ba.size(); char* data=ba.data(); while(bytesLeft>8) @@ -306,12 +306,12 @@ OuiDb::OuiDb() f.close(); } -QString OuiDb::vendor(octlet_t guid) +TQString OuiDb::vendor(octlet_t guid) { guid=(guid & 0xffffff0000000000LL)>>40; - QString key=QString::number((unsigned int)(guid),16); + TQString key=TQString::number((unsigned int)(guid),16); key=key.rightJustify(6, '0').upper(); - QString v=m_vendorIds[key]; + TQString v=m_vendorIds[key]; if (v.isEmpty()) v=i18n("Unknown"); return v; @@ -324,7 +324,7 @@ QString OuiDb::vendor(octlet_t guid) extern "C" { - KDE_EXPORT KCModule *create_view1394(QWidget *parent, const char *name) + KDE_EXPORT KCModule *create_view1394(TQWidget *parent, const char *name) { KGlobal::locale()->insertCatalogue("kcmview1394"); return new View1394(parent, name); diff --git a/kcontrol/view1394/view1394.h b/kcontrol/view1394/view1394.h index b328363b4..24a68de8a 100644 --- a/kcontrol/view1394/view1394.h +++ b/kcontrol/view1394/view1394.h @@ -23,11 +23,11 @@ #include <kcmodule.h> -#include <qmap.h> -#include <qsocketnotifier.h> -#include <qstring.h> -#include <qtimer.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqsocketnotifier.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqvaluelist.h> #include "view1394widget.h" @@ -37,16 +37,16 @@ class OuiDb { public: OuiDb(); - QString vendor(octlet_t guid); + TQString vendor(octlet_t guid); private: - QMap<QString, QString> m_vendorIds; + TQMap<TQString, TQString> m_vendorIds; }; class View1394: public KCModule { Q_OBJECT public: - View1394(QWidget *parent = 0L, const char *name = 0L); + View1394(TQWidget *parent = 0L, const char *name = 0L); virtual ~View1394(); public slots: // Public slots @@ -55,11 +55,11 @@ class View1394: public KCModule private: View1394Widget *m_view; - QValueList<raw1394handle_t> m_handles; - QPtrList<QSocketNotifier> m_notifiers; + TQValueList<raw1394handle_t> m_handles; + TQPtrList<TQSocketNotifier> m_notifiers; bool readConfigRom(raw1394handle_t handle, nodeid_t nodeid, quadlet_t& firstQuad, quadlet_t& cap, octlet_t& guid); bool m_insideRescanBus; - QTimer m_rescanTimer; + TQTimer m_rescanTimer; OuiDb *m_ouiDb; private slots: void callRaw1394EventLoop(int fd); |