Commit 09421b02 authored by Joris Guisson's avatar Joris Guisson
Browse files

Fix gzip not working in ipfilter plugin due to wrong mimetype

CCBUG: 315239
parent a441b6c1
......@@ -25,6 +25,7 @@ Changes in 4.3.1:
- Use extended selection mode in syndication plugin so ctrl key works as expected (308672)
- Fix crash in GroupViewModel when dragging torrents over groups (308733)
- Sort by total leechers and seeders, if connected seeders and leechers is equal (311470)
- Fix gzip not working in ipfilter plugin due to wrong mimetype (315239)
Changes in 4.3:
- Change default blocklist url to iblocklist.org (305109)
......
......@@ -114,18 +114,30 @@ namespace kt
//now determine if it's ZIP or TXT file
KMimeType::Ptr ptr = KMimeType::findByFileContent(temp);
if (ptr->name() == "application/zip")
Out(SYS_IPF|LOG_NOTICE) << "Mimetype: " << ptr->name() << endl;
if(ptr->name() == "application/zip")
{
active_job = KIO::file_move(temp, QString(kt::DataDir() + QLatin1String("level1.zip")), -1, KIO::HideProgressInfo | KIO::Overwrite);
connect(active_job, SIGNAL(result(KJob*)), this, SLOT(extract(KJob*)));
}
else if (ptr->name() == "application/x-gzip" || ptr->name() == "application/x-bzip")
else if(ptr->name() == "application/x-7z-compressed")
{
QString msg = i18n("7z files are not supported", url.prettyUrl());
if (mode == Verbose)
KMessageBox::error(0, msg);
else
notification(msg);
setError(UNZIP_FAILED);
emitResult();
}
else if(ptr->name() == "application/gzip" || ptr->name() == "application/x-bzip")
{
active_job = new bt::DecompressFileJob(temp, QString(kt::DataDir() + "level1.txt"));
connect(active_job, SIGNAL(result(KJob*)), this, SLOT(convert(KJob*)));
active_job->start();
}
else if(!KMimeType::isBinaryData(temp))
else if(!KMimeType::isBinaryData(temp) || ptr->name() == "text/plain")
{
active_job = KIO::file_move(temp, QString(kt::DataDir() + "level1.txt"), -1, KIO::HideProgressInfo | KIO::Overwrite);
connect(active_job, SIGNAL(result(KJob*)), this, SLOT(convert(KJob*)));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment