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>
pull/3/head
Slávek Banko 5 years ago
parent 774770240a
commit bbe9bf4b3b
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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" )

@ -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";
}

@ -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;

@ -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();

@ -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()) );
}
}

@ -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()) );
}
}

@ -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);
}
}

@ -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()) );
}
}

@ -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)
{

Loading…
Cancel
Save