@ -1922,7 +1922,7 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() {
}
}
# ifdef DEBUG_NETWORK_MANAGER_COMMUNICATIONS
# ifdef DEBUG_NETWORK_MANAGER_COMMUNICATIONS
printf ( " [network-manager comm debug] %s \n " , ( * it ) . data( ) ) ; fflush ( stdout ) ;
printf ( " [network-manager comm debug] %s \n " , ( * it ) . local8Bit( ) . data( ) ) ; fflush ( stdout ) ;
# endif // DEBUG_NETWORK_MANAGER_COMMUNICATIONS
# endif // DEBUG_NETWORK_MANAGER_COMMUNICATIONS
// Obtain connection settings from the path specified
// Obtain connection settings from the path specified
@ -4941,34 +4941,39 @@ TDENetworkVPNTypeList TDENetworkConnectionManager_BackendNM::availableVPNTypes()
TDENetworkVPNTypeList ret ;
TDENetworkVPNTypeList ret ;
// Query NetworkManager to verify plugin availability before claiming support for a VPN type
// Query NetworkManager to verify plugin availability before claiming support for a VPN type
TQDir serviceDir ( NM_PLUGIN_SERVICE_DIR , TQString ( ) , TQDir : : Name | TQDir : : IgnoreCase , TQDir : : Files ) ;
// Look in the LIB directory first, since that seems to be where plugins are stored nowadays.
TQStringList services = serviceDir . entryList ( ) . grep ( " .name " , true ) ;
TQDir libServiceDir ( NM_PLUGIN_SERVICE_DIR_LIB , " *.name " , TQDir : : Name | TQDir : : IgnoreCase , TQDir : : Files ) ;
TQDir etcServiceDir ( NM_PLUGIN_SERVICE_DIR_ETC , " *.name " , TQDir : : Name | TQDir : : IgnoreCase , TQDir : : Files ) ;
if ( services . count ( ) > 0 ) {
TQStringList services = libServiceDir . entryList ( ) + etcServiceDir . entryList ( ) ;
// read in all available Services
size_t libEntryCount = libServiceDir . count ( ) ;
for ( TQStringList : : Iterator i = services . begin ( ) ; i ! = services . end ( ) ; + + i ) {
TQString service = NM_PLUGIN_SERVICE_DIR + TQString ( " / " ) + * i ;
// Read in all services.
TDEConfig * tdeconfig = new TDEConfig ( service , true , true , " config " ) ;
for ( size_t i = 0 ; i < services . count ( ) ; + + i )
tdeconfig - > setGroup ( " VPN Connection " ) ;
{
TQString fileName = TQString ( " %1/ " ) . arg ( i < libEntryCount ? NM_PLUGIN_SERVICE_DIR_LIB : NM_PLUGIN_SERVICE_DIR_ETC ) + services [ i ] ;
TQString serviceName = tdeconfig - > readEntry ( " name " , TQString ( ) ) ;
TDEConfig * config = new TDEConfig ( fileName , true , true , " config " ) ;
serviceName = serviceName . lower ( ) ;
config - > setGroup ( " VPN Connection " ) ;
if ( serviceName = = " openvpn " ) {
ret . append ( TDENetworkVPNType : : OpenVPN ) ;
}
if ( serviceName = = " pptp " ) {
ret . append ( TDENetworkVPNType : : PPTP ) ;
}
if ( serviceName = = " strongswan " ) {
ret . append ( TDENetworkVPNType : : StrongSwan ) ;
}
if ( serviceName = = " vpnc " ) {
ret . append ( TDENetworkVPNType : : VPNC ) ;
}
delete tdeconfig ;
TQString serviceName = config - > readEntry ( " name " , TQString ( " " ) ) ;
serviceName = serviceName . lower ( ) ;
if ( serviceName = = " openvpn " )
{
ret . append ( TDENetworkVPNType : : OpenVPN ) ;
}
if ( serviceName = = " pptp " )
{
ret . append ( TDENetworkVPNType : : PPTP ) ;
}
if ( serviceName = = " strongswan " )
{
ret . append ( TDENetworkVPNType : : StrongSwan ) ;
}
if ( serviceName = = " vpnc " )
{
ret . append ( TDENetworkVPNType : : VPNC ) ;
}
}
delete config ;
}
}
return ret ;
return ret ;