Fix improper use of TQString::ascii().

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 071d97ba8d)
r14.0.x
Slávek Banko 5 years ago
parent 57d63cb6db
commit 2a7c961a22
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -146,7 +146,7 @@ void ConfigureDialog::setSchemeList(){
cB_batteryScheme->clear(); cB_batteryScheme->clear();
for ( TQStringList::Iterator it = schemes.begin(); it != schemes.end(); ++it ) { for ( TQStringList::Iterator it = schemes.begin(); it != schemes.end(); ++it ) {
const char *_tmp = (*it).ascii(); const char *_tmp = (*it).utf8();
if(_tmp == "Performance" || _tmp == i18n("Performance")) { if(_tmp == "Performance" || _tmp == i18n("Performance")) {
listBox_schemes->insertItem(SmallIcon("scheme_power", TQIconSet::Automatic), i18n(_tmp)); listBox_schemes->insertItem(SmallIcon("scheme_power", TQIconSet::Automatic), i18n(_tmp));
cB_acScheme->insertItem(i18n(_tmp)); cB_acScheme->insertItem(i18n(_tmp));
@ -1271,7 +1271,7 @@ void ConfigureDialog::setInactivityBox(){
// actions.append("Turn Off Computer"); // actions.append("Turn Off Computer");
for ( TQStringList::Iterator it = actions.begin(); it != actions.end(); ++it ) { for ( TQStringList::Iterator it = actions.begin(); it != actions.end(); ++it ) {
cB_autoInactivity->insertItem( i18n( (*it).ascii() ) ); cB_autoInactivity->insertItem( i18n( (*it).utf8() ) );
} }
kdDebugFuncOut(trace); kdDebugFuncOut(trace);

@ -356,7 +356,7 @@ void detaileddialog::setProcessorThrottling() {
// get max cpu freq and set it to the max of the progressbar // get max cpu freq and set it to the max of the progressbar
ProcessorPBar[i]->setTotalSteps(100); ProcessorPBar[i]->setTotalSteps(100);
TQString ProgressString = TQString("%1% (%2 MHz)").arg(100 - cpuInfo->cpu_throttling[i]).arg(cpuInfo->cpufreq_speed[i]); TQString ProgressString = TQString("%1% (%2 MHz)").arg(100 - cpuInfo->cpu_throttling[i]).arg(cpuInfo->cpufreq_speed[i]);
ProcessorPBar[i]->setFormat(i18n(ProgressString.ascii())); ProcessorPBar[i]->setFormat(i18n(ProgressString.utf8()));
ProcessorPBar[i]->setProgress(100 - cpuInfo->cpu_throttling[i]); ProcessorPBar[i]->setProgress(100 - cpuInfo->cpu_throttling[i]);
ProcessorPBar[i]->setEnabled(true); ProcessorPBar[i]->setEnabled(true);
} else if (cpuInfo->cpufreq_speed[i] < 0) { } else if (cpuInfo->cpufreq_speed[i] < 0) {
@ -411,7 +411,7 @@ void detaileddialog::setInfos() {
if(!config->currentScheme.isEmpty()) if(!config->currentScheme.isEmpty())
display += i18n("Current Scheme: ") + "\n"; display += i18n("Current Scheme: ") + "\n";
displayValue += i18n(config->currentScheme.ascii()) + "\n"; displayValue += i18n(config->currentScheme.utf8()) + "\n";
if(config->currentScheme == config->ac_scheme) if(config->currentScheme == config->ac_scheme)
InfoPictogram->setPixmap(SmallIcon("scheme_power", 22)); InfoPictogram->setPixmap(SmallIcon("scheme_power", 22));
else if(config->currentScheme == config->battery_scheme) else if(config->currentScheme == config->battery_scheme)

@ -191,7 +191,7 @@ void kpowersave::initMenu() {
STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", TQIconSet::Automatic), STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", TQIconSet::Automatic),
i18n("Standby"), this, TQT_SLOT(do_standby())); i18n("Standby"), this, TQT_SLOT(do_standby()));
speed_menu = new TQPopupMenu(this, i18n("Set CPU Frequency Policy").ascii()); speed_menu = new TQPopupMenu(this, i18n("Set CPU Frequency Policy").utf8());
speed_menu->insertItem(i18n("Performance"), PERFORMANCE); speed_menu->insertItem(i18n("Performance"), PERFORMANCE);
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC); speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
speed_menu->insertItem(i18n("Powersave"), POWERSAVE); speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
@ -205,7 +205,7 @@ void kpowersave::initMenu() {
SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
scheme_menu = new TQPopupMenu(this, i18n("Set Active Scheme").ascii()); scheme_menu = new TQPopupMenu(this, i18n("Set Active Scheme").utf8());
SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu); SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu);
connect(scheme_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setActiveScheme(int))); connect(scheme_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setActiveScheme(int)));
@ -219,7 +219,7 @@ void kpowersave::initMenu() {
HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator(); HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
help_menu = new TQPopupMenu(this, i18n("&Help").ascii()); help_menu = new TQPopupMenu(this, i18n("&Help").utf8());
help_menu->insertItem( SmallIcon("help", TQIconSet::Automatic), i18n("&KPowersave Handbook"), help_menu->insertItem( SmallIcon("help", TQIconSet::Automatic), i18n("&KPowersave Handbook"),
this, TQT_SLOT(slotHelp())); this, TQT_SLOT(slotHelp()));
@ -284,7 +284,7 @@ void kpowersave::showConfigureDialog() {
else { else {
KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."), KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
} }
} else { } else {
configDlg->setWindowState(configDlg->windowState() & ~Qt::WindowMinimized | Qt::WindowActive); configDlg->setWindowState(configDlg->windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
@ -717,7 +717,7 @@ bool kpowersave::do_suspend2disk(){
} else { } else {
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to disk failed"), KPassivePopup::message( i18n("WARNING"),i18n("Suspend to disk failed"),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
} }
@ -725,7 +725,7 @@ bool kpowersave::do_suspend2disk(){
KPassivePopup::message( i18n("WARNING"), KPassivePopup::message( i18n("WARNING"),
i18n("Suspend to disk disabled by administrator."), i18n("Suspend to disk disabled by administrator."),
SmallIcon("messagebox_warning", 20), SmallIcon("messagebox_warning", 20),
this, i18n("Warning").ascii(), 15000); this, i18n("Warning").utf8(), 15000);
this->contextMenu()->setItemEnabled(SUSPEND2DISK_MENU_ID, false); this->contextMenu()->setItemEnabled(SUSPEND2DISK_MENU_ID, false);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
@ -773,7 +773,7 @@ bool kpowersave::do_suspend2ram(){
} else { } else {
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to RAM failed"), KPassivePopup::message( i18n("WARNING"),i18n("Suspend to RAM failed"),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
} }
@ -781,7 +781,7 @@ bool kpowersave::do_suspend2ram(){
KPassivePopup::message( i18n("WARNING"), KPassivePopup::message( i18n("WARNING"),
i18n("Suspend to RAM disabled by administrator."), i18n("Suspend to RAM disabled by administrator."),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false); this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
@ -829,14 +829,14 @@ bool kpowersave::do_standby(){
} else { } else {
KPassivePopup::message( i18n("WARNING"),i18n("Standby failed"), KPassivePopup::message( i18n("WARNING"),i18n("Standby failed"),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
} }
} else { } else {
KPassivePopup::message( i18n("WARNING"),i18n("Standby disabled by administrator."), KPassivePopup::message( i18n("WARNING"),i18n("Standby disabled by administrator."),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 15000); i18n("Warning").utf8(), 15000);
this->contextMenu()->setItemEnabled(STANDBY_MENU_ID, false); this->contextMenu()->setItemEnabled(STANDBY_MENU_ID, false);
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return false; return false;
@ -1192,7 +1192,7 @@ void kpowersave::handleLidEvent( bool closed ){
"be a problem with the selected \nlock " "be a problem with the selected \nlock "
"method or something else."), "method or something else."),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Warning").ascii(), 10000); i18n("Warning").utf8(), 10000);
} }
} }
@ -1310,7 +1310,7 @@ void kpowersave::do_setSpeedPolicy(int menu_id){
if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) { if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) {
KPassivePopup::message(i18n("WARNING"), KPassivePopup::message(i18n("WARNING"),
i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)), i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)),
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 10000); SmallIcon("messagebox_warning", 20), this, i18n("Warning").utf8(), 10000);
} else { } else {
hwinfo->checkCurrentCPUFreqPolicy(); hwinfo->checkCurrentCPUFreqPolicy();
update(); update();
@ -1339,7 +1339,7 @@ void kpowersave::do_setActiveScheme( int i ){
} else if (!settings->schemes[i]){ } else if (!settings->schemes[i]){
KPassivePopup::message( i18n("WARNING"), KPassivePopup::message( i18n("WARNING"),
i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)), i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)),
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 5000); SmallIcon("messagebox_warning", 20), this, i18n("Warning").utf8(), 5000);
} }
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
@ -1533,12 +1533,12 @@ void kpowersave::updateSchemeMenu(){
if ( *it == settings->ac_scheme ){ if ( *it == settings->ac_scheme ){
scheme_menu->insertItem( SmallIcon("scheme_power", TQIconSet::Automatic), scheme_menu->insertItem( SmallIcon("scheme_power", TQIconSet::Automatic),
i18n( ((TQString)*it).ascii() ), x, x); i18n( ((TQString)*it).utf8() ), x, x);
} }
else{ else{
if ( *it == settings->battery_scheme ){ if ( *it == settings->battery_scheme ){
scheme_menu->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic), scheme_menu->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic),
i18n( (*it).ascii() ), x, x); i18n( (*it).utf8() ), x, x);
} }
else{ else{
if ((TQString)*it == "Acoustic"){ if ((TQString)*it == "Acoustic"){
@ -1558,7 +1558,7 @@ void kpowersave::updateSchemeMenu(){
i18n( "Advanced Powersave" ), x, x); i18n( "Advanced Powersave" ), x, x);
} }
else { else {
scheme_menu->insertItem(i18n( (*it).ascii() ), x, x); scheme_menu->insertItem(i18n( (*it).utf8() ), x, x);
} }
} }
} }
@ -1709,7 +1709,7 @@ void kpowersave::showHalErrorMsg() {
i18n("Could not get information from HAL. The haldaemon is " i18n("Could not get information from HAL. The haldaemon is "
"maybe not running."), "maybe not running."),
SmallIcon("messagebox_warning", 20), this, SmallIcon("messagebox_warning", 20), this,
i18n("Error").ascii(), 5000); i18n("Error").utf8(), 5000);
} }
else if (hwinfo->hal_terminated && !hal_error_shown && !DISPLAY_HAL_ERROR_Timer->isActive()) { else if (hwinfo->hal_terminated && !hal_error_shown && !DISPLAY_HAL_ERROR_Timer->isActive()) {
hal_error_shown = true; hal_error_shown = true;
@ -1738,7 +1738,7 @@ void kpowersave::showErrorMessage( TQString msg ){
if(settings->psMsgAsPassivePopup) { if(settings->psMsgAsPassivePopup) {
KPassivePopup::message("KPowersave", msg, SmallIcon("messagebox_warning", 20), KPassivePopup::message("KPowersave", msg, SmallIcon("messagebox_warning", 20),
this, i18n("Warning").ascii(), 10000); this, i18n("Warning").utf8(), 10000);
} else { } else {
kapp->updateUserTimestamp(); kapp->updateUserTimestamp();
// KMessageBox::error( 0, msg); // KMessageBox::error( 0, msg);
@ -2184,7 +2184,7 @@ void kpowersave::notifySchemeSwitch() {
eventType = "scheme_" + _scheme; eventType = "scheme_" + _scheme;
KNotifyClient::event( this->winId(), eventType, KNotifyClient::event( this->winId(), eventType,
i18n("Switched to scheme: %1").arg(i18n(_scheme.ascii())).ascii()); i18n("Switched to scheme: %1").arg(i18n(_scheme.utf8())));
} }
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
@ -2293,7 +2293,7 @@ void kpowersave::handleResumeSignal() {
KPassivePopup::message( i18n("WARNING"), KPassivePopup::message( i18n("WARNING"),
i18n("Could not remount (all) external storage" i18n("Could not remount (all) external storage"
" media."), SmallIcon("messagebox_warning", 20), " media."), SmallIcon("messagebox_warning", 20),
this, i18n("Warning").ascii(), 15000); this, i18n("Warning").utf8(), 15000);
} }
} else { } else {
kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl; kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl;

@ -48,7 +48,7 @@ extern bool trace;
/* /*
* macro to collect time and k_funcinfo information for kdDebug() * macro to collect time and k_funcinfo information for kdDebug()
*/ */
#define funcinfo "[" << TQString(TQTime::currentTime().toString()).ascii() << \ #define funcinfo "[" << TQString(TQTime::currentTime().toString()) << \
":" << TQTime::currentTime().msec() << "]" << k_funcinfo ":" << TQTime::currentTime().msec() << "]" << k_funcinfo
/* /*

Loading…
Cancel
Save