Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kurlnavigator.cpp
Show First 20 Lines • Show All 812 Lines • ▼ Show 20 Line(s) | 811 | { | |||
---|---|---|---|---|---|
813 | currentUrl.setPath(QString()); | 813 | currentUrl.setPath(QString()); | ||
814 | return currentUrl; | 814 | return currentUrl; | ||
815 | } | 815 | } | ||
816 | 816 | | |||
817 | bool KUrlNavigator::Private::isCompressedPath(const QUrl &url) const | 817 | bool KUrlNavigator::Private::isCompressedPath(const QUrl &url) const | ||
818 | { | 818 | { | ||
819 | QMimeDatabase db; | 819 | QMimeDatabase db; | ||
820 | const QMimeType mime = db.mimeTypeForUrl(QUrl(url.toString(QUrl::StripTrailingSlash))); | 820 | const QMimeType mime = db.mimeTypeForUrl(QUrl(url.toString(QUrl::StripTrailingSlash))); | ||
821 | // Note: this list of MIME types depends on the protocols implemented by kio_archive | 821 | // Note: this list of MIME types depends on the protocols implemented by kio_archive and krarc | ||
822 | return mime.inherits(QStringLiteral("application/x-compressed-tar")) || | 822 | return mime.inherits(QStringLiteral("application/x-compressed-tar")) || | ||
823 | mime.inherits(QStringLiteral("application/x-bzip-compressed-tar")) || | 823 | mime.inherits(QStringLiteral("application/x-bzip-compressed-tar")) || | ||
824 | mime.inherits(QStringLiteral("application/x-lzma-compressed-tar")) || | 824 | mime.inherits(QStringLiteral("application/x-lzma-compressed-tar")) || | ||
825 | mime.inherits(QStringLiteral("application/x-xz-compressed-tar")) || | 825 | mime.inherits(QStringLiteral("application/x-xz-compressed-tar")) || | ||
826 | mime.inherits(QStringLiteral("application/x-tar")) || | 826 | mime.inherits(QStringLiteral("application/x-tar")) || | ||
827 | mime.inherits(QStringLiteral("application/x-tarz")) || | 827 | mime.inherits(QStringLiteral("application/x-tarz")) || | ||
828 | mime.inherits(QStringLiteral("application/x-tzo")) || // (not sure KTar supports those?) | 828 | mime.inherits(QStringLiteral("application/x-tzo")) || // (not sure KTar supports those?) | ||
829 | mime.inherits(QStringLiteral("application/zip")) || | 829 | mime.inherits(QStringLiteral("application/zip")) || | ||
830 | mime.inherits(QStringLiteral("application/x-archive")); | 830 | mime.inherits(QStringLiteral("application/x-archive")) || | ||
831 | mime.inherits(QStringLiteral("application/vnd.rar")) || // the following depends on krarc | ||||
832 | mime.inherits(QStringLiteral("application/x-7z-compressed")) || | ||||
833 | mime.inherits(QStringLiteral("application/x-ace")) || | ||||
834 | mime.inherits(QStringLiteral("application/x-arj")) || | ||||
835 | mime.inherits(QStringLiteral("application/x-cpio")) || | ||||
836 | mime.inherits(QStringLiteral("application/x-lha")); | ||||
831 | } | 837 | } | ||
832 | 838 | | |||
833 | void KUrlNavigator::Private::removeTrailingSlash(QString &url) const | 839 | void KUrlNavigator::Private::removeTrailingSlash(QString &url) const | ||
834 | { | 840 | { | ||
835 | const int length = url.length(); | 841 | const int length = url.length(); | ||
836 | if ((length > 0) && (url.at(length - 1) == QLatin1Char('/'))) { | 842 | if ((length > 0) && (url.at(length - 1) == QLatin1Char('/'))) { | ||
837 | url.remove(length - 1, 1); | 843 | url.remove(length - 1, 1); | ||
838 | } | 844 | } | ||
▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines |