|
|
@ -107,8 +107,8 @@ namespace kt
|
|
|
|
KURL url(m_url->url());
|
|
|
|
KURL url(m_url->url());
|
|
|
|
KURL dest(target);
|
|
|
|
KURL dest(target);
|
|
|
|
KURL temp(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp");
|
|
|
|
KURL temp(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.tmp");
|
|
|
|
if(KIO::NetAccess::exists(temp,false, this))
|
|
|
|
if(TDEIO::NetAccess::exists(temp,false, this))
|
|
|
|
KIO::NetAccess::del(temp,this);
|
|
|
|
TDEIO::NetAccess::del(temp,this);
|
|
|
|
|
|
|
|
|
|
|
|
bool download = true;
|
|
|
|
bool download = true;
|
|
|
|
|
|
|
|
|
|
|
@ -117,26 +117,26 @@ namespace kt
|
|
|
|
if((KMessageBox::questionYesNo(this, i18n("Selected file already exists, do you want to download it again?"),i18n("File Exists")) == 4))
|
|
|
|
if((KMessageBox::questionYesNo(this, i18n("Selected file already exists, do you want to download it again?"),i18n("File Exists")) == 4))
|
|
|
|
download = false;
|
|
|
|
download = false;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
KIO::NetAccess::move(target, temp);
|
|
|
|
TDEIO::NetAccess::move(target, temp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(download)
|
|
|
|
if(download)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!url.isLocalFile())
|
|
|
|
if(!url.isLocalFile())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (KIO::NetAccess::download(url,target,NULL))
|
|
|
|
if (TDEIO::NetAccess::download(url,target,NULL))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Level1 list successfully downloaded, remove temporary file
|
|
|
|
//Level1 list successfully downloaded, remove temporary file
|
|
|
|
KIO::NetAccess::removeTempFile(target);
|
|
|
|
TDEIO::NetAccess::removeTempFile(target);
|
|
|
|
KIO::NetAccess::del(temp, this);
|
|
|
|
TDEIO::NetAccess::del(temp, this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString err = KIO::NetAccess::lastErrorString();
|
|
|
|
TQString err = TDEIO::NetAccess::lastErrorString();
|
|
|
|
if(err != TQString())
|
|
|
|
if(err != TQString())
|
|
|
|
KMessageBox::error(0,KIO::NetAccess::lastErrorString(),i18n("Error"));
|
|
|
|
KMessageBox::error(0,TDEIO::NetAccess::lastErrorString(),i18n("Error"));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
KIO::NetAccess::move(temp, target);
|
|
|
|
TDEIO::NetAccess::move(temp, target);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//we don't want to convert since download failed
|
|
|
|
//we don't want to convert since download failed
|
|
|
@ -145,9 +145,9 @@ namespace kt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!KIO::NetAccess::file_copy(url,dest, -1, true))
|
|
|
|
if (!TDEIO::NetAccess::file_copy(url,dest, -1, true))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KMessageBox::error(0,KIO::NetAccess::lastErrorString(),i18n("Error"));
|
|
|
|
KMessageBox::error(0,TDEIO::NetAccess::lastErrorString(),i18n("Error"));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -158,13 +158,13 @@ namespace kt
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KURL zipfile("zip:" + target + "/splist.txt");
|
|
|
|
KURL zipfile("zip:" + target + "/splist.txt");
|
|
|
|
KURL destinationfile(target + ".txt");
|
|
|
|
KURL destinationfile(target + ".txt");
|
|
|
|
KIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
|
|
|
|
TDEIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KURL zipfile(target);
|
|
|
|
KURL zipfile(target);
|
|
|
|
KURL destinationfile(target + ".txt");
|
|
|
|
KURL destinationfile(target + ".txt");
|
|
|
|
KIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
|
|
|
|
TDEIO::NetAccess::file_copy(zipfile,destinationfile, -1, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -194,7 +194,7 @@ namespace kt
|
|
|
|
if((KMessageBox::questionYesNo(this,i18n("Filter file (level1.dat) already exists, do you want to convert it again?"),i18n("File Exists")) == 4))
|
|
|
|
if((KMessageBox::questionYesNo(this,i18n("Filter file (level1.dat) already exists, do you want to convert it again?"),i18n("File Exists")) == 4))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
// else
|
|
|
|
// else
|
|
|
|
// KIO::NetAccess::del(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
|
|
|
|
// TDEIO::NetAccess::del(TDEGlobal::dirs()->saveLocation("data","ktorrent") + "level1.dat", NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ConvertDialog dlg(m_plugin);
|
|
|
|
ConvertDialog dlg(m_plugin);
|
|
|
|
dlg.exec();
|
|
|
|
dlg.exec();
|
|
|
|