|
|
@ -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();
|
|
|
|