summaryrefslogtreecommitdiffstats
path: root/src/knemod/knemodaemon.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 18:16:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 18:16:06 +0000
commit02a6c8f36311eb6225066df35adf8d00f9cd942b (patch)
treeceb91c373877f7a69209e184c81b53dc6f9402d7 /src/knemod/knemodaemon.cpp
parent09e6e27fe85b2efb28072f1c81f6581fa6837d92 (diff)
downloadknemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.tar.gz
knemo-02a6c8f36311eb6225066df35adf8d00f9cd942b.zip
TQt4 port knemo
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knemo@1238869 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/knemod/knemodaemon.cpp')
-rw-r--r--src/knemod/knemodaemon.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/knemod/knemodaemon.cpp b/src/knemod/knemodaemon.cpp
index e5a7f88..5accc6d 100644
--- a/src/knemod/knemodaemon.cpp
+++ b/src/knemod/knemodaemon.cpp
@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
-#include <qtimer.h>
-#include <qstrlist.h>
+#include <tqtimer.h>
+#include <tqstrlist.h>
#include <kdebug.h>
#include <kglobal.h>
@@ -34,15 +34,15 @@
#include "backendbase.h"
#include "daemonregistry.h"
-QString KNemoDaemon::sSelectedInterface = QString::null;
+TQString KNemoDaemon::sSelectedInterface = TQString();
extern "C" {
- KDE_EXPORT KDEDModule *create_knemod(const QCString &name) {
+ KDE_EXPORT KDEDModule *create_knemod(const TQCString &name) {
return new KNemoDaemon(name);
}
}
-KNemoDaemon::KNemoDaemon( const QCString& name )
+KNemoDaemon::KNemoDaemon( const TQCString& name )
: KDEDModule( name ),
mColorVLines( 0x04FB1D ),
mColorHLines( 0x04FB1D ),
@@ -63,7 +63,7 @@ KNemoDaemon::KNemoDaemon( const QCString& name )
bool foundBackend = false;
int i;
- for ( i = 0; DaemonRegistry[i].name != QString::null; i++ )
+ for ( i = 0; DaemonRegistry[i].name != TQString(); i++ )
{
if ( DaemonRegistry[i].name == mBackendName )
{
@@ -80,8 +80,8 @@ KNemoDaemon::KNemoDaemon( const QCString& name )
mInterfaceDict.setAutoDelete( true );
- mPollTimer = new QTimer();
- connect( mPollTimer, SIGNAL( timeout() ), this, SLOT( updateInterfaces() ) );
+ mPollTimer = new TQTimer();
+ connect( mPollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( updateInterfaces() ) );
mPollTimer->start( mGeneralData.pollInterval * 1000 );
}
@@ -93,7 +93,7 @@ KNemoDaemon::~KNemoDaemon()
delete mNotifyInstance;
delete mInstance;
- QDictIterator<Interface> it( mInterfaceDict );
+ TQDictIterator<Interface> it( mInterfaceDict );
for ( ; it.current(); )
{
mInterfaceDict.remove( it.currentKey() );
@@ -110,7 +110,7 @@ void KNemoDaemon::readConfig()
mGeneralData.saveInterval = config->readNumEntry( "SaveInterval", 60 );
mGeneralData.statisticsDir = config->readEntry( "StatisticsDir", KGlobal::dirs()->saveLocation( "data", "knemo/" ) );
mGeneralData.toolTipContent = config->readNumEntry( "ToolTipContent", 2 );
- QStrList list;
+ TQStrList list;
int numEntries = config->readListEntry( "Interfaces", list );
if ( numEntries == 0 )
@@ -120,7 +120,7 @@ void KNemoDaemon::readConfig()
for ( interface = list.first(); interface; interface = list.next() )
{
Interface* iface = new Interface( interface, mGeneralData, mPlotterSettings );
- QString group( "Interface_" );
+ TQString group( "Interface_" );
group += interface;
if ( config->hasGroup( group ) )
{
@@ -138,13 +138,13 @@ void KNemoDaemon::readConfig()
int numCommands = config->readNumEntry( "NumCommands" );
for ( int i = 0; i < numCommands; i++ )
{
- QString entry;
+ TQString entry;
InterfaceCommand cmd;
- entry = QString( "RunAsRoot%1" ).arg( i + 1 );
+ entry = TQString( "RunAsRoot%1" ).tqarg( i + 1 );
cmd.runAsRoot = config->readBoolEntry( entry );
- entry = QString( "Command%1" ).arg( i + 1 );
+ entry = TQString( "Command%1" ).tqarg( i + 1 );
cmd.command = config->readEntry( entry );
- entry = QString( "MenuText%1" ).arg( i + 1 );
+ entry = TQString( "MenuText%1" ).tqarg( i + 1 );
cmd.menuText = config->readEntry( entry );
settings.commands.append( cmd );
}
@@ -182,7 +182,7 @@ void KNemoDaemon::readConfig()
void KNemoDaemon::reparseConfiguration()
{
// Read the settings from the config file.
- QDict<InterfaceSettings> settingsDict;
+ TQDict<InterfaceSettings> settingsDict;
KConfig* config = new KConfig( "knemorc", false );
config->setGroup( "General" );
@@ -195,14 +195,14 @@ void KNemoDaemon::reparseConfiguration()
mPollTimer->changeInterval( mGeneralData.pollInterval * 1000 );
// select the backend from the config file
- QString backend = config->readEntry( "Backend", "Nettools" );
+ TQString backend = config->readEntry( "Backend", "Nettools" );
if ( mBackendName != backend )
{
bool foundBackend = false;
mBackendName = backend;
int i;
- for ( i = 0; DaemonRegistry[i].name != QString::null; i++ )
+ for ( i = 0; DaemonRegistry[i].name != TQString(); i++ )
{
if ( DaemonRegistry[i].name == backend )
{
@@ -218,7 +218,7 @@ void KNemoDaemon::reparseConfiguration()
}
}
- QStrList list;
+ TQStrList list;
int numEntries = config->readListEntry( "Interfaces", list );
if ( numEntries == 0 )
@@ -227,7 +227,7 @@ void KNemoDaemon::reparseConfiguration()
char* interface;
for ( interface = list.first(); interface; interface = list.next() )
{
- QString group( "Interface_" );
+ TQString group( "Interface_" );
group += interface;
InterfaceSettings* settings = new InterfaceSettings();
if ( config->hasGroup( group ) )
@@ -245,13 +245,13 @@ void KNemoDaemon::reparseConfiguration()
int numCommands = config->readNumEntry( "NumCommands" );
for ( int i = 0; i < numCommands; i++ )
{
- QString entry;
+ TQString entry;
InterfaceCommand cmd;
- entry = QString( "RunAsRoot%1" ).arg( i + 1 );
+ entry = TQString( "RunAsRoot%1" ).tqarg( i + 1 );
cmd.runAsRoot = config->readBoolEntry( entry );
- entry = QString( "Command%1" ).arg( i + 1 );
+ entry = TQString( "Command%1" ).tqarg( i + 1 );
cmd.command = config->readEntry( entry );
- entry = QString( "MenuText%1" ).arg( i + 1 );
+ entry = TQString( "MenuText%1" ).tqarg( i + 1 );
cmd.menuText = config->readEntry( entry );
settings->commands.append( cmd );
}
@@ -284,10 +284,10 @@ void KNemoDaemon::reparseConfiguration()
// Remove all interfaces that the user deleted from
// the internal list.
- QDictIterator<Interface> it( mInterfaceDict );
+ TQDictIterator<Interface> it( mInterfaceDict );
for ( ; it.current(); )
{
- if ( settingsDict.find( it.currentKey() ) == 0 )
+ if ( settingsDict.tqfind( it.currentKey() ) == 0 )
{
config->deleteGroup( "Interface_" + it.currentKey() );
mInterfaceDict.remove( it.currentKey() );
@@ -300,11 +300,11 @@ void KNemoDaemon::reparseConfiguration()
delete config;
// Update all other interfaces and add new ones.
- QDictIterator<InterfaceSettings> setIt( settingsDict );
+ TQDictIterator<InterfaceSettings> setIt( settingsDict );
for ( ; setIt.current(); ++setIt )
{
Interface* iface;
- if ( mInterfaceDict.find( setIt.currentKey() ) == 0 )
+ if ( mInterfaceDict.tqfind( setIt.currentKey() ) == 0 )
{
iface = new Interface( setIt.currentKey(), mGeneralData, mPlotterSettings );
mInterfaceDict.insert( setIt.currentKey(), iface );
@@ -325,13 +325,13 @@ void KNemoDaemon::reparseConfiguration()
}
}
-QString KNemoDaemon::getSelectedInterface()
+TQString KNemoDaemon::getSelectedInterface()
{
// Reset the variable to avoid preselecting an interface when
// the user opens the control center module from the control
// center afterwards.
- QString tmp = sSelectedInterface;
- sSelectedInterface = QString::null;
+ TQString tmp = sSelectedInterface;
+ sSelectedInterface = TQString();
return tmp;
}