commit 09421b0222c7552ddcfecbd8c05d8c069a05ba5f Author: Joris Guisson Date: Thu Aug 1 12:51:31 2013 +0200 Fix gzip not working in ipfilter plugin due to wrong mimetype CCBUG: 315239 diff --git a/ChangeLog b/ChangeLog index d0bab55..d84c472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/plugins/ipfilter/downloadandconvertjob.cpp b/plugins/ipfilter/downloadandconvertjob.cpp index 76ae319..4b09bee 100644 --- a/plugins/ipfilter/downloadandconvertjob.cpp +++ b/plugins/ipfilter/downloadandconvertjob.cpp @@ -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*)));