diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /krdc/vnc | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krdc/vnc')
-rw-r--r-- | krdc/vnc/kvncview.cpp | 132 | ||||
-rw-r--r-- | krdc/vnc/kvncview.h | 52 | ||||
-rw-r--r-- | krdc/vnc/pointerlatencyometer.h | 4 | ||||
-rw-r--r-- | krdc/vnc/threads.cpp | 40 | ||||
-rw-r--r-- | krdc/vnc/threads.h | 42 | ||||
-rw-r--r-- | krdc/vnc/vnchostpref.cpp | 14 | ||||
-rw-r--r-- | krdc/vnc/vnchostpref.h | 8 |
7 files changed, 146 insertions, 146 deletions
diff --git a/krdc/vnc/kvncview.cpp b/krdc/vnc/kvncview.cpp index f734845b..8050a68b 100644 --- a/krdc/vnc/kvncview.cpp +++ b/krdc/vnc/kvncview.cpp @@ -28,13 +28,13 @@ #include <kdialogbase.h> #include <kwallet.h> -#include <qdatastream.h> +#include <tqdatastream.h> #include <dcopclient.h> -#include <qclipboard.h> -#include <qbitmap.h> -#include <qmutex.h> -#include <qvbox.h> -#include <qwaitcondition.h> +#include <tqclipboard.h> +#include <tqbitmap.h> +#include <tqmutex.h> +#include <tqvbox.h> +#include <tqwaitcondition.h> #include "vncviewer.h" @@ -57,21 +57,21 @@ static KVncView *kvncview; //Passwords and KWallet data extern KWallet::Wallet *wallet; bool useKWallet = false; -static QCString password; -static QMutex passwordLock; -static QWaitCondition passwordWaiter; +static TQCString password; +static TQMutex passwordLock; +static TQWaitCondition passwordWaiter; const unsigned int MAX_SELECTION_LENGTH = 4096; -KVncView::KVncView(QWidget *parent, +KVncView::KVncView(TQWidget *parent, const char *name, - const QString &_host, + const TQString &_host, int _port, - const QString &_password, + const TQString &_password, Quality quality, DotCursorState dotCursorState, - const QString &encodings) : + const TQString &encodings) : KRemoteView(parent, name, Qt::WResizeNoErase | Qt::WRepaintNoErase | Qt::WStaticContents), m_cthread(this, m_wthread, m_quitFlag), m_wthread(this, m_quitFlag), @@ -90,18 +90,18 @@ KVncView::KVncView(QWidget *parent, password = _password.latin1(); dpy = qt_xdisplay(); setFixedSize(16,16); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); - m_cb = QApplication::clipboard(); - connect(m_cb, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); - connect(m_cb, SIGNAL(dataChanged()), this, SLOT(clipboardChanged())); + m_cb = TQApplication::clipboard(); + connect(m_cb, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); + connect(m_cb, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(clipboardChanged())); KStandardDirs *dirs = KGlobal::dirs(); - QBitmap cursorBitmap(dirs->findResource("appdata", + TQBitmap cursorBitmap(dirs->findResource("appdata", "pics/pointcursor.png")); - QBitmap cursorMask(dirs->findResource("appdata", + TQBitmap cursorMask(dirs->findResource("appdata", "pics/pointcursormask.png")); - m_cursor = QCursor(cursorBitmap, cursorMask); + m_cursor = TQCursor(cursorBitmap, cursorMask); if ((quality != QUALITY_UNKNOWN) || !encodings.isNull()) @@ -126,18 +126,18 @@ void KVncView::showDotCursorInternal() { setCursor(m_cursor); break; case DOT_CURSOR_OFF: - setCursor(QCursor(Qt::BlankCursor)); + setCursor(TQCursor(Qt::BlankCursor)); break; case DOT_CURSOR_AUTO: if (m_enableClientCursor) - setCursor(QCursor(Qt::BlankCursor)); + setCursor(TQCursor(Qt::BlankCursor)); else setCursor(m_cursor); break; } } -QString KVncView::host() { +TQString KVncView::host() { return m_host; } @@ -155,7 +155,7 @@ bool KVncView::isQuitting() { return m_quitFlag; } -void KVncView::configureApp(Quality q, const QString specialEncodings) { +void KVncView::configureApp(Quality q, const TQString specialEncodings) { appDataConfigured = true; appData.shareDesktop = 1; appData.viewOnly = 0; @@ -203,17 +203,17 @@ bool KVncView::checkLocalKRfb() { DCOPClient *d = KApplication::dcopClient(); int portNum; - QByteArray sdata, rdata; - QCString replyType; - QDataStream arg(sdata, IO_WriteOnly); - arg << QString("krfb"); - if (!d->call ("kded", "kinetd", "port(QString)", sdata, replyType, rdata)) + TQByteArray sdata, rdata; + TQCString replyType; + TQDataStream arg(sdata, IO_WriteOnly); + arg << TQString("krfb"); + if (!d->call ("kded", "kinetd", "port(TQString)", sdata, replyType, rdata)) return true; if (replyType != "int") return true; - QDataStream answer(rdata, IO_ReadOnly); + TQDataStream answer(rdata, IO_ReadOnly); answer >> portNum; if (m_port != portNum) @@ -239,16 +239,16 @@ bool KVncView::editPreferences( HostPrefPtr host ) i18n( "VNC Host Preferences for %1" ).arg( host->host() ), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ); - QVBox *vbox = dlg->makeVBoxMainWidget(); + TQVBox *vbox = dlg->makeVBoxMainWidget(); VncPrefs *prefs = new VncPrefs( vbox ); - QWidget *spacer = new QWidget( vbox ); + TQWidget *spacer = new TQWidget( vbox ); vbox->setStretchFactor( spacer, 10 ); prefs->setQuality( ci ); prefs->setShowPrefs(true); prefs->setUseKWallet(kwallet); - if ( dlg->exec() == QDialog::Rejected ) + if ( dlg->exec() == TQDialog::Rejected ) return false; ci = prefs->quality(); @@ -331,7 +331,7 @@ bool KVncView::startFullscreen() return launch_Fullscreen_vnc; } -QSize KVncView::framebufferSize() { +TQSize KVncView::framebufferSize() { return m_framebufferSize; } @@ -358,7 +358,7 @@ void KVncView::enableScaling(bool s) { } } -void KVncView::paintEvent(QPaintEvent *e) { +void KVncView::paintEvent(TQPaintEvent *e) { drawRegion(e->rect().x(), e->rect().y(), e->rect().width(), @@ -373,7 +373,7 @@ void KVncView::drawRegion(int x, int y, int w, int h) { DrawScreenRegionX11Thread(winId(), x, y, w, h); } -void KVncView::customEvent(QCustomEvent *e) +void KVncView::customEvent(TQCustomEvent *e) { if (e->type() == ScreenRepaintEventType) { ScreenRepaintEvent *sre = (ScreenRepaintEvent*) e; @@ -381,7 +381,7 @@ void KVncView::customEvent(QCustomEvent *e) } else if (e->type() == ScreenResizeEventType) { ScreenResizeEvent *sre = (ScreenResizeEvent*) e; - m_framebufferSize = QSize(sre->width(), sre->height()); + m_framebufferSize = TQSize(sre->width(), sre->height()); setFixedSize(m_framebufferSize); emit changeSize(sre->width(), sre->height()); } @@ -412,7 +412,7 @@ void KVncView::customEvent(QCustomEvent *e) emit showingPasswordDialog(true); if (KPasswordDialog::getPassword(password, i18n("Access to the system requires a password.")) != KPasswordDialog::Accepted) - password = QCString(); + password = TQCString(); emit showingPasswordDialog(false); @@ -421,7 +421,7 @@ void KVncView::customEvent(QCustomEvent *e) passwordLock.unlock(); } else if (e->type() == WalletOpenEventType) { - QString krdc_folder = "KRDC-VNC"; + TQString krdc_folder = "KRDC-VNC"; emit showingPasswordDialog(true); //Bad things happen if you don't do this. // Bugfix: Check if wallet has been closed by an outside source @@ -431,7 +431,7 @@ void KVncView::customEvent(QCustomEvent *e) // Do we need to open the wallet? if ( !wallet ) { - QString walletName = KWallet::Wallet::NetworkWallet(); + TQString walletName = KWallet::Wallet::NetworkWallet(); wallet = KWallet::Wallet::openWallet(walletName); } @@ -443,7 +443,7 @@ void KVncView::customEvent(QCustomEvent *e) if (walletOK == true) { wallet->setFolder(krdc_folder); - QString newPass; + TQString newPass; if ( wallet->hasEntry(kvncview->host()) && !wallet->readPassword(kvncview->host(), newPass) ) { password=newPass.latin1(); } @@ -508,11 +508,11 @@ void KVncView::customEvent(QCustomEvent *e) emit disconnectedError(); } else if (e->type() == BeepEventType) { - QApplication::beep(); + TQApplication::beep(); } else if (e->type() == ServerCutEventType) { ServerCutEvent *sce = (ServerCutEvent*) e; - QString ctext = QString::fromUtf8(sce->bytes(), sce->length()); + TQString ctext = TQString::fromUtf8(sce->bytes(), sce->length()); m_dontSendCb = true; m_cb->setText(ctext, QClipboard::Clipboard); m_cb->setText(ctext, QClipboard::Selection); @@ -527,15 +527,15 @@ void KVncView::customEvent(QCustomEvent *e) } } -void KVncView::mouseEvent(QMouseEvent *e) { +void KVncView::mouseEvent(TQMouseEvent *e) { if (m_status != REMOTE_VIEW_CONNECTED) return; if (m_viewOnly) return; - if ( e->type() != QEvent::MouseMove ) { - if ( (e->type() == QEvent::MouseButtonPress) || - (e->type() == QEvent::MouseButtonDblClick)) { + if ( e->type() != TQEvent::MouseMove ) { + if ( (e->type() == TQEvent::MouseButtonPress) || + (e->type() == TQEvent::MouseButtonDblClick)) { if ( e->button() & LeftButton ) m_buttonMask |= 0x01; if ( e->button() & MidButton ) @@ -543,7 +543,7 @@ void KVncView::mouseEvent(QMouseEvent *e) { if ( e->button() & RightButton ) m_buttonMask |= 0x04; } - else if ( e->type() == QEvent::MouseButtonRelease ) { + else if ( e->type() == TQEvent::MouseButtonRelease ) { if ( e->button() & LeftButton ) m_buttonMask &= 0xfe; if ( e->button() & MidButton ) @@ -566,27 +566,27 @@ void KVncView::mouseEvent(QMouseEvent *e) { DrawCursorX11Thread(x, y); // in rfbproto.c } -void KVncView::mousePressEvent(QMouseEvent *e) { +void KVncView::mousePressEvent(TQMouseEvent *e) { mouseEvent(e); e->accept(); } -void KVncView::mouseDoubleClickEvent(QMouseEvent *e) { +void KVncView::mouseDoubleClickEvent(TQMouseEvent *e) { mouseEvent(e); e->accept(); } -void KVncView::mouseReleaseEvent(QMouseEvent *e) { +void KVncView::mouseReleaseEvent(TQMouseEvent *e) { mouseEvent(e); e->accept(); } -void KVncView::mouseMoveEvent(QMouseEvent *e) { +void KVncView::mouseMoveEvent(TQMouseEvent *e) { mouseEvent(e); e->ignore(); } -void KVncView::wheelEvent(QWheelEvent *e) { +void KVncView::wheelEvent(TQWheelEvent *e) { if (m_status != REMOTE_VIEW_CONNECTED) return; if (m_viewOnly) @@ -643,7 +643,7 @@ bool KVncView::x11Event(XEvent *e) { else if (e->type == KeyRelease) pressed = false; else - return QWidget::x11Event(e); + return TQWidget::x11Event(e); if (!m_viewOnly) { unsigned int s = KKeyNative(e).sym(); @@ -670,8 +670,8 @@ bool KVncView::x11Event(XEvent *e) { } void KVncView::unpressModifiers() { - QValueList<unsigned int> keys = m_mods.keys(); - QValueList<unsigned int>::const_iterator it = keys.begin(); + TQValueList<unsigned int> keys = m_mods.keys(); + TQValueList<unsigned int>::const_iterator it = keys.begin(); while (it != keys.end()) { m_wthread.queueKeyEvent(*it, false); it++; @@ -679,11 +679,11 @@ void KVncView::unpressModifiers() { m_mods.clear(); } -void KVncView::focusOutEvent(QFocusEvent *) { +void KVncView::focusOutEvent(TQFocusEvent *) { unpressModifiers(); } -QSize KVncView::sizeHint() { +TQSize KVncView::sizeHint() { return maximumSize(); } @@ -702,7 +702,7 @@ void KVncView::clipboardChanged() { if (m_cb->ownsClipboard() || m_dontSendCb) return; - QString text = m_cb->text(QClipboard::Clipboard); + TQString text = m_cb->text(QClipboard::Clipboard); if (text.length() > MAX_SELECTION_LENGTH) return; @@ -716,7 +716,7 @@ void KVncView::selectionChanged() { if (m_cb->ownsSelection() || m_dontSendCb) return; - QString text = m_cb->text(QClipboard::Selection); + TQString text = m_cb->text(QClipboard::Selection); if (text.length() > MAX_SELECTION_LENGTH) return; @@ -765,14 +765,14 @@ int getPassword(char *passwd, int pwlen) { //Try #2: Is there something in the wallet? if ( !retV && useKWallet ) { - QApplication::postEvent(kvncview, new WalletOpenEvent()); + TQApplication::postEvent(kvncview, new WalletOpenEvent()); passwordWaiter.wait(&passwordLock); //block if (!password.isNull()) retV = 1; //got it! } //Last try: Ask the user if (!retV) { - QApplication::postEvent(kvncview, new PasswordRequiredEvent()); + TQApplication::postEvent(kvncview, new PasswordRequiredEvent()); passwordWaiter.wait(&passwordLock); //block if (!password.isNull()) retV = 1; //got it! } @@ -800,7 +800,7 @@ extern void DrawScreenRegion(int x, int y, int width, int height) { kvncview->drawRegion(x, y, width, height); KApplication::kApplication()->unlock(); */ - QApplication::postEvent(kvncview, new ScreenRepaintEvent(x, y, width, height)); + TQApplication::postEvent(kvncview, new ScreenRepaintEvent(x, y, width, height)); } // call only from x11 thread! @@ -821,15 +821,15 @@ extern void UnlockFramebuffer() { } extern void beep() { - QApplication::postEvent(kvncview, new BeepEvent()); + TQApplication::postEvent(kvncview, new BeepEvent()); } extern void newServerCut(char *bytes, int length) { - QApplication::postEvent(kvncview, new ServerCutEvent(bytes, length)); + TQApplication::postEvent(kvncview, new ServerCutEvent(bytes, length)); } extern void postMouseEvent(int x, int y, int buttonMask) { - QApplication::postEvent(kvncview, new MouseStateEvent(x, y, buttonMask)); + TQApplication::postEvent(kvncview, new MouseStateEvent(x, y, buttonMask)); } #include "kvncview.moc" diff --git a/krdc/vnc/kvncview.h b/krdc/vnc/kvncview.h index c0f9fba3..a9de2378 100644 --- a/krdc/vnc/kvncview.h +++ b/krdc/vnc/kvncview.h @@ -19,8 +19,8 @@ #define KVNCVIEW_H #include "kremoteview.h" -#include <qcursor.h> -#include <qmap.h> +#include <tqcursor.h> +#include <tqmap.h> #include "pointerlatencyometer.h" #include "hostpreferences.h" @@ -36,54 +36,54 @@ private: ControllerThread m_cthread; WriterThread m_wthread; volatile bool m_quitFlag; // if set: all threads should die ASAP - QMutex m_framebufferLock; + TQMutex m_framebufferLock; bool m_enableFramebufferLocking; bool m_enableClientCursor; - QSize m_framebufferSize; + TQSize m_framebufferSize; bool m_scaling; bool m_remoteMouseTracking; bool m_viewOnly; int m_buttonMask; - QMap<unsigned int,bool> m_mods; + TQMap<unsigned int,bool> m_mods; - QString m_host; + TQString m_host; int m_port; QClipboard *m_cb; bool m_dontSendCb; - QCursor m_cursor; + TQCursor m_cursor; DotCursorState m_cursorState; PointerLatencyOMeter m_plom; - void mouseEvent(QMouseEvent*); - unsigned long toKeySym(QKeyEvent *k); + void mouseEvent(TQMouseEvent*); + unsigned long toKeySym(TQKeyEvent *k); bool checkLocalKRfb(); - void paintMessage(const QString &msg); + void paintMessage(const TQString &msg); void showDotCursorInternal(); void unpressModifiers(); protected: - void paintEvent(QPaintEvent*); - void customEvent(QCustomEvent*); - void mousePressEvent(QMouseEvent*); - void mouseDoubleClickEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void wheelEvent(QWheelEvent *); - void focusOutEvent(QFocusEvent *); + void paintEvent(TQPaintEvent*); + void customEvent(TQCustomEvent*); + void mousePressEvent(TQMouseEvent*); + void mouseDoubleClickEvent(TQMouseEvent*); + void mouseReleaseEvent(TQMouseEvent*); + void mouseMoveEvent(TQMouseEvent*); + void wheelEvent(TQWheelEvent *); + void focusOutEvent(TQFocusEvent *); bool x11Event(XEvent*); public: - KVncView(QWidget* parent=0, const char *name=0, - const QString &host = QString(""), int port = 5900, - const QString &password = QString::null, + KVncView(TQWidget* parent=0, const char *name=0, + const TQString &host = TQString(""), int port = 5900, + const TQString &password = TQString::null, Quality quality = QUALITY_UNKNOWN, DotCursorState dotCursorState = DOT_CURSOR_AUTO, - const QString &encodings = QString::null); + const TQString &encodings = TQString::null); ~KVncView(); - QSize sizeHint(); + TQSize sizeHint(); void drawRegion(int x, int y, int w, int h); void lockFramebuffer(); void unlockFramebuffer(); @@ -91,15 +91,15 @@ public: virtual bool scaling() const; virtual bool supportsScaling() const; virtual bool supportsLocalCursor() const; - virtual QSize framebufferSize(); + virtual TQSize framebufferSize(); void setRemoteMouseTracking(bool s); bool remoteMouseTracking(); - void configureApp(Quality q, const QString specialEncodings = QString::null); + void configureApp(Quality q, const TQString specialEncodings = TQString::null); void showDotCursor(DotCursorState state); DotCursorState dotCursorState() const; virtual void startQuitting(); virtual bool isQuitting(); - virtual QString host(); + virtual TQString host(); virtual int port(); virtual bool start(); diff --git a/krdc/vnc/pointerlatencyometer.h b/krdc/vnc/pointerlatencyometer.h index 559536b2..c380431a 100644 --- a/krdc/vnc/pointerlatencyometer.h +++ b/krdc/vnc/pointerlatencyometer.h @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include <qdatetime.h> +#include <tqdatetime.h> #include <kdebug.h> struct PointerState { int x, y; - QTime timestamp; + TQTime timestamp; }; class PointerLatencyOMeter { diff --git a/krdc/vnc/threads.cpp b/krdc/vnc/threads.cpp index fe5a1d62..ec033388 100644 --- a/krdc/vnc/threads.cpp +++ b/krdc/vnc/threads.cpp @@ -23,7 +23,7 @@ #include "vncviewer.h" #include "threads.h" -#include <qcstring.h> +#include <tqcstring.h> // Maximum idle time for writer thread in ms. When it timeouts, it will request // another incremental update. Must be smaller than the timeout of the server @@ -49,12 +49,12 @@ ControllerThread::ControllerThread(KVncView *v, WriterThread &wt, volatile bool void ControllerThread::changeStatus(RemoteViewStatus s) { m_status = s; - QApplication::postEvent(m_view, new StatusChangeEvent(s)); + TQApplication::postEvent(m_view, new StatusChangeEvent(s)); } void ControllerThread::sendFatalError(ErrorCode s) { m_quitFlag = true; - QApplication::postEvent(m_view, new FatalErrorEvent(s)); + TQApplication::postEvent(m_view, new FatalErrorEvent(s)); m_wthread.kick(); } @@ -109,13 +109,13 @@ void ControllerThread::run() { return; } - QApplication::postEvent(m_view, + TQApplication::postEvent(m_view, new ScreenResizeEvent(si.framebufferWidth, si.framebufferHeight)); - m_wthread.queueUpdateRequest(QRegion(QRect(0,0,si.framebufferWidth, + m_wthread.queueUpdateRequest(TQRegion(TQRect(0,0,si.framebufferWidth, si.framebufferHeight))); - QApplication::postEvent(m_view, new DesktopInitEvent()); + TQApplication::postEvent(m_view, new DesktopInitEvent()); while ((!m_quitFlag) && (!m_desktopInitialized)) m_waiter.wait(1000); @@ -173,7 +173,7 @@ WriterThread::WriterThread(KVncView *v, volatile bool &quitFlag) : m_incrementalUpdateAnnounced(false), m_mouseEventNum(0), m_keyEventNum(0), - m_clientCut(QString::null) + m_clientCut(TQString::null) { writerThread = this; m_lastIncrUpdate.start(); @@ -184,8 +184,8 @@ bool WriterThread::sendIncrementalUpdateRequest() { return SendIncrementalFramebufferUpdateRequest(); } -bool WriterThread::sendUpdateRequest(const QRegion ®ion) { - QMemArray<QRect> r = region.rects(); +bool WriterThread::sendUpdateRequest(const TQRegion ®ion) { + TQMemArray<TQRect> r = region.rects(); for (unsigned int i = 0; i < r.size(); i++) if (!SendFramebufferUpdateRequest(r[i].x(), r[i].y(), @@ -195,8 +195,8 @@ bool WriterThread::sendUpdateRequest(const QRegion ®ion) { return true; } -bool WriterThread::sendInputEvents(const QValueList<InputEvent> &events) { - QValueList<InputEvent>::const_iterator it = events.begin(); +bool WriterThread::sendInputEvents(const TQValueList<InputEvent> &events) { + TQValueList<InputEvent>::const_iterator it = events.begin(); while (it != events.end()) { if ((*it).type == KeyEventType) { if (!SendKeyEvent((*it).e.k.k, (*it).e.k.down ? True : False)) @@ -224,7 +224,7 @@ void WriterThread::announceIncrementalUpdateRequest() { } -void WriterThread::queueUpdateRequest(const QRegion &r) { +void WriterThread::queueUpdateRequest(const TQRegion &r) { m_lock.lock(); m_updateRegionRQ += r; m_waiter.wakeAll(); @@ -283,7 +283,7 @@ void WriterThread::queueKeyEvent(unsigned int k, bool down) { m_lock.unlock(); } -void WriterThread::queueClientCut(const QString &text) { +void WriterThread::queueClientCut(const TQString &text) { m_lock.lock(); m_clientCut = text; @@ -299,9 +299,9 @@ void WriterThread::kick() { void WriterThread::run() { bool incrementalUpdateRQ = false; bool incrementalUpdateAnnounced = false; - QRegion updateRegionRQ; - QValueList<InputEvent> inputEvents; - QString clientCut; + TQRegion updateRegionRQ; + TQValueList<InputEvent> inputEvents; + TQString clientCut; while (!m_quitFlag) { m_lock.lock(); @@ -324,11 +324,11 @@ void WriterThread::run() { else { m_incrementalUpdateRQ = false; m_incrementalUpdateAnnounced = false; - m_updateRegionRQ = QRegion(); + m_updateRegionRQ = TQRegion(); m_inputEvents.clear(); m_keyEventNum = 0; m_mouseEventNum = 0; - m_clientCut = QString::null; + m_clientCut = TQString::null; m_lock.unlock(); // always send incremental update, unless @@ -373,7 +373,7 @@ void WriterThread::run() { break; } if (!clientCut.isNull()) { - QCString cutTextUtf8(clientCut.utf8()); + TQCString cutTextUtf8(clientCut.utf8()); if (!SendClientCutText(cutTextUtf8.data(), (int)cutTextUtf8.length())) { sendFatalError(ERROR_IO); @@ -387,6 +387,6 @@ void WriterThread::run() { void WriterThread::sendFatalError(ErrorCode s) { m_quitFlag = true; - QApplication::postEvent(m_view, new FatalErrorEvent(s)); + TQApplication::postEvent(m_view, new FatalErrorEvent(s)); } diff --git a/krdc/vnc/threads.h b/krdc/vnc/threads.h index 5f38b71f..08ca4c20 100644 --- a/krdc/vnc/threads.h +++ b/krdc/vnc/threads.h @@ -18,14 +18,14 @@ #ifndef THREADS_H #define THREADS_H -#include <qthread.h> -#include <qregion.h> -#include <qrect.h> -#include <qmutex.h> -#include <qwaitcondition.h> -#include <qevent.h> -#include <qvaluelist.h> -#include <qdatetime.h> +#include <tqthread.h> +#include <tqregion.h> +#include <tqrect.h> +#include <tqmutex.h> +#include <tqwaitcondition.h> +#include <tqevent.h> +#include <tqvaluelist.h> +#include <tqdatetime.h> #include <stdlib.h> @@ -58,24 +58,24 @@ struct InputEvent { }; -class WriterThread : public QThread { +class WriterThread : public TQThread { private: - QMutex m_lock; - QWaitCondition m_waiter; + TQMutex m_lock; + TQWaitCondition m_waiter; volatile bool &m_quitFlag; KVncView *m_view; - QTime m_lastIncrUpdate; // start()ed when a incr update is sent + TQTime m_lastIncrUpdate; // start()ed when a incr update is sent bool m_lastIncrUpdatePostponed; // all things that can be send follow: bool m_incrementalUpdateRQ; // for sending an incremental request bool m_incrementalUpdateAnnounced; // set when a RQ will come soon - QRegion m_updateRegionRQ; // for sending updates, null if it is done - QValueList<InputEvent> m_inputEvents; // list of unsent input events + TQRegion m_updateRegionRQ; // for sending updates, null if it is done + TQValueList<InputEvent> m_inputEvents; // list of unsent input events MouseEvent m_lastMouseEvent; int m_mouseEventNum, m_keyEventNum; - QString m_clientCut; + TQString m_clientCut; void sendFatalError(ErrorCode s); @@ -84,29 +84,29 @@ public: void queueIncrementalUpdateRequest(); void announceIncrementalUpdateRequest(); - void queueUpdateRequest(const QRegion &r); + void queueUpdateRequest(const TQRegion &r); void queueMouseEvent(int x, int y, int buttonMask); void queueKeyEvent(unsigned int k, bool down); - void queueClientCut(const QString &text); + void queueClientCut(const TQString &text); void kick(); protected: void run(); bool sendIncrementalUpdateRequest(); - bool sendUpdateRequest(const QRegion &r); - bool sendInputEvents(const QValueList<InputEvent> &events); + bool sendUpdateRequest(const TQRegion &r); + bool sendInputEvents(const TQValueList<InputEvent> &events); }; -class ControllerThread : public QThread { +class ControllerThread : public TQThread { private: KVncView *m_view; enum RemoteViewStatus m_status; WriterThread &m_wthread; volatile bool &m_quitFlag; volatile bool m_desktopInitialized; - QWaitCondition m_waiter; + TQWaitCondition m_waiter; void changeStatus(RemoteViewStatus s); void sendFatalError(ErrorCode s); diff --git a/krdc/vnc/vnchostpref.cpp b/krdc/vnc/vnchostpref.cpp index a17f8ea1..7fea2889 100644 --- a/krdc/vnc/vnchostpref.cpp +++ b/krdc/vnc/vnchostpref.cpp @@ -19,9 +19,9 @@ #include <kconfig.h> #include <klocale.h> -const QString VncHostPref::VncType = "VNC"; +const TQString VncHostPref::VncType = "VNC"; -VncHostPref::VncHostPref(KConfig *conf, const QString &host, const QString &type) : +VncHostPref::VncHostPref(KConfig *conf, const TQString &host, const TQString &type) : HostPref(conf, host, type), m_quality(0), m_useKWallet(true), @@ -35,7 +35,7 @@ void VncHostPref::save() { if ( !m_host.isEmpty() && !m_type.isEmpty() ) { m_config->setGroup("PerHostSettings"); - QString p = prefix(); + TQString p = prefix(); m_config->writeEntry(p+"exists", true); m_config->writeEntry(p+"quality", m_quality); m_config->writeEntry(p+"askOnConnect", m_askOnConnect); @@ -54,7 +54,7 @@ void VncHostPref::load() { if ( !m_host.isEmpty() && !m_type.isEmpty() ) { m_config->setGroup("PerHostSettings"); - QString p = prefix(); + TQString p = prefix(); m_quality = m_config->readNumEntry(p+"quality", 0); m_askOnConnect = m_config->readBoolEntry(p+"askOnConnect", true); m_useKWallet = m_config->readBoolEntry(p+"useKWallet", true); @@ -67,7 +67,7 @@ void VncHostPref::load() { void VncHostPref::remove() { m_config->setGroup("PerHostSettings"); - QString p = prefix(); + TQString p = prefix(); m_config->deleteEntry(p+"exists"); m_config->deleteEntry(p+"quality"); m_config->deleteEntry(p+"askOnConnect"); @@ -80,8 +80,8 @@ void VncHostPref::setDefaults() { m_useKWallet = m_config->readBoolEntry("vncUseKWallet", true); } -QString VncHostPref::prefDescription() const { - QString q; +TQString VncHostPref::prefDescription() const { + TQString q; switch(m_quality) { case 0: q = i18n("High"); diff --git a/krdc/vnc/vnchostpref.h b/krdc/vnc/vnchostpref.h index 33a20600..cfd91053 100644 --- a/krdc/vnc/vnchostpref.h +++ b/krdc/vnc/vnchostpref.h @@ -34,13 +34,13 @@ protected: virtual void remove(); public: - static const QString VncType; + static const TQString VncType; - VncHostPref(KConfig *conf, const QString &host=QString::null, - const QString &type=QString::null); + VncHostPref(KConfig *conf, const TQString &host=TQString::null, + const TQString &type=TQString::null); virtual ~VncHostPref(); - virtual QString prefDescription() const; + virtual TQString prefDescription() const; void setQuality(int q); int quality() const; void setAskOnConnect(bool ask); |