diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/connectionmanager.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
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
Diffstat (limited to 'kopete/libkopete/connectionmanager.cpp')
-rw-r--r-- | kopete/libkopete/connectionmanager.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kopete/libkopete/connectionmanager.cpp b/kopete/libkopete/connectionmanager.cpp index dcfa0ee1..b2e547fa 100644 --- a/kopete/libkopete/connectionmanager.cpp +++ b/kopete/libkopete/connectionmanager.cpp @@ -20,7 +20,7 @@ class ConnectionManagerPrivate }; // Connection manager itself -ConnectionManager::ConnectionManager( TQObject * parent, const char * name ) : DCOPObject( "ConnectionManager" ),TQObject( parent, name ) +ConnectionManager::ConnectionManager( TQObject * tqparent, const char * name ) : DCOPObject( "ConnectionManager" ),TQObject( tqparent, name ) { d = new ConnectionManagerPrivate; @@ -45,19 +45,19 @@ void ConnectionManager::initialise() { // determine initial state and set the state object accordingly. d->m_state = Inactive; - updateStatus(); + updatetqStatus(); } -void ConnectionManager::updateStatus() +void ConnectionManager::updatetqStatus() { - NetworkStatus::EnumStatus daemonStatus = (NetworkStatus::EnumStatus)d->m_stub->status( TQString::null ); + NetworktqStatus::EnumtqStatus daemontqStatus = (NetworktqStatus::EnumtqStatus)d->m_stub->status( TQString() ); kdDebug() << k_funcinfo << endl; - switch ( daemonStatus ) + switch ( daemontqStatus ) { - case NetworkStatus::Offline: - case NetworkStatus::OfflineFailed: - case NetworkStatus::OfflineDisconnected: - case NetworkStatus::ShuttingDown: + case NetworktqStatus::Offline: + case NetworktqStatus::OfflineFailed: + case NetworktqStatus::OfflineDisconnected: + case NetworktqStatus::ShuttingDown: if ( d->m_state == Online ) { kdDebug() << "STATE IS PENDING" << endl; @@ -69,13 +69,13 @@ void ConnectionManager::updateStatus() d->m_state = Offline; } break; - case NetworkStatus::Establishing: - case NetworkStatus::Online: + case NetworktqStatus::Establishing: + case NetworktqStatus::Online: kdDebug() << "STATE IS ONLINE" << endl; d->m_state = Online; break; - case NetworkStatus::NoNetworks: - case NetworkStatus::Unreachable: + case NetworktqStatus::NoNetworks: + case NetworktqStatus::Unreachable: kdDebug() << "STATE IS INACTIVE" << endl; d->m_state = Inactive; break; @@ -87,38 +87,38 @@ ConnectionManager::~ConnectionManager() delete d; } -NetworkStatus::EnumStatus ConnectionManager::status( const TQString & host ) +NetworktqStatus::EnumtqStatus ConnectionManager::status( const TQString & host ) { // need also to check that the daemon hasn't died - updateStatus(); + updatetqStatus(); if ( d->m_state == Pending ) - return NetworkStatus::Offline; + return NetworktqStatus::Offline; if ( d->m_state == Online ) - return NetworkStatus::Online; + return NetworktqStatus::Online; if ( d->m_state == Offline ) - return NetworkStatus::Offline; - return NetworkStatus::NoNetworks; + return NetworktqStatus::Offline; + return NetworktqStatus::NoNetworks; } -NetworkStatus::EnumRequestResult ConnectionManager::requestConnection( TQWidget * mainWidget, const TQString & host, bool userInitiated ) +NetworktqStatus::EnumRequestResult ConnectionManager::requestConnection( TQWidget * mainWidget, const TQString & host, bool userInitiated ) { kdDebug() << k_funcinfo << endl; - NetworkStatus::EnumRequestResult result; + NetworktqStatus::EnumRequestResult result; // if offline and the user has previously indicated they didn't want any new connections, suppress it if ( d->m_state == Offline && !userInitiated && d->m_userInitiatedOnly ) - result = NetworkStatus::UserRefused; + result = NetworktqStatus::UserRefused; // if offline, ask the user whether this connection should be allowed if ( d->m_state == Offline ) { if ( askToConnect( mainWidget ) ) - //result = NetworkStatus::Connected; - result = (NetworkStatus::EnumRequestResult)d->m_stub->request( host, userInitiated ); + //result = NetworktqStatus::Connected; + result = (NetworktqStatus::EnumRequestResult)d->m_stub->request( host, userInitiated ); else - result = NetworkStatus::UserRefused; + result = NetworktqStatus::UserRefused; } // otherwise, just ask for the connection else - result = (NetworkStatus::EnumRequestResult)d->m_stub->request( host, userInitiated ); + result = (NetworktqStatus::EnumRequestResult)d->m_stub->request( host, userInitiated ); return result; } @@ -131,12 +131,12 @@ void ConnectionManager::relinquishConnection( const TQString & host ) void ConnectionManager::slotStatusChanged( TQString host, int status ) { kdDebug() << k_funcinfo << endl; - updateStatus(); + updatetqStatus(); // reset user initiated only flag if we are now online if ( d->m_state == Online ) d->m_userInitiatedOnly = false; - emit statusChanged( host, (NetworkStatus::EnumStatus)status ); + emit statusChanged( host, (NetworktqStatus::EnumtqStatus)status ); } bool ConnectionManager::askToConnect( TQWidget * mainWidget ) @@ -147,7 +147,7 @@ bool ConnectionManager::askToConnect( TQWidget * mainWidget ) i18n("This application is currently in offline mode. Do you want to connect in order to carry out this operation?"), i18n("Leave Offline Mode?"), i18n("Connect"), i18n("Stay Offline"), - TQString::fromLatin1("OfflineModeAlwaysGoOnline") ) == KMessageBox::Yes ); + TQString::tqfromLatin1("OfflineModeAlwaysGoOnline") ) == KMessageBox::Yes ); } #include "connectionmanager.moc" |