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/maindialogwidget.cpp | |
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/maindialogwidget.cpp')
-rw-r--r-- | krdc/maindialogwidget.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/krdc/maindialogwidget.cpp b/krdc/maindialogwidget.cpp index 076fc2f6..09b0de52 100644 --- a/krdc/maindialogwidget.cpp +++ b/krdc/maindialogwidget.cpp @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#include <qregexp.h> -#include <qtimer.h> +#include <tqregexp.h> +#include <tqtimer.h> #include <kcombobox.h> #include <kdebug.h> @@ -32,15 +32,15 @@ #include "hostpreferences.h" #include "maindialogwidget.h" -static const QString DEFAULT_SCOPE = "default"; +static const TQString DEFAULT_SCOPE = "default"; class UrlListViewItem : public KListViewItem { public: - UrlListViewItem( QListView *v, const QString &url, const QString &host, - const QString &protocol, const QString &type, const QString &userid, - const QString &fullname, const QString &desc, - const QString &serviceid ) + UrlListViewItem( TQListView *v, const TQString &url, const TQString &host, + const TQString &protocol, const TQString &type, const TQString &userid, + const TQString &fullname, const TQString &desc, + const TQString &serviceid ) : KListViewItem( v, host, i18n( "unknown" ), host, protocol ), m_url( url ), m_serviceid( serviceid ) { @@ -56,33 +56,33 @@ class UrlListViewItem : public KListViewItem if ( !desc.isNull() ) setText( 0, desc ); if ( ( !userid.isEmpty() ) && ( !fullname.isEmpty() ) ) - setText( 0, QString( "%1 (%2)" ).arg( fullname ).arg( userid ) ); + setText( 0, TQString( "%1 (%2)" ).arg( fullname ).arg( userid ) ); else if ( !userid.isNull() ) setText( 0, userid ); else if ( !fullname.isNull() ) setText( 0, fullname ); } - QString url() + TQString url() { return m_url; } - const QString& serviceid() const + const TQString& serviceid() const { return m_serviceid; } protected: - QString m_url; - QString m_serviceid; + TQString m_url; + TQString m_serviceid; }; -MainDialogWidget::MainDialogWidget( QWidget *parent, const char *name ) +MainDialogWidget::MainDialogWidget( TQWidget *parent, const char *name ) : MainDialogBase( parent, name ), m_scanning( false ) { HostPreferences *hp = HostPreferences::instance(); - QStringList list; + TQStringList list; list = hp->serverCompletions(); m_serverInput->completionObject()->setItems( list ); @@ -92,26 +92,26 @@ MainDialogWidget::MainDialogWidget( QWidget *parent, const char *name ) m_searchInput->setTrapReturnKey( true ); connect( m_browsingView, - SIGNAL( selectionChanged( QListViewItem * ) ), - SLOT( itemSelected( QListViewItem * ) ) ); + TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + TQT_SLOT( itemSelected( TQListViewItem * ) ) ); connect( m_browsingView, - SIGNAL( doubleClicked( QListViewItem *, const QPoint &, int ) ), - SLOT( itemDoubleClicked( QListViewItem * ) ) ); + TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT( itemDoubleClicked( TQListViewItem * ) ) ); connect( m_scopeCombo, - SIGNAL( activated( const QString & ) ), - SLOT( scopeSelected( const QString & ) ) ); + TQT_SIGNAL( activated( const TQString & ) ), + TQT_SLOT( scopeSelected( const TQString & ) ) ); connect( m_serverInput, - SIGNAL( returnPressed( const QString & ) ), - SLOT( rescan() ) ); + TQT_SIGNAL( returnPressed( const TQString & ) ), + TQT_SLOT( rescan() ) ); bool showBrowse = hp->showBrowsingPanel(); enableBrowsingArea( showBrowse ); - m_locator_dnssd = new DNSSD::ServiceBrowser(QStringList::split(',',"_rfb._tcp,_rdp._tcp"),0,DNSSD::ServiceBrowser::AutoResolve); - connect(m_locator_dnssd,SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)), - SLOT(addedService(DNSSD::RemoteService::Ptr))); - connect(m_locator_dnssd,SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)), - SLOT(removedService(DNSSD::RemoteService::Ptr))); + m_locator_dnssd = new DNSSD::ServiceBrowser(TQStringList::split(',',"_rfb._tcp,_rdp._tcp"),0,DNSSD::ServiceBrowser::AutoResolve); + connect(m_locator_dnssd,TQT_SIGNAL(serviceAdded(DNSSD::RemoteService::Ptr)), + TQT_SLOT(addedService(DNSSD::RemoteService::Ptr))); + connect(m_locator_dnssd,TQT_SIGNAL(serviceRemoved(DNSSD::RemoteService::Ptr)), + TQT_SLOT(removedService(DNSSD::RemoteService::Ptr))); m_locator_dnssd->startBrowse(); adjustSize(); @@ -125,7 +125,7 @@ MainDialogWidget::~MainDialogWidget() void MainDialogWidget::save() { HostPreferences *hp = HostPreferences::instance(); - QStringList list; + TQStringList list; m_serverInput->addToHistory( m_serverInput->currentText() ); list = m_serverInput->completionObject()->items(); @@ -136,21 +136,21 @@ void MainDialogWidget::save() hp->setShowBrowsingPanel( m_browsingPanel->isVisible() ); } -void MainDialogWidget::setRemoteHost( const QString &host ) +void MainDialogWidget::setRemoteHost( const TQString &host ) { m_serverInput->setEditText( host ); } -QString MainDialogWidget::remoteHost() +TQString MainDialogWidget::remoteHost() { return m_serverInput->currentText(); } -void MainDialogWidget::hostChanged( const QString &text ) +void MainDialogWidget::hostChanged( const TQString &text ) { - emit hostValid(text.contains(QRegExp(":[0-9]+$")) || - text.contains(QRegExp("^vnc:/.+")) || - text.contains(QRegExp("^rdp:/.+"))); + emit hostValid(text.contains(TQRegExp(":[0-9]+$")) || + text.contains(TQRegExp("^vnc:/.+")) || + text.contains(TQRegExp("^rdp:/.+"))); } void MainDialogWidget::toggleBrowsingArea() @@ -179,31 +179,31 @@ void MainDialogWidget::enableBrowsingArea( bool enable ) setMinimumSize(minimumSize().width(), (h > 0) ? h : 0); resize(width(), height()-hOffset); - QTimer::singleShot( 0, parentWidget(), SLOT( adjustSize() ) ); + TQTimer::singleShot( 0, parentWidget(), TQT_SLOT( adjustSize() ) ); } if (enable) rescan(); } -void MainDialogWidget::itemSelected( QListViewItem *item ) +void MainDialogWidget::itemSelected( TQListViewItem *item ) { UrlListViewItem *u = ( UrlListViewItem* ) item; - QRegExp rx( "^service:remotedesktop\\.kde:([^;]*)" ); + TQRegExp rx( "^service:remotedesktop\\.kde:([^;]*)" ); if ( rx.search( u->url() ) < 0 ) m_serverInput->setCurrentText( u->url()); else m_serverInput->setCurrentText( rx.cap( 1 ) ); } -void MainDialogWidget::itemDoubleClicked( QListViewItem *item ) +void MainDialogWidget::itemDoubleClicked( TQListViewItem *item ) { itemSelected( item ); emit accept(); } -void MainDialogWidget::scopeSelected( const QString &scope ) +void MainDialogWidget::scopeSelected( const TQString &scope ) { - QString s = scope; + TQString s = scope; if ( s == i18n( "default" ) ) s = DEFAULT_SCOPE; @@ -215,7 +215,7 @@ void MainDialogWidget::scopeSelected( const QString &scope ) void MainDialogWidget::rescan() { - QStringList scopeList; + TQStringList scopeList; if ( m_scanning ) return; @@ -227,9 +227,9 @@ void MainDialogWidget::rescan() m_browsingView->clear(); - QString filter; + TQString filter; if ( !m_searchInput->text().stripWhiteSpace().isEmpty() ) { - QString ef = KServiceLocator::escapeFilter( + TQString ef = KServiceLocator::escapeFilter( m_searchInput->text().stripWhiteSpace() ); filter = "(|(|(description=*"+ef+"*)(username=*"+ef+"*))(fullname=*"+ef+"*))"; } @@ -259,12 +259,12 @@ bool MainDialogWidget::ensureLocatorOpen() return false; } - connect( m_locator, SIGNAL( foundService( QString,int ) ), - SLOT( foundService( QString,int ) ) ); - connect( m_locator, SIGNAL( lastServiceSignal( bool ) ), - SLOT( lastSignalServices( bool ) ) ); - connect( m_locator, SIGNAL( foundScopes( QStringList ) ), - SLOT( foundScopes( QStringList ) ) ); + connect( m_locator, TQT_SIGNAL( foundService( TQString,int ) ), + TQT_SLOT( foundService( TQString,int ) ) ); + connect( m_locator, TQT_SIGNAL( lastServiceSignal( bool ) ), + TQT_SLOT( lastSignalServices( bool ) ) ); + connect( m_locator, TQT_SIGNAL( foundScopes( TQStringList ) ), + TQT_SLOT( foundScopes( TQStringList ) ) ); return true; } @@ -283,18 +283,18 @@ void MainDialogWidget::finishScanning() m_scanning = false; } -void MainDialogWidget::foundService( QString url, int ) +void MainDialogWidget::foundService( TQString url, int ) { - QRegExp rx( "^service:remotedesktop\\.kde:(\\w+)://([^;]+);(.*)$" ); + TQRegExp rx( "^service:remotedesktop\\.kde:(\\w+)://([^;]+);(.*)$" ); if ( rx.search( url ) < 0 ) { - rx = QRegExp( "^service:remotedesktop\\.kde:(\\w+)://(.*)$" ); + rx = TQRegExp( "^service:remotedesktop\\.kde:(\\w+)://(.*)$" ); if ( rx.search( url ) < 0 ) return; } - QMap<QString,QString> map; + TQMap<TQString,TQString> map; KServiceLocator::parseAttributeList( rx.cap( 3 ), map ); new UrlListViewItem( m_browsingView, url, rx.cap( 2 ), rx.cap( 1 ), @@ -307,9 +307,9 @@ void MainDialogWidget::foundService( QString url, int ) void MainDialogWidget::addedService( DNSSD::RemoteService::Ptr service ) { -QString type = service->type().mid(1,3); +TQString type = service->type().mid(1,3); if (type == "rfb") type = "vnc"; -QString url = type+"://"+service->hostName()+":"+QString::number(service->port()); +TQString url = type+"://"+service->hostName()+":"+TQString::number(service->port()); new UrlListViewItem( m_browsingView, url, service->serviceName(), type.upper(),service->textData()["type"], service->textData()["u"],service->textData()["fullname"], @@ -318,7 +318,7 @@ new UrlListViewItem( m_browsingView, url, service->serviceName(), void MainDialogWidget::removedService( DNSSD::RemoteService::Ptr service ) { - QListViewItemIterator it( m_browsingView ); + TQListViewItemIterator it( m_browsingView ); while ( it.current() ) { if ( ((UrlListViewItem*)it.current())->serviceid() == service->serviceName()+service->domain() ) delete it.current(); @@ -342,7 +342,7 @@ void MainDialogWidget::lastSignalServices( bool success ) } } -void MainDialogWidget::foundScopes( QStringList scopeList ) +void MainDialogWidget::foundScopes( TQStringList scopeList ) { int di = scopeList.findIndex( DEFAULT_SCOPE ); if ( di >= 0 ) |