D23730: Add new protocol for 7z archives
N. Higa
noreply at phabricator.kde.org
Thu Sep 5 13:19:18 BST 2019
nhiga added a comment.
Notes:
1. This patch requires D23490 <https://phabricator.kde.org/D23490> and the following KIO patch:
diff --git a/src/filewidgets/kurlnavigator.cpp b/src/filewidgets/kurlnavigator.cpp
index 80aa975..5a6c720 100644
--- a/src/filewidgets/kurlnavigator.cpp
+++ b/src/filewidgets/kurlnavigator.cpp
@@ -1046,8 +1046,8 @@ void KUrlNavigator::setLocationUrl(const QUrl &newUrl)
// code locationUrl() and url become the same URLs
QUrl firstChildUrl = KIO::UrlUtil::firstChildUrl(locationUrl(), url);
- if ((url.scheme() == QLatin1String("tar")) || (url.scheme() == QLatin1String("zip")) || (url.scheme() == QLatin1String("krarc"))) {
- // The URL represents a tar- or zip-file, or an archive file supported by krarc.
+ if ((url.scheme() == QLatin1String("tar")) || (url.scheme() == QLatin1String("zip")) || (url.scheme() == QLatin1String("sevenz")) || (url.scheme() == QLatin1String("krarc"))) {
+ // The URL represents a tar-, zip- or 7z-file, or an archive file supported by krarc.
// Check whether the URL is really part of the archive file, otherwise
// replace it by the local path again.
bool insideCompressedPath = d->isCompressedPath(url);
@@ -1064,7 +1064,7 @@ void KUrlNavigator::setLocationUrl(const QUrl &newUrl)
}
}
if (!insideCompressedPath) {
- // drop the tar: or zip: or krarc: protocol since we are not
+ // drop the tar:, zip:, sevenz: or krarc: protocol since we are not
// inside the compressed path
url.setScheme(QStringLiteral("file"));
firstChildUrl.setScheme(QStringLiteral("file"));
2. If I name the protocol as "7z", "Invalid protocol" error will be thrown, so I use "sevenz" instead.
3. I am not sure whether it is needed to include `k7zip.h` in `archive/kio_archivebase.cpp`.
4. It can take some time to load the 7z archive using this new protocol.
REPOSITORY
R320 KIO Extras
REVISION DETAIL
https://phabricator.kde.org/D23730
To: nhiga
Cc: kfm-devel, kde-frameworks-devel, iasensio, fprice, LeGast00n, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190905/5c3c853a/attachment.htm>
More information about the kfm-devel
mailing list