summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-10-28 16:08:17 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-10-28 16:08:17 +0100
commitbbe9bf4b3b0f7219a22b84bb64d0f013738b0ae6 (patch)
tree83d2f77a641efe6ce209028e8d8e6d456f5766c4
parent774770240a49afa8438da1261ad62eb79d1c8ddd (diff)
downloadtdenetworkmanager-bbe9bf4b3b0f7219a22b84bb64d0f013738b0ae6.tar.gz
tdenetworkmanager-bbe9bf4b3b0f7219a22b84bb64d0f013738b0ae6.zip
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--CMakeLists.txt2
-rw-r--r--tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp8
-rw-r--r--tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp6
-rw-r--r--tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp2
-rw-r--r--tdenetworkmanager/src/devicetraycomponent.cpp2
-rw-r--r--tdenetworkmanager/src/tdenetman-tray.cpp16
-rw-r--r--tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp6
-rw-r--r--tdenetworkmanager/src/vpn_tray_component.cpp2
-rw-r--r--tdenetworkmanager/vpn-plugins/vpnc/src/tdenetman-vpnc.cpp2
9 files changed, 23 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2f1730..e7798a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings #################
-add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST )
+add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp
index 22fdbaf..918ee32 100644
--- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp
+++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_vpn_widget.cpp
@@ -81,16 +81,16 @@ VPNWidgetImpl::Init()
disp_name = service->getDisplayName();
}
- if (strcmp(disp_name, "vpnc") == 0) {
+ if (strcmp(disp_name.latin1(), "vpnc") == 0) {
disp_name = "Cisco VPN";
}
- else if (strcmp(disp_name, "pptp") == 0) {
+ else if (strcmp(disp_name.latin1(), "pptp") == 0) {
disp_name = "Microsoft PPTP VPN";
}
- else if (strcmp(disp_name, "openvpn") == 0) {
+ else if (strcmp(disp_name.latin1(), "openvpn") == 0) {
disp_name = "Open VPN";
}
- else if (strcmp(disp_name, "strongswan") == 0) {
+ else if (strcmp(disp_name.latin1(), "strongswan") == 0) {
disp_name = "StrongSwan VPN";
}
diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp
index e1c8fac..5dcd71b 100644
--- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp
+++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.cpp
@@ -242,14 +242,14 @@ WirelessSecurityWEPImpl::getHashedWEPKey(TQString key, WEPKEY_TYPE type) const
switch(type)
{
case WEPKEY_TYPE_HEX:
- return TQCString(key);
+ return TQCString(key.latin1());
break;
case WEPKEY_TYPE_ASCII:
- hashed = String2Hex(TQCString(key), key.length() * 2);
+ hashed = String2Hex(TQCString(key.latin1()), key.length() * 2);
return hashed;
break;
case WEPKEY_TYPE_PASSPHRASE:
- return TQCString(key);
+ return key.utf8();
break;
}
return hashed;
diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp
index af8214b..33dc96b 100644
--- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp
+++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp
@@ -49,7 +49,7 @@ class NetworkListViewItem : public TDEListViewItem
public:
NetworkListViewItem(TQListView* parent, WirelessNetwork& net)
- : TDEListViewItem(parent, TQString::fromUtf8(net.getDisplaySsid()), TQString("%1\%").arg(net.getStrength()))
+ : TDEListViewItem(parent, net.getDisplaySsid(), TQString("%1\%").arg(net.getStrength()))
, _net(net)
{
TQ_UINT8 strength = net.getStrength();
diff --git a/tdenetworkmanager/src/devicetraycomponent.cpp b/tdenetworkmanager/src/devicetraycomponent.cpp
index 25c43e0..5f1f26e 100644
--- a/tdenetworkmanager/src/devicetraycomponent.cpp
+++ b/tdenetworkmanager/src/devicetraycomponent.cpp
@@ -128,7 +128,7 @@ void DeviceTrayComponent::deviceEventHandler(TDENetworkDeviceEventType::TDENetwo
kdDebug() << "DeviceTrayComponent::deviceEventHandler" << endl;
if (event == TDENetworkDeviceEventType::Failure) {
- KNotifyClient::event( tray()->winId(), "tdenm-nm-connection-attempt-failed", i18n(message) );
+ KNotifyClient::event( tray()->winId(), "tdenm-nm-connection-attempt-failed", i18n(message.utf8()) );
}
}
diff --git a/tdenetworkmanager/src/tdenetman-tray.cpp b/tdenetworkmanager/src/tdenetman-tray.cpp
index 53a0b73..9427679 100644
--- a/tdenetworkmanager/src/tdenetman-tray.cpp
+++ b/tdenetworkmanager/src/tdenetman-tray.cpp
@@ -263,9 +263,9 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
menuCaption = menuCaption.insert(0, "Unknown Connection (");
}
menuCaption = menuCaption.append(")");
- deviceNewConnAction = actionCollection ()->action (actionName);
+ deviceNewConnAction = actionCollection ()->action (actionName.utf8());
if (!deviceNewConnAction) {
- deviceNewConnAction = new TDEAction (menuCaption, 0, (*it), TQT_SLOT(newConnection()), actionCollection(), actionName);
+ deviceNewConnAction = new TDEAction (menuCaption, 0, (*it), TQT_SLOT(newConnection()), actionCollection(), actionName.utf8());
}
newConnActionMenu->insert(deviceNewConnAction);
}
@@ -275,7 +275,7 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
TDEAction * deviceNewConnAction = 0;
TQString menuCaption = "VPN Connection";
TQString actionName = TQString("new_connection_%1").arg("vpn");
- deviceNewConnAction = new TDEAction (menuCaption, 0, TQT_TQOBJECT(this), TQT_SLOT(slotNewVPNConnection()), actionCollection(), actionName);
+ deviceNewConnAction = new TDEAction (menuCaption, 0, TQT_TQOBJECT(this), TQT_SLOT(slotNewVPNConnection()), actionCollection(), actionName.utf8());
newConnActionMenu->insert(deviceNewConnAction);
}
else if ( devices == 1 ) {
@@ -309,11 +309,11 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
}
TQString actionName = TQString("disable_connection_%1").arg(conn->UUID);
- TDEAction * deviceNewConnAction = actionCollection ()->action (actionName);
+ TDEAction * deviceNewConnAction = actionCollection ()->action (actionName.utf8());
TQString actionText = conn->friendlyName;
if (!deviceNewConnAction) {
- deviceNewConnAction = new TDEAction (actionText, 0, &d->signalMapper, TQT_SLOT(map()), actionCollection(), actionName);
+ deviceNewConnAction = new TDEAction (actionText, 0, &d->signalMapper, TQT_SLOT(map()), actionCollection(), actionName.utf8());
}
d->signalMapper.setMapping(deviceNewConnAction, d->current_idx);
d->act_conn_map.insert(d->current_idx, conn->UUID);
@@ -449,7 +449,7 @@ void Tray::slotRemoveDeviceTrayComponent(TQString dev)
TDENetworkDevice* dev_comp_dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(dev_comp->device()));
if (dev_comp_dev) {
TQString actionName = TQString("new_connection_%1").arg(dev_comp_dev->deviceNode());
- TDEAction * deviceNewConnAction = actionCollection ()->action (actionName);
+ TDEAction * deviceNewConnAction = actionCollection ()->action (actionName.utf8());
if (!deviceNewConnAction) {
delete deviceNewConnAction;
deviceNewConnAction = NULL;
@@ -905,7 +905,7 @@ void Tray::updateActiveConnection(TDENetworkConnectionStatus::TDENetworkConnecti
void Tray::slotDeviceAddedNotify(TDENetworkDevice* dev)
{
kdDebug() << "Tray::slotDeviceAddedNotify" << endl;
- if( dev->deviceNode() ) {
+ if( !dev->deviceNode().isEmpty() ) {
KNotifyClient::event( winId(), "tdenm-nm-device-added", i18n("New network device %1 found").arg(dev->deviceNode()) );
}
}
@@ -913,7 +913,7 @@ void Tray::slotDeviceAddedNotify(TDENetworkDevice* dev)
void Tray::slotDeviceRemovedNotify(TDENetworkDevice* dev)
{
kdDebug() << "Tray::slotDeviceRemovedNotify" << endl;
- if( dev->deviceNode() ) {
+ if( !dev->deviceNode().isEmpty() ) {
KNotifyClient::event( winId(), "tdenm-nm-device-removed", i18n("Network device %1 removed").arg(dev->deviceNode()) );
}
}
diff --git a/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp b/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp
index f9a1e20..42497b9 100644
--- a/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp
+++ b/tdenetworkmanager/src/tdenetman-wireless_menuitem.cpp
@@ -63,7 +63,7 @@ void WirelessNetworkItem::slotActivate()
TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
printf("slotActivate\n");
- if (_dev && deviceConnMan)
+ if (!_dev.isEmpty() && deviceConnMan)
{
if ( conn )
{
@@ -101,10 +101,10 @@ TQString WirelessNetworkItem::getDisplayText()
}
if (conn && (conn->friendlyName != _net.getDisplaySsid())) {
- return TQString("%2/%1 %3").arg(TQString::fromUtf8(_net.getDisplaySsid())).arg(conn->friendlyName).arg(security);
+ return TQString("%2/%1 %3").arg(_net.getDisplaySsid()).arg(conn->friendlyName).arg(security);
}
else {
- return TQString("%1 %2").arg(TQString::fromUtf8(_net.getDisplaySsid())).arg(security);
+ return TQString("%1 %2").arg(_net.getDisplaySsid()).arg(security);
}
}
diff --git a/tdenetworkmanager/src/vpn_tray_component.cpp b/tdenetworkmanager/src/vpn_tray_component.cpp
index 9756ba1..f032647 100644
--- a/tdenetworkmanager/src/vpn_tray_component.cpp
+++ b/tdenetworkmanager/src/vpn_tray_component.cpp
@@ -167,7 +167,7 @@ void VPNTrayComponent::vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEven
kdDebug() << "Tray::vpnEventHandler" << endl;
if (event == TDENetworkVPNEventType::Failure) {
- KNotifyClient::event( tray()->winId(), "tdenm-nm-vpn-connection-attempt-failed", i18n(message) );
+ KNotifyClient::event( tray()->winId(), "tdenm-nm-vpn-connection-attempt-failed", i18n(message.utf8()) );
}
}
diff --git a/tdenetworkmanager/vpn-plugins/vpnc/src/tdenetman-vpnc.cpp b/tdenetworkmanager/vpn-plugins/vpnc/src/tdenetman-vpnc.cpp
index 783d7f5..c5fad17 100644
--- a/tdenetworkmanager/vpn-plugins/vpnc/src/tdenetman-vpnc.cpp
+++ b/tdenetworkmanager/vpn-plugins/vpnc/src/tdenetman-vpnc.cpp
@@ -398,7 +398,7 @@ TDENetworkSettingsMap VPNCAuthentication::getPasswords()
char decrypted_result[2048];
int i;
- decryptcommand.append(_vpncAuth->editGroupPassword->password());
+ decryptcommand.append(_vpncAuth->editGroupPassword->password().local8Bit());
printf("Group password decrypt command: %s\n", decryptcommand.c_str());
if ((pipe_decrypt = popen(decryptcommand.c_str(), "r")) == NULL)
{