From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: TQt4 port kdenetwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- krdc/rdp/krdpview.cpp | 34 +++++++++++++++---------------- krdc/rdp/krdpview.h | 16 ++++++++------- krdc/rdp/rdesktop.patch | 4 ++-- krdc/rdp/rdphostpref.cpp | 12 +++++------ krdc/rdp/rdphostpref.h | 24 +++++++++++----------- krdc/rdp/rdpprefs.ui | 52 ++++++++++++++++++++++++------------------------ krdc/rdp/rdpprefs.ui.h | 2 +- 7 files changed, 73 insertions(+), 71 deletions(-) (limited to 'krdc/rdp') diff --git a/krdc/rdp/krdpview.cpp b/krdc/rdp/krdpview.cpp index 2fdbdab8..4462cca3 100644 --- a/krdc/rdp/krdpview.cpp +++ b/krdc/rdp/krdpview.cpp @@ -45,8 +45,8 @@ extern KWallet::Wallet *wallet; static KRdpView *krdpview; -RdpContainer::RdpContainer(TQWidget *parent, const char *name, WFlags f) : - QXEmbed(parent, name, f), +RdpContainer::RdpContainer(TQWidget *tqparent, const char *name, WFlags f) : + QXEmbed(tqparent, name, f), m_viewOnly(false) { } @@ -82,12 +82,12 @@ bool RdpContainer::x11Event(XEvent *e) // constructor -KRdpView::KRdpView(TQWidget *parent, const char *name, +KRdpView::KRdpView(TQWidget *tqparent, const char *name, const TQString &host, int port, const TQString &user, const TQString &password, int flags, const TQString &domain, const TQString &shell, const TQString &directory) : - KRemoteView(parent, name, Qt::WResizeNoErase | Qt::WRepaintNoErase | Qt::WStaticContents), + KRemoteView(tqparent, name, TQt::WResizeNoErase | TQt::WRepaintNoErase | TQt::WStaticContents), m_name(name), m_host(host), m_port(port), @@ -120,13 +120,13 @@ KRdpView::~KRdpView() // returns the size of the framebuffer TQSize KRdpView::framebufferSize() { - return m_container->sizeHint(); + return m_container->tqsizeHint(); } // returns the suggested size -TQSize KRdpView::sizeHint() +TQSize KRdpView::tqsizeHint() { - return maximumSize(); + return tqmaximumSize(); } // start closing the connection @@ -164,12 +164,12 @@ bool KRdpView::editPreferences( HostPrefPtr host ) int wv = hp->width(); int hv = hp->height(); int cd = hp->colorDepth(); - TQString kl = hp->layout(); + TQString kl = hp->tqlayout(); bool kwallet = hp->useKWallet(); // show preferences dialog KDialogBase *dlg = new KDialogBase( 0L, "dlg", true, - i18n( "RDP Host Preferences for %1" ).arg( host->host() ), + i18n( "RDP Host Preferences for %1" ).tqarg( host->host() ), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ); TQVBox *vbox = dlg->makeVBoxMainWidget(); @@ -209,7 +209,7 @@ bool KRdpView::start() SmartPtr hp, rdpDefaults; bool useKWallet = false; - TQWidget *desktop = TQApplication::desktop(); + TQWidget *desktop = TQT_TQWIDGET(TQApplication::desktop()); if(!rdpAppDataConfigured) { @@ -228,7 +228,7 @@ bool KRdpView::start() m_container->show(); - m_process = new KProcess(m_container); + m_process = new KProcess(TQT_TQOBJECT(m_container)); *m_process << "rdesktop"; // Check for fullscreen mode if ((hp->width() == 0) && (hp->height() == 0)) { @@ -243,7 +243,7 @@ bool KRdpView::start() *m_process << "-g" << (TQString::number(hp->width()) + "x" + TQString::number(hp->height())); } } - *m_process << "-k" << hp->layout(); + *m_process << "-k" << hp->tqlayout(); if(!m_user.isEmpty()) { *m_process << "-u" << m_user; } if(m_password.isEmpty() && useKWallet ) { @@ -303,7 +303,7 @@ bool KRdpView::start() return false; } - setStatus(REMOTE_VIEW_CONNECTING); + settqStatus(REMOTE_VIEW_CONNECTING); return true; } @@ -340,9 +340,9 @@ void KRdpView::setViewOnly(bool s) void KRdpView::connectionOpened(WId /*window*/) { - TQSize size = m_container->sizeHint(); + TQSize size = m_container->tqsizeHint(); - setStatus(REMOTE_VIEW_CONNECTED); + settqStatus(REMOTE_VIEW_CONNECTED); setFixedSize(size); m_container->setFixedSize(size); emit changeSize(size.width(), size.height()); @@ -353,7 +353,7 @@ void KRdpView::connectionOpened(WId /*window*/) void KRdpView::connectionClosed() { emit disconnected(); - setStatus(REMOTE_VIEW_DISCONNECTED); + settqStatus(REMOTE_VIEW_DISCONNECTED); m_quitFlag = true; } @@ -361,7 +361,7 @@ void KRdpView::processDied(KProcess */*proc*/) { if(m_status == REMOTE_VIEW_CONNECTING) { - setStatus(REMOTE_VIEW_DISCONNECTED); + settqStatus(REMOTE_VIEW_DISCONNECTED); if(m_clientVersion.isEmpty()) { KMessageBox::error(0, i18n("Connection attempt to host failed."), diff --git a/krdc/rdp/krdpview.h b/krdc/rdp/krdpview.h index b115bd18..c0df50e7 100644 --- a/krdc/rdp/krdpview.h +++ b/krdc/rdp/krdpview.h @@ -34,11 +34,12 @@ class KRdpView; class RdpContainer : public QXEmbed { Q_OBJECT + TQ_OBJECT friend class KRdpView; public: - RdpContainer(TQWidget *parent = 0, const char *name = 0, WFlags f = 0); + RdpContainer(TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0); ~RdpContainer(); signals: @@ -55,19 +56,20 @@ class RdpContainer : public QXEmbed class KRdpView : public KRemoteView { Q_OBJECT + TQ_OBJECT public: // constructor and destructor - KRdpView(TQWidget *parent = 0, const char *name = 0, - const TQString &host = TQString::null, int port = TCP_PORT_RDP, - const TQString &user = TQString::null, const TQString &password = TQString::null, - int flags = RDP_LOGON_NORMAL, const TQString &domain = TQString::null, - const TQString &shell = TQString::null, const TQString &directory = TQString::null); + KRdpView(TQWidget *tqparent = 0, const char *name = 0, + const TQString &host = TQString(), int port = TCP_PORT_RDP, + const TQString &user = TQString(), const TQString &password = TQString(), + int flags = RDP_LOGON_NORMAL, const TQString &domain = TQString(), + const TQString &shell = TQString(), const TQString &directory = TQString()); virtual ~KRdpView(); // functions regarding the window virtual TQSize framebufferSize(); // returns the size of the remote view - TQSize sizeHint(); // returns the suggested size + TQSize tqsizeHint(); // returns the suggested size virtual bool viewOnly(); virtual bool startFullscreen(); diff --git a/krdc/rdp/rdesktop.patch b/krdc/rdp/rdesktop.patch index a027799c..ddee1c86 100644 --- a/krdc/rdp/rdesktop.patch +++ b/krdc/rdp/rdesktop.patch @@ -68,9 +68,9 @@ + if ( g_embed_wnd ) + { -+ XReparentWindow(g_display, g_wnd, g_embed_wnd, 0, 0); ++ XRetqparentWindow(g_display, g_wnd, g_embed_wnd, 0, 0); + } + - input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | + input_tqmask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | VisibilityChangeMask | FocusChangeMask; diff --git a/krdc/rdp/rdphostpref.cpp b/krdc/rdp/rdphostpref.cpp index ba876146..00ce88d7 100644 --- a/krdc/rdp/rdphostpref.cpp +++ b/krdc/rdp/rdphostpref.cpp @@ -48,7 +48,7 @@ void RdpHostPref::save() m_config->writeEntry(p+"width", m_width); m_config->writeEntry(p+"height", m_height); m_config->writeEntry(p+"colorDepth", m_colorDepth); - m_config->writeEntry(p+"layout", m_layout); + m_config->writeEntry(p+"tqlayout", m_layout); m_config->writeEntry(p+"askOnConnect", m_askOnConnect); m_config->writeEntry(p+"useKWallet", m_useKWallet); } @@ -73,7 +73,7 @@ void RdpHostPref::load() m_width = m_config->readNumEntry(p+"width", 0); m_height = m_config->readNumEntry(p+"height", 0); m_colorDepth = m_config->readNumEntry(p+"colorDepth", 24); - m_layout = m_config->readEntry(p+"layout", "en-us"); + m_layout = m_config->readEntry(p+"tqlayout", "en-us"); m_askOnConnect = m_config->readBoolEntry(p+"askOnConnect", true); m_useKWallet = m_config->readBoolEntry(p+"useKWallet", true); } @@ -91,7 +91,7 @@ void RdpHostPref::remove() m_config->deleteEntry(p+"width"); m_config->deleteEntry(p+"height"); m_config->deleteEntry(p+"colorDepth"); - m_config->deleteEntry(p+"layout"); + m_config->deleteEntry(p+"tqlayout"); m_config->deleteEntry(p+"askOnConnect"); m_config->deleteEntry(p+"useKWallet"); } @@ -110,8 +110,8 @@ void RdpHostPref::setDefaults() TQString RdpHostPref::prefDescription() const { return i18n("Show Preferences: %1, Resolution: %2x%3, Color Depth: %4, Keymap: %5, KWallet: %6") - .arg(m_askOnConnect ? i18n("yes") : i18n("no")).arg(m_width).arg(m_height) - .arg(m_colorDepth).arg(m_layout).arg(m_useKWallet ? i18n("yes") : i18n("no")); + .tqarg(m_askOnConnect ? i18n("yes") : i18n("no")).tqarg(m_width).tqarg(m_height) + .tqarg(m_colorDepth).tqarg(m_layout).tqarg(m_useKWallet ? i18n("yes") : i18n("no")); } void RdpHostPref::setWidth(int w) @@ -154,7 +154,7 @@ void RdpHostPref::setLayout(const TQString &l) save(); } -TQString RdpHostPref::layout() const +TQString RdpHostPref::tqlayout() const { return m_layout; } diff --git a/krdc/rdp/rdphostpref.h b/krdc/rdp/rdphostpref.h index 6044f261..11f490ec 100644 --- a/krdc/rdp/rdphostpref.h +++ b/krdc/rdp/rdphostpref.h @@ -60,29 +60,29 @@ static const int rdpDefaultKeymap = 6; // en-us inline int keymap2int(const TQString &keymap) { - int layout; - for(layout = 0; layout < rdpNumKeymaps; layout++) + int tqlayout; + for(tqlayout = 0; tqlayout < rdpNumKeymaps; tqlayout++) { - if(keymap == rdpKeymaps[layout]) + if(keymap == rdpKeymaps[tqlayout]) { break; } } - if(layout == rdpNumKeymaps) + if(tqlayout == rdpNumKeymaps) { - layout = rdpDefaultKeymap; + tqlayout = rdpDefaultKeymap; } - return layout; + return tqlayout; } -inline TQString int2keymap(int layout) +inline TQString int2keymap(int tqlayout) { - if(layout < 0 || layout >= rdpNumKeymaps) + if(tqlayout < 0 || tqlayout >= rdpNumKeymaps) { return rdpKeymaps[rdpDefaultKeymap]; } - return rdpKeymaps[layout]; + return rdpKeymaps[tqlayout]; } class RdpHostPref : public HostPref @@ -105,8 +105,8 @@ class RdpHostPref : public HostPref public: static const TQString RdpType; - RdpHostPref(KConfig *conf, const TQString &host=TQString::null, - const TQString &type=TQString::null); + RdpHostPref(KConfig *conf, const TQString &host=TQString(), + const TQString &type=TQString()); virtual ~RdpHostPref(); virtual TQString prefDescription() const; @@ -117,7 +117,7 @@ class RdpHostPref : public HostPref void setColorDepth(int depth); int colorDepth() const; void setLayout(const TQString &l); - TQString layout() const; + TQString tqlayout() const; void setAskOnConnect(bool ask); bool askOnConnect() const; bool useKWallet() const; diff --git a/krdc/rdp/rdpprefs.ui b/krdc/rdp/rdpprefs.ui index 0e607b90..6c05ee60 100644 --- a/krdc/rdp/rdpprefs.ui +++ b/krdc/rdp/rdpprefs.ui @@ -1,6 +1,6 @@ RdpPrefs - + RdpPrefs @@ -19,7 +19,7 @@ 0 - + rdpGroupBox @@ -40,14 +40,14 @@ Fixed - + 70 21 - + Small (640x480) @@ -84,7 +84,7 @@ 0 - + 280 0 @@ -97,7 +97,7 @@ Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you. - + spinWidth @@ -114,7 +114,7 @@ This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above. - + heightLabel @@ -124,14 +124,14 @@ H&eight: - + AlignVCenter|AlignRight spinHeight - + spinHeight @@ -148,7 +148,7 @@ This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above. - + Arabic (ar) @@ -325,7 +325,7 @@ 0 - + 280 0 @@ -338,12 +338,12 @@ 4 - Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server. + Use this to specify your keyboard tqlayout. This tqlayout setting is used to send the correct keyboard codes to the server. - + - layoutLabel + tqlayoutLabel @@ -354,13 +354,13 @@ - &Keyboard layout: + &Keyboard tqlayout: cmbKbLayout - + cbUseKWallet @@ -374,7 +374,7 @@ Enable this option to store your passwords with KWallet. - + resolutionLabel @@ -393,7 +393,7 @@ cmbResolution - + colorDepthLabel @@ -412,7 +412,7 @@ cmbKbLayout - + widthLabel @@ -422,14 +422,14 @@ &Width: - + AlignVCenter|AlignRight spinWidth - + Low Color (8 Bit) @@ -451,7 +451,7 @@ - + cbShowPrefs @@ -490,11 +490,11 @@ kdialog.h rdpprefs.ui.h - + resolutionChanged( int selection ) colorDepth() setColorDepth( int depth ) - + setRdpWidth( int w ) rdpWidth() @@ -509,6 +509,6 @@ setUseKWallet( bool b ) useKWallet() - - + + diff --git a/krdc/rdp/rdpprefs.ui.h b/krdc/rdp/rdpprefs.ui.h index 295ea5a8..8e091cf8 100644 --- a/krdc/rdp/rdpprefs.ui.h +++ b/krdc/rdp/rdpprefs.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ -- cgit v1.2.1