Commit a9c21fd7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove kde4suppport

parent af11370e
......@@ -515,7 +515,7 @@ void FancyPlotter::setTooltip()
description = sensor->name();
if(sensor->isOk()) {
lastValue = KGlobal::locale()->formatNumber( sensor->lastValue, (sensor->isInteger)?0:-1 );
lastValue = KLocale::global()->formatNumber( sensor->lastValue, (sensor->isInteger)?0:-1 );
if (sensor->unit() == "%")
lastValue = i18nc("units", "%1%", lastValue);
else if( !sensor->unit().isEmpty() )
......@@ -586,7 +586,7 @@ void FancyPlotter::sendDataToPlotter( )
lastValue = mPlotter->lastValueAsString(beamId, precision);
} else {
precision = (sensor->isInteger)?0:-1;
lastValue = KGlobal::locale()->formatNumber( mPlotter->lastValue(beamId), precision );
lastValue = KLocale::global()->formatNumber( mPlotter->lastValue(beamId), precision );
if (sensor->unit() == "%")
lastValue = i18nc("units", "%1%", lastValue);
else if( !sensor->unit().isEmpty() ) {
......
......@@ -64,22 +64,22 @@ static QString formatByteSize(qlonglong amountInKB, int units) {
switch(units) {
case UnitsKB:
return kString.arg(KGlobal::locale()->formatNumber(amountInKB, 0));
return kString.arg(KLocale::global()->formatNumber(amountInKB, 0));
case UnitsMB:
amount = amountInKB/1024.0;
return mString.arg(KGlobal::locale()->formatNumber(amount, 1));
return mString.arg(KLocale::global()->formatNumber(amount, 1));
case UnitsGB:
amount = amountInKB/(1024.0*1024.0);
if(amount < 0.1 && amount > 0.05) amount = 0.1;
return gString.arg(KGlobal::locale()->formatNumber(amount, 1));
return gString.arg(KLocale::global()->formatNumber(amount, 1));
case UnitsTB:
amount = amountInKB/(1024.0*1024.0*1024.0);
if(amount < 0.1 && amount > 0.05) amount = 0.1;
return tString.arg(KGlobal::locale()->formatNumber(amount, 1));
return tString.arg(KLocale::global()->formatNumber(amount, 1));
case UnitsPB:
amount = amountInKB/(1024.0*1024.0*1024.0*1024.0);
if(amount < 0.1 && amount > 0.05) amount = 0.1;
return pString.arg(KGlobal::locale()->formatNumber(amount, 1));
return pString.arg(KLocale::global()->formatNumber(amount, 1));
default:
return ""; // error
}
......
......@@ -53,6 +53,7 @@
#include <QSplitter>
#include <config-workspace.h>
#include <KFormat>
#include "SensorBrowser.h"
#include "Workspace.h"
#include "WorkSheet.h"
......@@ -379,9 +380,9 @@ bool TopLevel::queryClose()
if ( !mWorkSpace->saveOnQuit() )
return false;
KConfigGroup cg( KGlobal::config(), "MainWindow" );
KConfigGroup cg( KSharedConfig::openConfig(), "MainWindow" );
saveProperties( cg );
KGlobal::config()->sync();
KSharedConfig::openConfig()->sync();
return true;
}
......@@ -454,8 +455,8 @@ void TopLevel::answerReceived( int id, const QList<QByteArray> &answerList )
mUsedApplication = answer.toLongLong();
//Use a multi-length string
s = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: %1 / %2" "\xc2\x9c" "Mem: %1 / %2" "\xc2\x9c" "Mem: %1" "\xc2\x9c" "%1",
KGlobal::locale()->formatByteSize( mUsedApplication*1024),
KGlobal::locale()->formatByteSize( (mFree+mUsedTotal)*1024 ) );
KFormat().formatByteSize( mUsedApplication*1024),
KFormat().formatByteSize( (mFree+mUsedTotal)*1024 ) );
sbMemTotal->setText( s );
break;
......@@ -483,8 +484,8 @@ void TopLevel::setSwapInfo( qlonglong used, qlonglong free, const QString & )
msg = i18n( " No swap space available " );
else {
msg = i18nc( "Arguments are formatted byte sizes (used/total)", "Swap: %1 / %2" "\xc2\x9c" "Swap: %1" "\xc2\x9c" "%1" ,
KGlobal::locale()->formatByteSize( used*1024 ),
KGlobal::locale()->formatByteSize( (free+used)*1024) );
KFormat().formatByteSize( used*1024 ),
KFormat().formatByteSize( (free+used)*1024) );
}
sbSwapTotal->setText( msg );
......@@ -563,7 +564,7 @@ extern "C" Q_DECL_EXPORT int kdemain( int argc, char** argv )
// create top-level widget
Toplevel->readProperties( KConfigGroup( KGlobal::config(), "MainWindow" ) );
Toplevel->readProperties( KConfigGroup( KSharedConfig::openConfig(), "MainWindow" ) );
// setup the statusbar, toolbar etc.
// Note that this comes after creating the top-level widgets whcih also
// sets up the various QActions that the user may have added to the toolbar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment