Rename KComp to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent aad6cb5621
commit c8734b9ab6

@ -148,7 +148,7 @@ KBg::KBg()
KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString(), 0, 0, 0, actionCollection(), "command_lineedit");
actionCmdLine->setAutoSized(true);
cmdLine->completionObject()->setOrder(KCompletion::Weighted);
cmdLine->completionObject()->setOrder(TDECompletion::Weighted);
connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(handleCmd(const TQString &)));
/*
* Done with the actions, create the XML-defined parts of the

@ -160,7 +160,7 @@ class KChatBasePrivate;
* KChatBase provides a complete chat widget, featuring different sending means
* (e.g. "send to all", "send to player1", "send to group2" and so on - see
* addSendingEntry). It also provides full auto-completion capabilities (see
* KCompletion and KLineEdit) which defaults to disabled. The user can
* TDECompletion and KLineEdit) which defaults to disabled. The user can
* change this by right-clicking on the KLineEdit widget and selecting the
* desired behaviour. You can also change this manually by calling
* setCompletionMode.
@ -460,7 +460,7 @@ protected:
* message.
*
* Note that you MUST add the message to the widget when this function
* is called as it has already been added to the KCompletion object
* is called as it has already been added to the TDECompletion object
* of the KLineEdit widget!
*
* Must be implemented in derived classes
@ -497,7 +497,7 @@ protected:
private slots:
/**
* Check if a text was entered and if acceptMessage returns true.
* Then add the message to the KCompletion object of the KLineEdit
* Then add the message to the TDECompletion object of the KLineEdit
* widget and call returnPressed
**/
void slotReturnPressed(const TQString&);

@ -38,7 +38,7 @@
#define START_REK 1 // (0) 1:Nur Stellungsbewertung bei Level 1
// 0:Level 1 schon eine Rekursion
KComputer::KComputer() : TQObject(0,0)
TDEComputer::TDEComputer() : TQObject(0,0)
{
InitField();
@ -57,12 +57,12 @@ KComputer::KComputer() : TQObject(0,0)
this,TQT_SLOT(slotInit(TQDataStream & ,int )));
connect(&proc,TQT_SIGNAL(signalTurn(TQDataStream &,bool )),
this,TQT_SLOT(slotTurn(TQDataStream & ,bool )));
fprintf(stderr, "----------------->\nKComputer::Computer\n");
fprintf(stderr, "----------------->\nTDEComputer::Computer\n");
}
void KComputer::slotInit(TQDataStream &in,int id)
void TDEComputer::slotInit(TQDataStream &in,int id)
{
fprintf(stderr,"----------------->\nKComputer::slotInit\nid:%d\n",id);
fprintf(stderr,"----------------->\nTDEComputer::slotInit\nid:%d\n",id);
/*
TQByteArray buffer;
TQDataStream out(buffer,IO_WriteOnly);
@ -72,11 +72,11 @@ void KComputer::slotInit(TQDataStream &in,int id)
*/
}
void KComputer::slotTurn(TQDataStream &in,bool turn)
void TDEComputer::slotTurn(TQDataStream &in,bool turn)
{
TQByteArray buffer;
TQDataStream out(buffer,IO_WriteOnly);
fprintf(stderr,"----------------->\nKComputer::slotTurn\nturn:%d\n",turn);
fprintf(stderr,"----------------->\nTDEComputer::slotTurn\nturn:%d\n",turn);
if (turn)
{
// Create a move
@ -87,7 +87,7 @@ void KComputer::slotTurn(TQDataStream &in,bool turn)
}
}
void KComputer::sendValue(long value)
void TDEComputer::sendValue(long value)
{
TQ_INT8 cid=1; // notifies our KGameIO that this is a value message
int id=KGameMessage::IdProcessQuery;
@ -97,7 +97,7 @@ void KComputer::sendValue(long value)
proc.sendSystemMessage(out,id,0);
}
long KComputer::think(TQDataStream &in,TQDataStream &out,bool hint)
long TDEComputer::think(TQDataStream &in,TQDataStream &out,bool hint)
{
TQ_INT32 pl;
TQ_INT32 move;
@ -174,9 +174,9 @@ long KComputer::think(TQDataStream &in,TQDataStream &out,bool hint)
return aktwert;
}
void KComputer::slotCommand(TQDataStream &in,int msgid,int receiver,int sender)
void TDEComputer::slotCommand(TQDataStream &in,int msgid,int receiver,int sender)
{
fprintf(stderr,"----------------->\nKComputer::slotCommand\nMsgid:%d\n",msgid);
fprintf(stderr,"----------------->\nTDEComputer::slotCommand\nMsgid:%d\n",msgid);
TQByteArray buffer;
TQDataStream out(buffer,IO_WriteOnly);
switch(msgid)
@ -194,14 +194,14 @@ void KComputer::slotCommand(TQDataStream &in,int msgid,int receiver,int sender)
}
break;
default:
fprintf(stderr,"KComputer:: unknown command Msgid:%d\n",msgid);
fprintf(stderr,"TDEComputer:: unknown command Msgid:%d\n",msgid);
}
}
/**
* Computer Routinen
*/
int KComputer::GetCompMove()
int TDEComputer::GetCompMove()
{
int cmove;
long cmax,wert;
@ -235,7 +235,7 @@ int KComputer::GetCompMove()
return cmove;
}
long KComputer::Wertung(Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[],int reklev,int zug)
long TDEComputer::Wertung(Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[],int reklev,int zug)
{
static long gaus[]={10,50,300,500,300,50,10};
FARBE lfeld[SIZE_Y_ALL+1][SIZE_X+1];
@ -272,7 +272,7 @@ long KComputer::Wertung(Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[],int rek
return(-max);
}/*end wertung*/
long KComputer::Bewertung(Farbe farbe,FARBE feld[][SIZE_X+1])
long TDEComputer::Bewertung(Farbe farbe,FARBE feld[][SIZE_X+1])
{
/* Abstand: 0 1 2 3 4 5 */
static long myWERT[]={2200,600, 300, 75, 20, 0};
@ -332,7 +332,7 @@ static long steinWERT[4][5]=
return(wert);
}
Farbe KComputer::GameOver(FARBE feld[][SIZE_X+1],char anzahl[])
Farbe TDEComputer::GameOver(FARBE feld[][SIZE_X+1],char anzahl[])
{
Farbe thiscolor,field;
int x,y,cnt;
@ -353,7 +353,7 @@ Farbe KComputer::GameOver(FARBE feld[][SIZE_X+1],char anzahl[])
return(Niemand);
}
Farbe KComputer::SwitchPlayer(Farbe m_amZug)
Farbe TDEComputer::SwitchPlayer(Farbe m_amZug)
{
if (m_amZug==Niemand)
m_amZug=amZug;
@ -365,7 +365,7 @@ Farbe KComputer::SwitchPlayer(Farbe m_amZug)
return amZug;
}
void KComputer::DoMove(char move,Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[])
void TDEComputer::DoMove(char move,Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[])
{
int x,i,y;
@ -392,7 +392,7 @@ void KComputer::DoMove(char move,Farbe farbe,FARBE feld[][SIZE_X+1],char anzahl[
}
}
void KComputer::InitField() {
void TDEComputer::InitField() {
int x,y;
for (y=0;y<=SIZE_Y_ALL;y++)
anzahlmatrix[y]=0;
@ -408,7 +408,7 @@ void KComputer::InitField() {
}/* next y */
}
long KComputer::random(long max)
long TDEComputer::random(long max)
{
long wert;
wert=proc.random()->getLong(max);
@ -420,9 +420,9 @@ int main(int argc ,char * argv[])
{
// This is the computer player...it should do the calulation
// It doesn't do much here
fprintf(stderr,"Vor KComputer\n");
fprintf(stderr,"Vor TDEComputer\n");
fflush(stderr);
KComputer comp;
TDEComputer comp;
fprintf(stderr,"Vor exec\n");
// And start the event loop
comp.proc.exec(argc,argv);

@ -28,14 +28,14 @@ typedef char FARBE;
#define SIZE_X 6
#define SIZE_Y 5
class KComputer : public TQObject
class TDEComputer : public TQObject
{
Q_OBJECT
public:
KComputer();
TDEComputer();
// The KGameProcess is the main program and event loop
KGameProcess proc;

Loading…
Cancel
Save