Browse Source

Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 9 years ago
parent
commit
ed6b24997e
  1. 6
      src/kcm/configdialog.cpp
  2. 60
      src/knemod/backends/nettoolsbackend.cpp
  3. 20
      src/knemod/backends/nettoolsbackend.h
  4. 8
      src/knemod/interfaceicon.cpp
  5. 4
      src/knemod/interfacestatisticsdialog.cpp
  6. 6
      src/knemod/knemodaemon.cpp

6
src/kcm/configdialog.cpp

@ -75,7 +75,7 @@ ConfigDialog::ConfigDialog( TQWidget *parent, const char *name, const TQStringLi
mColorOutgoing( 0xFF7F08 ),
mColorBackground( 0x313031 )
{
KGlobal::locale()->insertCatalogue("kcm_knemo");
TDEGlobal::locale()->insertCatalogue("kcm_knemo");
setupToolTipArray();
// fill the backends combobox
@ -264,7 +264,7 @@ void ConfigDialog::load()
mDlg->tabWidgetConfiguration->setEnabled( startKNemo );
mDlg->numInputPollInterval->setValue( config->readNumEntry( "PollInterval", 1 ) );
mDlg->numInputSaveInterval->setValue( config->readNumEntry( "SaveInterval", 60 ) );
mDlg->lineEditStatisticsDir->setText( config->readEntry( "StatisticsDir", KGlobal::dirs()->saveLocation( "data", "knemo/" ) ) );
mDlg->lineEditStatisticsDir->setText( config->readEntry( "StatisticsDir", TDEGlobal::dirs()->saveLocation( "data", "knemo/" ) ) );
mToolTipContent = config->readNumEntry( "ToolTipContent", 2 );
// select the backend from the config file
@ -493,7 +493,7 @@ void ConfigDialog::defaults()
// Default misc settings
mDlg->numInputPollInterval->setValue( 1 );
mDlg->numInputSaveInterval->setValue( 60 );
mDlg->lineEditStatisticsDir->setText( KGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mDlg->lineEditStatisticsDir->setText( TDEGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mDlg->comboBoxBackends->setCurrentItem( 0 );
mDlg->textLabelBackendDescription->setText( KCMRegistry[0].description );

60
src/knemod/backends/nettoolsbackend.cpp

@ -67,16 +67,16 @@ void NetToolsBackend::update()
if ( !mIfconfigProcess )
{
mIfconfigStdout = TQString();
mIfconfigProcess = new KProcess();
mIfconfigProcess = new TDEProcess();
mIfconfigProcess->setEnvironment( "LANG", "C" );
mIfconfigProcess->setEnvironment( "LC_ALL", "C" );
*mIfconfigProcess << PATH_IFCONFIG << "-a";
connect( mIfconfigProcess, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ),
this, TQT_SLOT( ifconfigProcessStdout( KProcess*, char*, int ) ) );
connect( mIfconfigProcess, TQT_SIGNAL( processExited( KProcess* ) ),
this, TQT_SLOT( ifconfigProcessExited( KProcess* ) ) );
connect( mIfconfigProcess, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ),
this, TQT_SLOT( ifconfigProcessStdout( TDEProcess*, char*, int ) ) );
connect( mIfconfigProcess, TQT_SIGNAL( processExited( TDEProcess* ) ),
this, TQT_SLOT( ifconfigProcessExited( TDEProcess* ) ) );
if ( !mIfconfigProcess->start( KProcess::NotifyOnExit, KProcess::Stdout ) )
if ( !mIfconfigProcess->start( TDEProcess::NotifyOnExit, TDEProcess::Stdout ) )
{
delete mIfconfigProcess;
mIfconfigProcess = 0L;
@ -87,18 +87,18 @@ void NetToolsBackend::update()
if ( !mIwconfigProcess )
{
mIwconfigStdout = TQString();
mIwconfigProcess = new KProcess();
mIwconfigProcess = new TDEProcess();
mIwconfigProcess->setEnvironment( "LANG", "C" );
mIwconfigProcess->setEnvironment( "LC_ALL", "C" );
*mIwconfigProcess << PATH_IWCONFIG;
connect( mIwconfigProcess, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ),
this, TQT_SLOT( iwconfigProcessStdout( KProcess*, char*, int ) ) );
connect( mIwconfigProcess, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ),
this, TQT_SLOT( iwconfigProcessStdout( KProcess*, char*, int ) ) );
connect( mIwconfigProcess, TQT_SIGNAL( processExited( KProcess* ) ),
this, TQT_SLOT( iwconfigProcessExited( KProcess* ) ) );
if ( !mIwconfigProcess->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
connect( mIwconfigProcess, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ),
this, TQT_SLOT( iwconfigProcessStdout( TDEProcess*, char*, int ) ) );
connect( mIwconfigProcess, TQT_SIGNAL( receivedStderr( TDEProcess*, char*, int ) ),
this, TQT_SLOT( iwconfigProcessStdout( TDEProcess*, char*, int ) ) );
connect( mIwconfigProcess, TQT_SIGNAL( processExited( TDEProcess* ) ),
this, TQT_SLOT( iwconfigProcessExited( TDEProcess* ) ) );
if ( !mIwconfigProcess->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput ) )
{
delete mIwconfigProcess;
mIwconfigProcess = 0L;
@ -110,18 +110,18 @@ void NetToolsBackend::update()
if ( !mRouteProcess )
{
mRouteStdout = TQString();
mRouteProcess = new KProcess();
mRouteProcess = new TDEProcess();
mRouteProcess->setEnvironment( "LANG", "C" );
mRouteProcess->setEnvironment( "LC_ALL", "C" );
*mRouteProcess << PATH_ROUTE << "-n";
connect( mRouteProcess, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ),
this, TQT_SLOT( routeProcessStdout( KProcess*, char*, int ) ) );
connect( mRouteProcess, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ),
this, TQT_SLOT( routeProcessStdout( KProcess*, char*, int ) ) );
connect( mRouteProcess, TQT_SIGNAL( processExited( KProcess* ) ),
this, TQT_SLOT( routeProcessExited( KProcess* ) ) );
if ( !mRouteProcess->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
connect( mRouteProcess, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ),
this, TQT_SLOT( routeProcessStdout( TDEProcess*, char*, int ) ) );
connect( mRouteProcess, TQT_SIGNAL( receivedStderr( TDEProcess*, char*, int ) ),
this, TQT_SLOT( routeProcessStdout( TDEProcess*, char*, int ) ) );
connect( mRouteProcess, TQT_SIGNAL( processExited( TDEProcess* ) ),
this, TQT_SLOT( routeProcessExited( TDEProcess* ) ) );
if ( !mRouteProcess->start( TDEProcess::NotifyOnExit, TDEProcess::AllOutput ) )
{
delete mRouteProcess;
mRouteProcess = 0L;
@ -130,7 +130,7 @@ void NetToolsBackend::update()
#endif
}
void NetToolsBackend::routeProcessExited( KProcess* process )
void NetToolsBackend::routeProcessExited( TDEProcess* process )
{
if ( process == mRouteProcess )
{
@ -140,12 +140,12 @@ void NetToolsBackend::routeProcessExited( KProcess* process )
}
}
void NetToolsBackend::routeProcessStdout( KProcess*, char* buffer, int buflen )
void NetToolsBackend::routeProcessStdout( TDEProcess*, char* buffer, int buflen )
{
mRouteStdout += TQString::fromLatin1( buffer, buflen );
}
void NetToolsBackend::ifconfigProcessExited( KProcess* process )
void NetToolsBackend::ifconfigProcessExited( TDEProcess* process )
{
if ( process == mIfconfigProcess )
{
@ -155,12 +155,12 @@ void NetToolsBackend::ifconfigProcessExited( KProcess* process )
}
}
void NetToolsBackend::ifconfigProcessStdout( KProcess*, char* buffer, int buflen )
void NetToolsBackend::ifconfigProcessStdout( TDEProcess*, char* buffer, int buflen )
{
mIfconfigStdout += TQString::fromLatin1( buffer, buflen );
}
void NetToolsBackend::iwconfigProcessExited( KProcess* process )
void NetToolsBackend::iwconfigProcessExited( TDEProcess* process )
{
if ( process == mIwconfigProcess )
{
@ -170,7 +170,7 @@ void NetToolsBackend::iwconfigProcessExited( KProcess* process )
}
}
void NetToolsBackend::iwconfigProcessStdout( KProcess*, char* buffer, int buflen )
void NetToolsBackend::iwconfigProcessStdout( TDEProcess*, char* buffer, int buflen )
{
mIwconfigStdout += TQString::fromLatin1( buffer, buflen );
}

20
src/knemod/backends/nettoolsbackend.h

@ -24,7 +24,7 @@
#include "backendbase.h"
class KProcess;
class TDEProcess;
/**
* The nettools backend runs 'ifconfig', 'iwconfig' and 'route'
@ -48,12 +48,12 @@ public:
void update();
private slots:
void routeProcessExited( KProcess* process );
void routeProcessStdout( KProcess* process, char* buffer, int buflen );
void ifconfigProcessExited( KProcess* process );
void ifconfigProcessStdout( KProcess* process, char* buffer, int buflen );
void iwconfigProcessExited( KProcess* process );
void iwconfigProcessStdout( KProcess* process, char* buffer, int buflen );
void routeProcessExited( TDEProcess* process );
void routeProcessStdout( TDEProcess* process, char* buffer, int buflen );
void ifconfigProcessExited( TDEProcess* process );
void ifconfigProcessStdout( TDEProcess* process, char* buffer, int buflen );
void iwconfigProcessExited( TDEProcess* process );
void iwconfigProcessStdout( TDEProcess* process, char* buffer, int buflen );
private:
void parseRouteOutput();
@ -65,9 +65,9 @@ private:
TQString mRouteStdout;
TQString mIfconfigStdout;
TQString mIwconfigStdout;
KProcess* mRouteProcess;
KProcess* mIfconfigProcess;
KProcess* mIwconfigProcess;
TDEProcess* mRouteProcess;
TDEProcess* mIfconfigProcess;
TDEProcess* mIwconfigProcess;
};
#endif // NETTOOLSBACKEND_H

8
src/knemod/interfaceicon.cpp

@ -285,9 +285,9 @@ void InterfaceIcon::showConfigDialog()
{
KNemoDaemon::sSelectedInterface = mInterface->getName();
KProcess process;
TDEProcess process;
process << "kcmshell" << "kcm_knemo";
process.start( KProcess::DontCare );
process.start( TDEProcess::DontCare );
}
void InterfaceIcon::menuActivated( int id )
@ -298,7 +298,7 @@ void InterfaceIcon::menuActivated( int id )
{
if ( (*it).id == id )
{
KProcess process;
TDEProcess process;
if ( (*it).runAsRoot )
{
process << "tdesu";
@ -307,7 +307,7 @@ void InterfaceIcon::menuActivated( int id )
else
process << TQStringList::split( ' ', (*it).command );
process.start( KProcess::DontCare );
process.start( TDEProcess::DontCare );
break;
}
}

4
src/knemod/interfacestatisticsdialog.cpp

@ -61,7 +61,7 @@ void InterfaceStatisticsDialog::updateDays()
while ( iterator )
{
TQDate date( iterator->year, iterator->month, iterator->day );
tableDaily->verticalHeader()->setLabel( row, KGlobal::locale()->formatDate( date, true ) );
tableDaily->verticalHeader()->setLabel( row, TDEGlobal::locale()->formatDate( date, true ) );
tableDaily->setText( row, 0, KIO::convertSize( iterator->txBytes ) );
tableDaily->setText( row, 1, KIO::convertSize( iterator->rxBytes ) );
tableDaily->setText( row, 2, KIO::convertSize( iterator->rxBytes + iterator->txBytes ) );
@ -81,7 +81,7 @@ void InterfaceStatisticsDialog::updateMonths()
int row = 0;
while ( iterator )
{
const KCalendarSystem* calendar = KGlobal::locale()->calendar();
const KCalendarSystem* calendar = TDEGlobal::locale()->calendar();
TQString monthName = calendar->monthName( iterator->month, iterator->year ) + " " + TQString::number( iterator->year );
tableMonthly->verticalHeader()->setLabel( row, monthName );
tableMonthly->setText( row, 0, KIO::convertSize( iterator->txBytes ) );

6
src/knemod/knemodaemon.cpp

@ -52,7 +52,7 @@ KNemoDaemon::KNemoDaemon( const TQCString& name )
mInstance( new TDEInstance( "knemo" ) ),
mNotifyInstance( new KNotifyClient::Instance( mInstance ) )
{
KGlobal::locale()->insertCatalogue( "knemod" );
TDEGlobal::locale()->insertCatalogue( "knemod" );
readConfig();
// select the backend from the config file
@ -108,7 +108,7 @@ void KNemoDaemon::readConfig()
config->setGroup( "General" );
mGeneralData.pollInterval = config->readNumEntry( "PollInterval", 1 );
mGeneralData.saveInterval = config->readNumEntry( "SaveInterval", 60 );
mGeneralData.statisticsDir = config->readEntry( "StatisticsDir", KGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mGeneralData.statisticsDir = config->readEntry( "StatisticsDir", TDEGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mGeneralData.toolTipContent = config->readNumEntry( "ToolTipContent", 2 );
TQStrList list;
int numEntries = config->readListEntry( "Interfaces", list );
@ -188,7 +188,7 @@ void KNemoDaemon::reparseConfiguration()
config->setGroup( "General" );
mGeneralData.pollInterval = config->readNumEntry( "PollInterval", 1 );
mGeneralData.saveInterval = config->readNumEntry( "SaveInterval", 60 );
mGeneralData.statisticsDir = config->readEntry( "StatisticsDir", KGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mGeneralData.statisticsDir = config->readEntry( "StatisticsDir", TDEGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mGeneralData.toolTipContent = config->readNumEntry( "ToolTipContent", 2 );
// restart the timer with the new interval

Loading…
Cancel
Save