From c81da919962b29705e21d26f8cfecfae2f50041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 4 Oct 2018 21:00:24 +0200 Subject: [PATCH] Added controlled conversions to char* instead of automatic ascii conversions. The definition of -UTQT_NO_ASCII_CAST is no longer needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 2 +- src/hdsensorslist.cpp | 4 ++-- src/lmsensorsalarms.cpp | 6 +++--- src/lmsensorscfg.cpp | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4eaa4b..d20c3d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ include( ConfigureChecks.cmake ) ###### global compiler settings -add_definitions( -DHAVE_CONFIG_H -UTQT_NO_COMPAT -UTQT_NO_ASCII_CAST ) +add_definitions( -DHAVE_CONFIG_H -UTQT_NO_COMPAT ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) diff --git a/src/hdsensorslist.cpp b/src/hdsensorslist.cpp index bb71b32..412b4c6 100644 --- a/src/hdsensorslist.cpp +++ b/src/hdsensorslist.cpp @@ -33,7 +33,7 @@ HDSensorsList::HDSensorsList(TQObject *parent, const char * name): SensorsList(p { process= 0; - setDescription( TQString(i18n("Hard Disks")) ); + setDescription( i18n("Hard Disks") ); setClass(Sensor::hdSensor); @@ -54,7 +54,7 @@ HDSensorsList::HDSensorsList(TQObject *parent, const char * name): SensorsList(p if(getDiskInfo(proc.getStdoutData(),str,value)) { Sensor *sensor= new Sensor(this); sensor->setType(Sensor::lmTemp); - sensor->setName(*it); + sensor->setName(it->utf8()); sensor->setDescription(str); sensor->setValueMax (40 , Sensor::dgCelsius); sensor->setValueMin ( 0 , Sensor::dgCelsius); diff --git a/src/lmsensorsalarms.cpp b/src/lmsensorsalarms.cpp index abf3014..5a69cac 100644 --- a/src/lmsensorsalarms.cpp +++ b/src/lmsensorsalarms.cpp @@ -81,9 +81,9 @@ void LMSensorsAlarms::setValueChanged(Sensor *sensor) case acCommand: runSensorCommand( - (const char *)sensor->getDescription(), - (const char *)TQString::number(sensor->getValue()), - (const char *)readAlarmCommand(sensor->name()) + sensor->getDescription().local8Bit(), + TQString::number(sensor->getValue()).ascii(), + (readAlarmCommand(sensor->name())).local8Bit() ); break; } diff --git a/src/lmsensorscfg.cpp b/src/lmsensorscfg.cpp index cf870ac..938c6b1 100644 --- a/src/lmsensorscfg.cpp +++ b/src/lmsensorscfg.cpp @@ -118,7 +118,7 @@ void LMSensorsCfg::readSensorInfo(int index) const char *mask= curSensor->getType()==LMSensor::lmVoltage ? "%.2lf":"%.0lf"; - str.sprintf(curSensor->getPrintMask(true), curSensor->getValue()); + str.sprintf(curSensor->getPrintMask(true).ascii(), curSensor->getValue()); editValue->setText(str); str.sprintf(mask, curSensor->getValueIdeal()); @@ -185,11 +185,11 @@ void LMSensorsCfg::applySensorChanges() !radioAlarm1->isChecked() ); // Apply show in main window configuration - LMSensorPanel::writeShow(sName,checkShow->isChecked() ); + LMSensorPanel::writeShow(sName.utf8(), checkShow->isChecked() ); // Apply dock configuration - LMSensorDockPanel::writeShowInDock(sName,checkShowInDock->isChecked()); - LMSensorDockPanel::writeColorNormal(sName,colorNormal->color()); - LMSensorDockPanel::writeColorAlarm(sName,colorAlarm->color()); + LMSensorDockPanel::writeShowInDock(sName.utf8(), checkShowInDock->isChecked()); + LMSensorDockPanel::writeColorNormal(sName.utf8(), colorNormal->color()); + LMSensorDockPanel::writeColorAlarm(sName.utf8(), colorAlarm->color()); // palPanelCfg->savePalette(); // @@ -259,10 +259,10 @@ void LMSensorsCfg::slotAccept() void LMSensorsCfg::slotTestAlarm() { if( radioAlarm2->isChecked() ) { - LMSensorsAlarms::playSound(editPlay->text()); + LMSensorsAlarms::playSound(editPlay->text().local8Bit()); } else if( radioAlarm3->isChecked() ) { - LMSensorsAlarms::runSensorCommand("TEST","100",editLaunch->text()); + LMSensorsAlarms::runSensorCommand("TEST", "100", editLaunch->text().local8Bit()); } }