Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KTorrent
Commits
09421b02
Commit
09421b02
authored
Aug 01, 2013
by
Joris Guisson
Browse files
Fix gzip not working in ipfilter plugin due to wrong mimetype
CCBUG: 315239
parent
a441b6c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
09421b02
...
...
@@ -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)
...
...
plugins/ipfilter/downloadandconvertjob.cpp
View file @
09421b02
...
...
@@ -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
*
)));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment