diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 18:28:11 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 18:28:11 +0000 |
commit | 9ca7f795653bc31cf1d206da1e12c801a8380fa6 (patch) | |
tree | ee829debe9ad76ce8fc3b10cdc376754dba5ed03 /knights/resource.cpp | |
parent | 98cb2d5fa21e616cfea012f80bf1d989cfe264e3 (diff) | |
download | knights-9ca7f795653bc31cf1d206da1e12c801a8380fa6.tar.gz knights-9ca7f795653bc31cf1d206da1e12c801a8380fa6.zip |
TQt4 port knights
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knights@1238529 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knights/resource.cpp')
-rw-r--r-- | knights/resource.cpp | 246 |
1 files changed, 123 insertions, 123 deletions
diff --git a/knights/resource.cpp b/knights/resource.cpp index ba172b9..d8f2c57 100644 --- a/knights/resource.cpp +++ b/knights/resource.cpp @@ -22,9 +22,9 @@ #include <kiconloader.h> #include <kmdcodec.h> #include <kio/netaccess.h> -/* Qt */ -#include <qdir.h> -#include <qimage.h> +/* TQt */ +#include <tqdir.h> +#include <tqimage.h> /* Local */ #include "resource.h" #include "audio.h" @@ -48,18 +48,18 @@ resource::resource(KCmdLineArgs *args) { GlobalDataDir = ""; Widget_Height = 20; // prevents max_size error for thinbuttons on init - Icons = new KIconLoader( QString( "knights" ) ); + Icons = new KIconLoader( TQString( "knights" ) ); Audio = new audio(); /* Define ConsoleStyle, our RichText */ - ConsoleStyle = new QStyleSheet( 0, "ConsoleStyle" ); - SSI_Default = new QStyleSheetItem( ConsoleStyle, "K_STD" ); - SSI_PrivateTell = new QStyleSheetItem( ConsoleStyle, "K_PVT" ); - SSI_ChannelTell = new QStyleSheetItem( ConsoleStyle, "K_CH" ); - SSI_Shout = new QStyleSheetItem( ConsoleStyle, "K_SHT" ); - SSI_Whisper = new QStyleSheetItem( ConsoleStyle, "K_WSP" ); - SSI_Notification = new QStyleSheetItem( ConsoleStyle, "K_NOT" ); - QStyleSheet::setDefaultSheet( ConsoleStyle ); + ConsoleStyle = new TQStyleSheet( 0, "ConsoleStyle" ); + SSI_Default = new TQStyleSheetItem( ConsoleStyle, "K_STD" ); + SSI_PrivateTell = new TQStyleSheetItem( ConsoleStyle, "K_PVT" ); + SSI_ChannelTell = new TQStyleSheetItem( ConsoleStyle, "K_CH" ); + SSI_Shout = new TQStyleSheetItem( ConsoleStyle, "K_SHT" ); + SSI_Whisper = new TQStyleSheetItem( ConsoleStyle, "K_WSP" ); + SSI_Notification = new TQStyleSheetItem( ConsoleStyle, "K_NOT" ); + TQStyleSheet::setDefaultSheet( ConsoleStyle ); /* Define GlobalDataDir... This is very important! */ GlobalDataDir = args->getOption( "d" ); @@ -73,7 +73,7 @@ resource::resource(KCmdLineArgs *args) if( GlobalDataDir.right(1) != "/" ) GlobalDataDir += '/'; /* Allocate Accel */ - myAccel = new Accel( qApp->mainWidget() ); + myAccel = new Accel( tqApp->mainWidget() ); /* Allocate TabManager */ tabManager = new TabManager( this ); @@ -97,7 +97,7 @@ resource::~resource() delete myAccel; /* Remove temp files that we missed - QStringList temps = KGlobal::dirs()->findAllResources("tmp","knights*"); + TQStringList temps = KGlobal::dirs()->findAllResources("tmp","knights*"); for( int a=0; a < temps.count(); a++) { KIO::NetAccess::del( "file://" + temps[a] ); @@ -111,9 +111,9 @@ resource::~resource() void resource::ConfigRead( void ) { struct passwd *passwd; - QString sysName; - QString buffer; - QDesktopWidget *desktop = QApplication::desktop(); + TQString sysName; + TQString buffer; + TQDesktopWidget *desktop = TQApplication::desktop(); /* Get Initial Board Size In Case This Install Is New */ int initSize = ( desktop->height() >> 3 ) - 32; @@ -126,7 +126,7 @@ void resource::ConfigRead( void ) passwd = getpwuid( getuid() ); sysName = passwd->pw_gecos; if( sysName.isEmpty() ) - sysName = QStringList::split( ",", QString(passwd->pw_name) ).first(); + sysName = TQStringList::split( ",", TQString(passwd->pw_name) ).first(); /* Cursors */ CURSOR_Standard = KCursor::arrowCursor(); @@ -160,12 +160,12 @@ void resource::ConfigRead( void ) OPTION_Book_Black = CFG->readBoolEntry( "BookBlack", FALSE ); OPTION_Pause_On_Minimize = CFG->readBoolEntry( "PauseOnMinimize", TRUE ); OPTION_Reuse_PGN = CFG->readBoolEntry( "ReusePGN", FALSE ); - PGN_Filename = CFG->readEntry( "PGNFilename", QString::null ); - SCID_Image_Path = CFG->readEntry( "SCIDImages", QString::null ); + PGN_Filename = CFG->readEntry( "PGNFilename", TQString() ); + SCID_Image_Path = CFG->readEntry( "SCIDImages", TQString() ); OPTION_Auto_Close_Last_ICS = CFG->readBoolEntry( "AutoCloseLastICS", TRUE ); OPTION_Show_Extended_PGN = CFG->readEntry( "ShowExtendedPGN", FALSE ); OPTION_Auto_Call_Flag = CFG->readBoolEntry( "AutoCallFlag", TRUE ); - Email_Command_Line = CFG->readEntry( "EmailCommandLine", QString("kmail -s %s --attach %m %a") ); + Email_Command_Line = CFG->readEntry( "EmailCommandLine", TQString("kmail -s %s --attach %m %a") ); Accepted_License = CFG->readBoolEntry( "Alg2p", FALSE ); /* Display */ @@ -174,7 +174,7 @@ void resource::ConfigRead( void ) OPTION_Show_Last_Move = CFG->readBoolEntry( "ShowLastMove", TRUE ); OPTION_Animate_Moves = CFG->readBoolEntry( "AnimateMoves", FALSE ); OPTION_Show_Coord = CFG->readBoolEntry( "ShowCoord", FALSE ); - OPTION_Board_Orientation = CFG->readBoolEntry( "BoardOrientation", 0 ); + OPTION_Board_Orientation = CFG->readBoolEntry( "BoardQt::Orientation", 0 ); /* ICS */ CFG->setGroup( "ICS" ); @@ -198,7 +198,7 @@ void resource::ConfigRead( void ) /* Notification Prompts */ CFG->setGroup( "Notification Messages" ); - PromptForSaving = CFG->readEntry( "PromptForSaving", QString::null ); + PromptForSaving = CFG->readEntry( "PromptForSaving", TQString() ); } /////////////////////////////////////// // @@ -233,7 +233,7 @@ void resource::ConfigWrite( void ) CFG->writeEntry( "Ponder", OPTION_Ponder ); CFG->writeEntry( "BookWhite", OPTION_Book_White ); CFG->writeEntry( "BookBlack", OPTION_Book_Black ); - CFG->writeEntry( "BoardOrientation", OPTION_Board_Orientation ); + CFG->writeEntry( "BoardQt::Orientation", OPTION_Board_Orientation ); CFG->writeEntry( "PauseOnMinimize", OPTION_Pause_On_Minimize ); CFG->writeEntry( "ReusePGN", OPTION_Reuse_PGN ); CFG->writeEntry( "PGNFilename", PGN_Filename ); @@ -279,9 +279,9 @@ void resource::ConfigWrite( void ) /////////////////////////////////////// void resource::ReadMatchParam( void ) { - QString buffer; - QStringList TCPs; - QStringList::Iterator QSL_IT; + TQString buffer; + TQStringList TCPs; + TQStringList::Iterator TQSL_IT; TCP tempTCP; TCPWhite.clear(); @@ -290,26 +290,26 @@ void resource::ReadMatchParam( void ) /* Handle Time Controls */ buffer = CFG->readEntry( "WhiteTCP", "40,900,0" ); - TCPs = QStringList::split( QString(","), buffer, FALSE ); - for( QSL_IT = TCPs.begin(); QSL_IT != TCPs.end(); ++QSL_IT ) + TCPs = TQStringList::split( TQString(","), buffer, FALSE ); + for( TQSL_IT = TCPs.begin(); TQSL_IT != TCPs.end(); ++TQSL_IT ) { - tempTCP.Moves = (*QSL_IT).toInt(); - ++QSL_IT; - tempTCP.Seconds = (*QSL_IT).toInt(); - ++QSL_IT; - tempTCP.Increment = (*QSL_IT).toInt(); + tempTCP.Moves = (*TQSL_IT).toInt(); + ++TQSL_IT; + tempTCP.Seconds = (*TQSL_IT).toInt(); + ++TQSL_IT; + tempTCP.Increment = (*TQSL_IT).toInt(); TCPWhite.append( tempTCP ); } TCPs.clear(); buffer = CFG->readEntry( "BlackTCP", "40,900,0" ); - TCPs = QStringList::split( QString(","), buffer, FALSE ); - for( QSL_IT = TCPs.begin(); QSL_IT != TCPs.end(); ++QSL_IT ) + TCPs = TQStringList::split( TQString(","), buffer, FALSE ); + for( TQSL_IT = TCPs.begin(); TQSL_IT != TCPs.end(); ++TQSL_IT ) { - tempTCP.Moves = (*QSL_IT).toInt(); - ++QSL_IT; - tempTCP.Seconds = (*QSL_IT).toInt(); - ++QSL_IT; - tempTCP.Increment = (*QSL_IT).toInt(); + tempTCP.Moves = (*TQSL_IT).toInt(); + ++TQSL_IT; + tempTCP.Seconds = (*TQSL_IT).toInt(); + ++TQSL_IT; + tempTCP.Increment = (*TQSL_IT).toInt(); TCPBlack.append( tempTCP ); } @@ -334,24 +334,24 @@ void resource::ReadMatchParam( void ) /////////////////////////////////////// void resource::WriteMatchParam( void ) { - QString buffer; + TQString buffer; TCPList::Iterator TCP_IT; CFG->setGroup( "Match Paramaters" ); /* Handle Time Controls */ for( TCP_IT = TCPWhite.begin(); TCP_IT != TCPWhite.end(); ++TCP_IT ) { - buffer += QString::number( (*TCP_IT).Moves ) + ","; - buffer += QString::number( (*TCP_IT).Seconds ) + ","; - buffer += QString::number( (*TCP_IT).Increment ) + ","; + buffer += TQString::number( (*TCP_IT).Moves ) + ","; + buffer += TQString::number( (*TCP_IT).Seconds ) + ","; + buffer += TQString::number( (*TCP_IT).Increment ) + ","; } CFG->writeEntry( "WhiteTCP", buffer ); buffer = ""; for( TCP_IT = TCPBlack.begin(); TCP_IT != TCPBlack.end(); ++TCP_IT ) { - buffer += QString::number( (*TCP_IT).Moves ) + ","; - buffer += QString::number( (*TCP_IT).Seconds ) + ","; - buffer += QString::number( (*TCP_IT).Increment ) + ","; + buffer += TQString::number( (*TCP_IT).Moves ) + ","; + buffer += TQString::number( (*TCP_IT).Seconds ) + ","; + buffer += TQString::number( (*TCP_IT).Increment ) + ","; } CFG->writeEntry( "BlackTCP", buffer ); /* Match Rules */ @@ -375,16 +375,16 @@ void resource::WriteMatchParam( void ) void resource::ReadEngines( void ) { engineResource temp; - QStringList engineList; - QStringList::Iterator engineListIT; - QString buffer; + TQStringList engineList; + TQStringList::Iterator engineListIT; + TQString buffer; engines.clear(); CFG->setGroup( "General" ); buffer = CFG->readEntry( "Engines" ); if( buffer.isEmpty() ) return; - engineList = QStringList::split( QString(","), buffer, FALSE ); + engineList = TQStringList::split( TQString(","), buffer, FALSE ); for ( engineListIT = engineList.begin(); engineListIT != engineList.end(); ++engineListIT ) { if( !CFG->hasGroup( (*engineListIT) ) ) continue; @@ -408,12 +408,12 @@ void resource::ReadEngines( void ) /////////////////////////////////////// void resource::WriteEngines( void ) { - QString buffer; + TQString buffer; CFG->setGroup( "General" ); if( engines.isEmpty() ) { - CFG->writeEntry( "Engines", QString( "" ) ); + CFG->writeEntry( "Engines", TQString( "" ) ); return; } for ( enginesIT = engines.begin(); enginesIT != engines.end(); ++enginesIT ) @@ -441,16 +441,16 @@ void resource::WriteEngines( void ) void resource::ReadServers( void ) { serverResource temp; - QStringList serverList; - QStringList::Iterator serverListIT; - QString buffer; + TQStringList serverList; + TQStringList::Iterator serverListIT; + TQString buffer; servers.clear(); CFG->setGroup( "General" ); buffer = CFG->readEntry( "Servers" ); if( buffer.isEmpty() ) return; - serverList = QStringList::split( QString(","), buffer, FALSE ); + serverList = TQStringList::split( TQString(","), buffer, FALSE ); for ( serverListIT = serverList.begin(); serverListIT != serverList.end(); ++serverListIT ) { if( !CFG->hasGroup( (*serverListIT) ) ) continue; @@ -474,12 +474,12 @@ void resource::ReadServers( void ) /////////////////////////////////////// void resource::WriteServers( void ) { - QString buffer; + TQString buffer; CFG->setGroup( "General" ); if( servers.isEmpty() ) { - CFG->writeEntry( "Servers", QString( "" ) ); + CFG->writeEntry( "Servers", TQString( "" ) ); return; } for ( serversIT = servers.begin(); serversIT != servers.end(); ++serversIT ) @@ -507,9 +507,9 @@ void resource::WriteServers( void ) // resource::themeDir // /////////////////////////////////////// -QString resource::themeDir( void ) +TQString resource::themeDir( void ) { - return QString( GlobalDataDir + "themes/" ); + return TQString( GlobalDataDir + "themes/" ); } /////////////////////////////////////// // @@ -518,7 +518,7 @@ QString resource::themeDir( void ) /////////////////////////////////////// void resource::readThemeDir( void ) { - QDir themesDir; + TQDir themesDir; Boards.clear(); Chessmen.clear(); @@ -527,7 +527,7 @@ void resource::readThemeDir( void ) themesDir.setNameFilter( "KB*" ); themesDir = GlobalDataDir + "themes/"; Boards += themesDir.entryList(); - themesDir = QDir::homeDirPath() + "/.knights/"; + themesDir = TQDir::homeDirPath() + "/.knights/"; if( themesDir.exists() ) Boards += themesDir.entryList(); themesDir = "../media/"; if( themesDir.exists() ) Boards += themesDir.entryList(); @@ -536,7 +536,7 @@ void resource::readThemeDir( void ) themesDir.setNameFilter( "KC*" ); themesDir = GlobalDataDir + "themes/"; Chessmen += themesDir.entryList(); - themesDir = QDir::homeDirPath() + "/.knights/"; + themesDir = TQDir::homeDirPath() + "/.knights/"; if( themesDir.exists() ) Chessmen += themesDir.entryList(); themesDir = "../media/"; if( themesDir.exists() ) Chessmen += themesDir.entryList(); @@ -545,7 +545,7 @@ void resource::readThemeDir( void ) themesDir.setNameFilter( "KS*" ); themesDir = GlobalDataDir + "themes/"; Sounds += themesDir.entryList(); - themesDir = QDir::homeDirPath() + "/.knights/"; + themesDir = TQDir::homeDirPath() + "/.knights/"; if( themesDir.exists() ) Sounds += themesDir.entryList(); themesDir = "../media/"; if( themesDir.exists() ) Sounds += themesDir.entryList(); @@ -556,9 +556,9 @@ void resource::readThemeDir( void ) // resource::getBoard // /////////////////////////////////////// -QString resource::getBoard( int Index ) +TQString resource::getBoard( int Index ) { - if( Index > (signed)Boards.count() ) return QString::null; + if( Index > (signed)Boards.count() ) return TQString(); if( Index == -1 ) return CurrentBoard; return Boards[Index]; } @@ -567,9 +567,9 @@ QString resource::getBoard( int Index ) // resource::getChessmen // /////////////////////////////////////// -QString resource::getChessmen( int Index ) +TQString resource::getChessmen( int Index ) { - if( Index > (signed)Chessmen.count() ) return QString::null; + if( Index > (signed)Chessmen.count() ) return TQString(); if( Index == -1 ) return CurrentChessmen; return Chessmen[Index]; } @@ -578,9 +578,9 @@ QString resource::getChessmen( int Index ) // resource::getSounds // /////////////////////////////////////// -QString resource::getSounds( int Index ) +TQString resource::getSounds( int Index ) { - if( Index > (signed)Sounds.count() ) return QString::null; + if( Index > (signed)Sounds.count() ) return TQString(); if( Index == -1 ) return CurrentAudio; return Sounds[Index]; } @@ -591,7 +591,7 @@ QString resource::getSounds( int Index ) /////////////////////////////////////// void resource::setAudio( int AudioIndex ) { - QString audioURL; + TQString audioURL; /* Make sure the Indexes are valid */ if( AudioIndex > (signed)Sounds.count() ) @@ -606,9 +606,9 @@ void resource::setAudio( int AudioIndex ) { return; } - QApplication::setOverrideCursor( CURSOR_Thinking ); + TQApplication::setOverrideCursor( CURSOR_Thinking ); Audio->setTheme( audioURL ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } /////////////////////////////////////// @@ -619,10 +619,10 @@ void resource::setAudio( int AudioIndex ) void resource::setTheme( int BoardIndex, int ChessmenIndex ) { static bool firstTime( TRUE ); - QString boardURL; - QString chessmenURL; - QString boardConf; - QString chessmenConf; + TQString boardURL; + TQString chessmenURL; + TQString boardConf; + TQString chessmenConf; KSimpleConfig *boardConfig; KSimpleConfig *chessmenConfig; @@ -639,7 +639,7 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex ) } /* Set the Cursor */ - QApplication::setOverrideCursor( CURSOR_Thinking ); + TQApplication::setOverrideCursor( CURSOR_Thinking ); /* Change the theme */ if( BoardIndex != -1 ) @@ -652,7 +652,7 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex ) if( ( boardURL.isEmpty() ) || ( chessmenURL.isEmpty() ) ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); return; } @@ -723,7 +723,7 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex ) /* Cleanup */ pixCache->clear(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); pixCache->resize( ThemeSize ); firstTime = FALSE; return; @@ -733,9 +733,9 @@ void resource::setTheme( int BoardIndex, int ChessmenIndex ) // resource::loadThemeItem // /////////////////////////////////////// -void resource::loadThemeItem( const QString &URL, QImage &Image ) +void resource::loadThemeItem( const TQString &URL, TQImage &Image ) { - QString tempFile; + TQString tempFile; if( KIO::NetAccess::download( URL, tempFile ) ) { @@ -755,7 +755,7 @@ void resource::loadThemeItem( const QString &URL, QImage &Image ) void resource::resizeTheme( const int &size ) { /* Set the Cursor */ - QApplication::setOverrideCursor( CURSOR_Thinking ); + TQApplication::setOverrideCursor( CURSOR_Thinking ); ThemeSize = size; if( ThemeSize > IMAGE_MAX ) @@ -765,14 +765,14 @@ void resource::resizeTheme( const int &size ) pixCache->resize( ThemeSize ); ConfigWrite(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } /////////////////////////////////////// // // resource::LoadIcon // /////////////////////////////////////// -QPixmap resource::LoadIcon( QString Name, int Group ) +TQPixmap resource::LoadIcon( TQString Name, int Group ) { return Icons->loadIcon( Name, (KIcon::Group)Group ); } @@ -782,11 +782,11 @@ QPixmap resource::LoadIcon( QString Name, int Group ) // /////////////////////////////////////// // Borrowed from KMail -QString resource::encryptStr(const QString &aStr) const +TQString resource::encryptStr(const TQString &aStr) const { unsigned int i, val; unsigned int len = aStr.length(); - QCString result; + TQCString result; result.resize(len+1); for (i=0; i<len; i++) { @@ -804,7 +804,7 @@ QString resource::encryptStr(const QString &aStr) const // /////////////////////////////////////// // Borrowed from KMail -QString resource::decryptStr(const QString &aStr) const +TQString resource::decryptStr(const TQString &aStr) const { return encryptStr(aStr); } @@ -824,24 +824,24 @@ void resource::play( const char snd ) /////////////////////////////////////// void resource::ReadColors( void ) { - QColor tmp; + TQColor tmp; - COLOR_White = QColor( 255, 255, 255 ); - COLOR_Black = QColor( 0, 0, 0 ); + COLOR_White = TQColor( 255, 255, 255 ); + COLOR_Black = TQColor( 0, 0, 0 ); CFG->setGroup( "Colors" ); COLOR_Background = CFG->readColorEntry( "BackgroundColor", &COLOR_White ); COLOR_GraphBackground = CFG->readColorEntry( "GraphBackground", &COLOR_Background ); COLOR_Standard = CFG->readColorEntry( "StandardColor", &COLOR_Black ); COLOR_GraphForeground = CFG->readColorEntry( "GraphForeground", &COLOR_Standard ); - tmp = QColor( 128, 0, 128 ); // Purple + tmp = TQColor( 128, 0, 128 ); // Purple COLOR_PrivateTell = CFG->readColorEntry( "PrivateColor", &tmp ); - tmp = QColor( 0, 0, 160 ); // Blue + tmp = TQColor( 0, 0, 160 ); // Blue COLOR_ChannelTell = CFG->readColorEntry( "ChannelColor", &tmp ); - tmp = QColor( 160, 0, 0 ); // Red + tmp = TQColor( 160, 0, 0 ); // Red COLOR_Shout = CFG->readColorEntry( "ShoutColor", &tmp ); - tmp = QColor( 0, 160, 0 ); // Green + tmp = TQColor( 0, 160, 0 ); // Green COLOR_Whisper = CFG->readColorEntry( "WhisperColor", &tmp ); - tmp = QColor( 0, 128, 128 ); // Cyan + tmp = TQColor( 0, 128, 128 ); // Cyan COLOR_Notification = CFG->readColorEntry( "NotificationColor", &tmp ); } /////////////////////////////////////// @@ -869,7 +869,7 @@ void resource::WriteColors( void ) /////////////////////////////////////// void resource::ReadFonts( void ) { - QFont Fixed = KGlobalSettings::fixedFont(); + TQFont Fixed = KGlobalSettings::fixedFont(); CFG->setGroup( "Fonts" ); FONT_Standard = CFG->readFontEntry( "StandardFont", &Fixed ); FONT_PrivateTell = CFG->readFontEntry( "PrivateFont", &Fixed ); @@ -901,8 +901,8 @@ void resource::WriteFonts( void ) void resource::buildStyle( void ) { /* Configure SSI_Default */ - SSI_Default->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_Default->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_Default->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_Default->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_Default->setFontFamily( FONT_Standard.family() ); SSI_Default->setFontSize( FONT_Standard.pointSize() ); SSI_Default->setFontUnderline( FONT_Standard.underline() ); @@ -910,8 +910,8 @@ void resource::buildStyle( void ) SSI_Default->setFontWeight( FONT_Standard.weight() ); SSI_Default->setColor( COLOR_Standard ); /* Configure SSI_PrivateTell */ - SSI_PrivateTell->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_PrivateTell->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_PrivateTell->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_PrivateTell->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_PrivateTell->setFontFamily( FONT_PrivateTell.family() ); SSI_PrivateTell->setFontSize( FONT_PrivateTell.pointSize() ); SSI_PrivateTell->setFontUnderline( FONT_PrivateTell.underline() ); @@ -919,8 +919,8 @@ void resource::buildStyle( void ) SSI_PrivateTell->setFontWeight( FONT_PrivateTell.weight() ); SSI_PrivateTell->setColor( COLOR_PrivateTell ); /* Configure SSI_ChannelTell */ - SSI_ChannelTell->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_ChannelTell->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_ChannelTell->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_ChannelTell->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_ChannelTell->setFontFamily( FONT_ChannelTell.family() ); SSI_ChannelTell->setFontSize( FONT_ChannelTell.pointSize() ); SSI_ChannelTell->setFontUnderline( FONT_ChannelTell.underline() ); @@ -928,8 +928,8 @@ void resource::buildStyle( void ) SSI_ChannelTell->setFontWeight( FONT_ChannelTell.weight() ); SSI_ChannelTell->setColor( COLOR_ChannelTell ); /* Configure SSI_Shout */ - SSI_Shout->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_Shout->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_Shout->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_Shout->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_Shout->setFontFamily( FONT_Shout.family() ); SSI_Shout->setFontSize( FONT_Shout.pointSize() ); SSI_Shout->setFontUnderline( FONT_Shout.underline() ); @@ -937,8 +937,8 @@ void resource::buildStyle( void ) SSI_Shout->setFontWeight( FONT_Shout.weight() ); SSI_Shout->setColor( COLOR_Shout ); /* Configure SSI_Whisper */ - SSI_Whisper->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_Whisper->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_Whisper->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_Whisper->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_Whisper->setFontFamily( FONT_Whisper.family() ); SSI_Whisper->setFontSize( FONT_Whisper.pointSize() ); SSI_Whisper->setFontUnderline( FONT_Whisper.underline() ); @@ -946,8 +946,8 @@ void resource::buildStyle( void ) SSI_Whisper->setFontWeight( FONT_Whisper.weight() ); SSI_Whisper->setColor( COLOR_Whisper ); /* Configure SSI_Notification */ - SSI_Notification->setDisplayMode( QStyleSheetItem::DisplayListItem ); - SSI_Notification->setWhiteSpaceMode( QStyleSheetItem::WhiteSpacePre ); + SSI_Notification->setDisplayMode( TQStyleSheetItem::DisplayListItem ); + SSI_Notification->setWhiteSpaceMode( TQStyleSheetItem::WhiteSpacePre ); SSI_Notification->setFontFamily( FONT_Notification.family() ); SSI_Notification->setFontSize( FONT_Notification.pointSize() ); SSI_Notification->setFontUnderline( FONT_Notification.underline() ); @@ -960,20 +960,20 @@ void resource::buildStyle( void ) // resource::themeURL // /////////////////////////////////////// -QString resource::themeURL( const QString theme ) +TQString resource::themeURL( const TQString theme ) { - QString fullURL; + TQString fullURL; fullURL = "tar:" + GlobalDataDir + "themes/" + theme; if( !KIO::NetAccess::exists( fullURL ) ) { - fullURL = "tar:" + QDir::currentDirPath() + "../media/" + theme; + fullURL = "tar:" + TQDir::currentDirPath() + "../media/" + theme; if( !KIO::NetAccess::exists( fullURL ) ) { - fullURL = "tar:" + QDir::homeDirPath() + "/.knights/" + theme; + fullURL = "tar:" + TQDir::homeDirPath() + "/.knights/" + theme; if( !KIO::NetAccess::exists( fullURL ) ) { kdWarning() << "The theme " << theme << " does not exist in any valid path." << endl; - return QString::null; + return TQString(); } } } @@ -986,28 +986,28 @@ QString resource::themeURL( const QString theme ) // resource::loadSCIDImage // /////////////////////////////////////// -QPixmap resource::loadSCIDImage( const QString &name ) +TQPixmap resource::loadSCIDImage( const TQString &name ) { const int BufferMax = 120; const int ArrayMax = 21600; const int SkipSize = 7200; - QPixmap newPix; - QString searchName = '\"' + name + '\"'; - QByteArray base64Data( ArrayMax ); - QByteArray rawData( ArrayMax ); + TQPixmap newPix; + TQString searchName = '\"' + name + '\"'; + TQByteArray base64Data( ArrayMax ); + TQByteArray rawData( ArrayMax ); char *array = base64Data.data(); char buffer[BufferMax]; char photo[12]; unsigned int index = 0; unsigned int buffSize = 0; - QString source = locate( "appdata", "players.img" ); + TQString source = locate( "appdata", "players.img" ); if( source.isNull() ) source = SCID_Image_Path; strcpy( photo, "photo" ); - QFile file( source ); + TQFile file( source ); if( file.open( IO_ReadOnly ) ) { |