Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.2
kinternet
kinternet_switch_kde_networkstatus.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kinternet_switch_kde_networkstatus.diff of Package kinternet
Index: kinternet/kinternet.cpp =================================================================== --- kinternet/kinternet.cpp (revision 6362) +++ kinternet/kinternet.cpp (working copy) @@ -38,7 +38,6 @@ #include <kaction.h> #include <kprocess.h> #include <dcopclient.h> -#include "serviceiface_stub.h" #else #include <qapplication.h> #endif @@ -53,6 +52,7 @@ #ifndef NOKDE #include "kinternetiface.h" #include "mywallet.h" +#include "networkstatusiface_stub.h" #define NETWORK_NAME "kinternet" #endif @@ -61,9 +61,6 @@ KInternet::KInternet (bool quiet, disp_mode_t disp_mode, QWidget* parent, const char* name) : -#ifndef NOKDE - DCOPObject ("ProviderIface"), -#endif QWidget (parent, name), quiet (quiet), disp_mode (disp_mode), @@ -196,73 +193,16 @@ KInternet::~KInternet () #ifndef NOKDE void KInternet::initNetworkStatus() { - if ( myconfig->readBool("Configuration", "switchKDEnetworkStatus", false) ){ - myservice = new ServiceIface_stub( "kded", "networkstatus" ); + if ( myconfig->readBool("Configuration", "switchKDEnetworkStatus", true) ){ + myservice = new NetworkStatusIface_stub( "kded", "networkstatus" ); // we do only register one network here atm // TODO: we should register every known network different later NetworkStatus::Properties nsp; - nsp.internet = true; // we are the internet, we do mount it ! nsp.name = NETWORK_NAME; - nsp.onDemandPolicy = NetworkStatus::All; nsp.service = kapp->dcopClient()->appId(); nsp.status = NetworkStatus::NoNetworks; - myservice->registerNetwork( NETWORK_NAME, nsp ); - } -} - -// get called by kded network status module -int KInternet::status( const QString & network ) -{ - if ( network != NETWORK_NAME ) - return NetworkStatus::OfflineFailed; - - switch (m_status) - { - case ERROR: - case NOLINK: - return NetworkStatus::OfflineFailed; - - case DISCONNECTED: - case CONNECTING: - return NetworkStatus::Offline; - - case CONNECTED: - case LURKING: - return NetworkStatus::Online; - case DISCONNECTING: - // TOFIX: to be implemented; - return NetworkStatus::Offline; + myservice->registerNetwork( nsp ); } - fprintf( stderr, "ERROR: kinternet: unhandled case in KInternet::status\n" ); - return NetworkStatus::Offline; -} - -int KInternet::establish( const QString & ) -{ - if (myconfig->readBool ("Configuration", "dialinOnApplicationRequest", false)) { - slot_dialin(); - return (int)NetworkStatus::RequestAccepted; - } - return (int)NetworkStatus::UserRefused; -} - -int KInternet::shutdown( const QString & ) -{ - if (myconfig->readBool ("Configuration", "dialinOnApplicationRequest", false)) { - slot_hangup(); - return (int)NetworkStatus::RequestAccepted; - } - return (int)NetworkStatus::UserRefused; -} - -void KInternet::simulateFailure() -{ - // dummy debugging function -} - -void KInternet::simulateDisconnect() -{ - // dummy debugging function } #endif Index: kinternet/kinternet.h =================================================================== --- kinternet/kinternet.h (revision 6362) +++ kinternet/kinternet.h (working copy) @@ -31,7 +31,6 @@ #include <kpopupmenu.h> #include <kconfig.h> #include <kprocess.h> -#include <provideriface.h> #else class ProviderIface { }; #endif @@ -50,11 +49,11 @@ class ProviderIface { }; class KInternetIface; class MyWallet; #ifndef NOKDE -class ServiceIface_stub; +class NetworkStatusIface_stub; #endif -class KInternet : public QWidget, public ProviderIface +class KInternet : public QWidget { Q_OBJECT @@ -82,14 +81,8 @@ public: status_t get_status () const { return m_status; } #ifndef NOKDE - // to get called from the kded networkstatus module - int status( const QString & network ); - int establish( const QString & network ); - int shutdown( const QString & network ); void setDesktopNetworkStatus(); void initNetworkStatus(); - void simulateFailure(); - void simulateDisconnect(); #endif private: @@ -116,7 +109,7 @@ private: void make_submenu_providers (); void set_menu (); #ifndef NOKDE - ServiceIface_stub *myservice; + NetworkStatusIface_stub *myservice; #endif private slots: Index: kinternet/Makefile.am =================================================================== --- kinternet/Makefile.am (revision 6362) +++ kinternet/Makefile.am (working copy) @@ -33,14 +33,12 @@ kinternet_la_SOURCES = \ parse.cpp \ route.cpp \ mywallet.cpp \ - serviceiface.stub \ - provideriface.skel \ + networkstatusiface.stub \ kinternetiface.skel \ wepkey_inputdialog.ui \ wepkeyinputdialog.cpp -serviceiface_DIR = $(includedir) -provideriface_DIR = $(includedir) +networkstatusiface_DIR = $(includedir) kinternet_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor