Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 11 years ago
parent 05485bbfed
commit 35676c0c2e

@ -113,7 +113,7 @@ void audio::setTheme( const TQString &newTheme )
a->audioMap.clear(); a->audioMap.clear();
a->fileRef.clear(); a->fileRef.clear();
if( !KIO::NetAccess::download( newTheme + "theme.conf" , configFile ) ) if( !TDEIO::NetAccess::download( newTheme + "theme.conf" , configFile ) )
{ {
kdWarning() << "audio::setTheme: Can not access theme.conf from " << newTheme << endl; kdWarning() << "audio::setTheme: Can not access theme.conf from " << newTheme << endl;
return; return;
@ -145,7 +145,7 @@ void audio::setTheme( const TQString &newTheme )
a->firstTime = FALSE; a->firstTime = FALSE;
delete themeConfig; delete themeConfig;
KIO::NetAccess::removeTempFile( configFile ); TDEIO::NetAccess::removeTempFile( configFile );
} }
void audio::prepFile( const TQString &source, const int &ref ) void audio::prepFile( const TQString &source, const int &ref )
{ {
@ -159,7 +159,7 @@ void audio::prepFile( const TQString &source, const int &ref )
dest->setAutoDelete( TRUE ); dest->setAutoDelete( TRUE );
filename = dest->name(); filename = dest->name();
if( !KIO::NetAccess::download( source, filename ) ) if( !TDEIO::NetAccess::download( source, filename ) )
{ {
kdWarning() << "audio::prepFile: Can not download " << source << endl; kdWarning() << "audio::prepFile: Can not download " << source << endl;
delete dest; delete dest;

@ -155,7 +155,7 @@ void io_internet::connectToServer()
TQApplication::postEvent( tqApp->mainWidget(), new TQCustomEvent( EVENT_Del_IO_Net ) ); TQApplication::postEvent( tqApp->mainWidget(), new TQCustomEvent( EVENT_Del_IO_Net ) );
return; return;
} }
socket = new KSocket("127.0.0.1", myServer->Port + 1, 30); socket = new TDESocket("127.0.0.1", myServer->Port + 1, 30);
if(socket->socket() == -1) if(socket->socket() == -1)
{ {
/* try again on a different port, somehow the port hasn't been freed yet */ /* try again on a different port, somehow the port hasn't been freed yet */
@ -173,7 +173,7 @@ void io_internet::connectToServer()
TQApplication::postEvent( tqApp->mainWidget(), new TQCustomEvent( EVENT_Del_IO_Net ) ); TQApplication::postEvent( tqApp->mainWidget(), new TQCustomEvent( EVENT_Del_IO_Net ) );
return; return;
} }
socket = new KSocket("127.0.0.1", myServer->Port + 2, 30); socket = new TDESocket("127.0.0.1", myServer->Port + 2, 30);
if(socket->socket() == -1) if(socket->socket() == -1)
{ {
/* if we can't do it the second time, give up */ /* if we can't do it the second time, give up */
@ -187,7 +187,7 @@ void io_internet::connectToServer()
} }
else else
{ {
socket = new KSocket(myServer->URL, myServer->Port, 30); socket = new TDESocket(myServer->URL, myServer->Port, 30);
if(socket->socket() == -1) if(socket->socket() == -1)
{ {
/* Couldn't connect to server. Notify User and die gracefully */ /* Couldn't connect to server. Notify User and die gracefully */
@ -201,7 +201,7 @@ void io_internet::connectToServer()
socket->enableWrite(true); socket->enableWrite(true);
/* connect a signal to readReady */ /* connect a signal to readReady */
connect(socket, TQT_SIGNAL(readEvent(KSocket *)), this, TQT_SLOT(readCommand(KSocket *))); connect(socket, TQT_SIGNAL(readEvent(TDESocket *)), this, TQT_SLOT(readCommand(TDESocket *)));
/* setup the seekTimer and turn it off by default */ /* setup the seekTimer and turn it off by default */
seekTimer = new TQTimer(this); seekTimer = new TQTimer(this);
@ -383,7 +383,7 @@ void io_internet::send(const TQString& msg)
// io_internet::readCommand // io_internet::readCommand
// //
/////////////////////////////////////// ///////////////////////////////////////
void io_internet::readCommand(KSocket* socket) void io_internet::readCommand(TDESocket* socket)
{ {
char buffer[READ_BUFFER_SIZE]; char buffer[READ_BUFFER_SIZE];
TQString tmp; TQString tmp;

@ -30,7 +30,7 @@
#include "challenge_graph.h" #include "challenge_graph.h"
#include "tab_seeklist.h" #include "tab_seeklist.h"
class KSocket; class TDESocket;
class TDEProcess; class TDEProcess;
class resource; class resource;
class core; class core;
@ -80,7 +80,7 @@ class io_internet : public io_base
public slots: public slots:
virtual void recvCMD(const Command& command); virtual void recvCMD(const Command& command);
void readCommand(KSocket *); void readCommand(TDESocket *);
void sendUserName(void); void sendUserName(void);
void sendPassword(void); void sendPassword(void);
void send(const TQString&); void send(const TQString&);
@ -115,7 +115,7 @@ class io_internet : public io_base
/* These are used for the connection & logon */ /* These are used for the connection & logon */
TQFile *Log; TQFile *Log;
KSocket *socket; TDESocket *socket;
TDEProcess *myTimeseal; TDEProcess *myTimeseal;
struct serverResource *myServer; struct serverResource *myServer;
int loginStage; int loginStage;

@ -985,22 +985,22 @@ void Knights::installThemes( void )
for( loop = 0; loop < files.count(); loop++ ) for( loop = 0; loop < files.count(); loop++ )
{ {
/* Try writing to the global theme dir */ /* Try writing to the global theme dir */
if( !KIO::NetAccess::copy( files[loop], KURL( TQString( Resource->themeDir() + files[loop].filename() ) ) ) ) if( !TDEIO::NetAccess::copy( files[loop], KURL( TQString( Resource->themeDir() + files[loop].filename() ) ) ) )
{ {
/* Nope... Try a local .knights dir */ /* Nope... Try a local .knights dir */
allerror += "\n\n" + TQString( Resource->themeDir() + files[loop].filename() ) allerror += "\n\n" + TQString( Resource->themeDir() + files[loop].filename() )
+ " - " + KIO::NetAccess::lastErrorString(); + " - " + TDEIO::NetAccess::lastErrorString();
if( !KIO::NetAccess::exists( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) ) ) if( !TDEIO::NetAccess::exists( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) ) )
{ {
/* Create local .knights dir */ /* Create local .knights dir */
KIO::NetAccess::mkdir( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) ); TDEIO::NetAccess::mkdir( KURL( TQString( TQDir::homeDirPath() + "/.knights" ) ) );
} }
if( !KIO::NetAccess::copy( files[loop], KURL( TQString( TQDir::homeDirPath() + "/.knights/" + files[loop].filename() ) ) ) ) if( !TDEIO::NetAccess::copy( files[loop], KURL( TQString( TQDir::homeDirPath() + "/.knights/" + files[loop].filename() ) ) ) )
{ {
/* Nope, can't copy it anywhere */ /* Nope, can't copy it anywhere */
installError = TRUE; installError = TRUE;
allerror += "\n\n" + TQString( TQDir::homeDirPath() + "/.knights/" allerror += "\n\n" + TQString( TQDir::homeDirPath() + "/.knights/"
+ files[loop].filename() ) + " - " + KIO::NetAccess::lastErrorString(); + files[loop].filename() ) + " - " + TDEIO::NetAccess::lastErrorString();
} }
else else
{ {

@ -723,7 +723,7 @@ TQString pgn::getword( void )
bool pgn::open( const TQString &URL ) bool pgn::open( const TQString &URL )
{ {
close(); close();
if( !KIO::NetAccess::download( URL, tempFile ) ) if( !TDEIO::NetAccess::download( URL, tempFile ) )
return FALSE; return FALSE;
File.setName( tempFile ); File.setName( tempFile );
@ -750,7 +750,7 @@ void pgn::close( void )
} }
if( !tempFile.isEmpty() ) if( !tempFile.isEmpty() )
{ {
KIO::NetAccess::removeTempFile( tempFile ); TDEIO::NetAccess::removeTempFile( tempFile );
tempFile = ""; tempFile = "";
} }
} }

@ -100,7 +100,7 @@ resource::~resource()
TQStringList temps = TDEGlobal::dirs()->findAllResources("tmp","knights*"); TQStringList temps = TDEGlobal::dirs()->findAllResources("tmp","knights*");
for( int a=0; a < temps.count(); a++) for( int a=0; a < temps.count(); a++)
{ {
KIO::NetAccess::del( "file://" + temps[a] ); TDEIO::NetAccess::del( "file://" + temps[a] );
} */ } */
} }
/////////////////////////////////////// ///////////////////////////////////////
@ -657,11 +657,11 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex )
} }
/* load the theme.conf files */ /* load the theme.conf files */
if( !KIO::NetAccess::download( boardURL + "theme.conf", boardConf ) ) if( !TDEIO::NetAccess::download( boardURL + "theme.conf", boardConf ) )
kdWarning() << "Can not read theme.conf from " << boardURL << endl; kdWarning() << "Can not read theme.conf from " << boardURL << endl;
boardConfig = new KSimpleConfig( boardConf, TRUE ); boardConfig = new KSimpleConfig( boardConf, TRUE );
if( !KIO::NetAccess::download( chessmenURL + "theme.conf", chessmenConf ) ) if( !TDEIO::NetAccess::download( chessmenURL + "theme.conf", chessmenConf ) )
kdWarning() << "Can not read theme.conf from " << chessmenURL << endl; kdWarning() << "Can not read theme.conf from " << chessmenURL << endl;
chessmenConfig = new KSimpleConfig( chessmenConf, TRUE ); chessmenConfig = new KSimpleConfig( chessmenConf, TRUE );
@ -718,8 +718,8 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex )
/* Remove the theme.conf files */ /* Remove the theme.conf files */
delete boardConfig; delete boardConfig;
delete chessmenConfig; delete chessmenConfig;
KIO::NetAccess::removeTempFile( boardConf ); TDEIO::NetAccess::removeTempFile( boardConf );
KIO::NetAccess::removeTempFile( chessmenConf ); TDEIO::NetAccess::removeTempFile( chessmenConf );
/* Cleanup */ /* Cleanup */
pixCache->clear(); pixCache->clear();
@ -737,11 +737,11 @@ void resource::loadThemeItem( const TQString &URL, TQImage &Image )
{ {
TQString tempFile; TQString tempFile;
if( KIO::NetAccess::download( URL, tempFile ) ) if( TDEIO::NetAccess::download( URL, tempFile ) )
{ {
if( !Image.load( tempFile ) ) if( !Image.load( tempFile ) )
kdError() << "resource::LoadThemeItem: Can not load " << tempFile << ", which comes from " << URL << endl; kdError() << "resource::LoadThemeItem: Can not load " << tempFile << ", which comes from " << URL << endl;
KIO::NetAccess::removeTempFile( tempFile ); TDEIO::NetAccess::removeTempFile( tempFile );
} }
else else
kdError() << "resource::LoadThemeItem: Can not extract " << URL << endl; kdError() << "resource::LoadThemeItem: Can not extract " << URL << endl;
@ -964,13 +964,13 @@ TQString resource::themeURL( const TQString theme )
{ {
TQString fullURL; TQString fullURL;
fullURL = "tar:" + GlobalDataDir + "themes/" + theme; fullURL = "tar:" + GlobalDataDir + "themes/" + theme;
if( !KIO::NetAccess::exists( fullURL ) ) if( !TDEIO::NetAccess::exists( fullURL ) )
{ {
fullURL = "tar:" + TQDir::currentDirPath() + "../media/" + theme; fullURL = "tar:" + TQDir::currentDirPath() + "../media/" + theme;
if( !KIO::NetAccess::exists( fullURL ) ) if( !TDEIO::NetAccess::exists( fullURL ) )
{ {
fullURL = "tar:" + TQDir::homeDirPath() + "/.knights/" + theme; fullURL = "tar:" + TQDir::homeDirPath() + "/.knights/" + theme;
if( !KIO::NetAccess::exists( fullURL ) ) if( !TDEIO::NetAccess::exists( fullURL ) )
{ {
kdWarning() << "The theme " << theme << " does not exist in any valid path." << endl; kdWarning() << "The theme " << theme << " does not exist in any valid path." << endl;
return TQString(); return TQString();

@ -56,7 +56,7 @@ class TabManager : public TQObject
private: private:
TabBoxList myList; TabBoxList myList;
KConfig *appConfig; TDEConfig *appConfig;
resource *myResource; resource *myResource;
}; };

Loading…
Cancel
Save