From b1c380494fce349c17ad31dc7d88fe5eb3650210 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 29 May 2018 21:57:06 +0900 Subject: Konqueror Ark plugin: switched default format to .xz. Add jar and remove lzma from "compress as" menu default entries. This relates to bug 2794. Signed-off-by: Michele Calgaro --- konq-plugins/arkplugin/arkplugin.cpp | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/konq-plugins/arkplugin/arkplugin.cpp b/konq-plugins/arkplugin/arkplugin.cpp index ed81025..19c97d5 100644 --- a/konq-plugins/arkplugin/arkplugin.cpp +++ b/konq-plugins/arkplugin/arkplugin.cpp @@ -261,6 +261,13 @@ void ArkMenu::compMimeTypes() { unsigned int itemCount = m_urlList.count(); + bool havexz = false; + if ( !TDEStandardDirs::findExe( "xz" ).isNull() && m_conf->readBoolEntry( "UseXz", true ) ) + { + havexz = true; + m_archiveMimeTypes << "application/x-xz"; + } + bool havegz = false; if ( !TDEStandardDirs::findExe( "gzip" ).isNull() && m_conf->readBoolEntry( "UseGz", true ) ) { @@ -285,22 +292,16 @@ void ArkMenu::compMimeTypes() } bool havelzma = false; - if ( !TDEStandardDirs::findExe( "lzma" ).isNull() && m_conf->readBoolEntry( "UseLzma", true ) ) + if ( !TDEStandardDirs::findExe( "lzma" ).isNull() && m_conf->readBoolEntry( "UseLzma", false ) ) { havelzma = true; m_archiveMimeTypes << "application/x-lzma"; } - bool havexz = false; - if ( !TDEStandardDirs::findExe( "xz" ).isNull() && m_conf->readBoolEntry( "UseXz", true ) ) - { - havexz = true; - m_archiveMimeTypes << "application/x-xz"; - } - if ( !TDEStandardDirs::findExe( "tar" ).isNull() && m_conf->readBoolEntry( "UseTar", true ) ) { - m_archiveMimeTypes << "application/x-tar"; + if ( havexz ) + m_archiveMimeTypes << "application/x-txz"; if ( havegz ) m_archiveMimeTypes << "application/x-tgz"; if ( havebz2 ) @@ -309,8 +310,7 @@ void ArkMenu::compMimeTypes() m_archiveMimeTypes << "application/x-tzo"; if ( havelzma ) m_archiveMimeTypes << "application/x-tlz"; - if ( havexz ) - m_archiveMimeTypes << "application/x-txz"; + m_archiveMimeTypes << "application/x-tar"; } if ( !TDEStandardDirs::findExe( "lha" ).isNull() && m_conf->readBoolEntry( "UseLha", false ) ) @@ -329,9 +329,9 @@ void ArkMenu::compMimeTypes() if ( !TDEStandardDirs::findExe( "7z" ).isNull() && m_conf->readBoolEntry( "Use7z", true ) ) m_archiveMimeTypes << "application/x-7z"; - else if ( !TDEStandardDirs::findExe( "7za" ).isNull() && m_conf->readBoolEntry( "Use7za", true ) ) + else if ( !TDEStandardDirs::findExe( "7za" ).isNull() && m_conf->readBoolEntry( "Use7za", false ) ) m_archiveMimeTypes << "application/x-7z"; - else if ( !TDEStandardDirs::findExe( "7zr" ).isNull() && m_conf->readBoolEntry( "Use7zr", true ) ) + else if ( !TDEStandardDirs::findExe( "7zr" ).isNull() && m_conf->readBoolEntry( "Use7zr", false ) ) m_archiveMimeTypes << "application/x-7z"; if ( !TDEStandardDirs::findExe( "zoo" ).isNull() && m_conf->readBoolEntry( "UseZoo", false ) ) @@ -350,6 +350,13 @@ void ArkMenu::compMimeTypes() void ArkMenu::extMimeTypes() { + bool havexz = false; + if ( !TDEStandardDirs::findExe( "xz" ).isNull() ) + { + havexz = true; + m_extractMimeTypes << "application/x-xz"; + } + bool havegz = false; if ( !TDEStandardDirs::findExe( "gunzip" ).isNull() ) { @@ -379,16 +386,10 @@ void ArkMenu::extMimeTypes() m_extractMimeTypes << "application/x-lzma"; } - bool havexz = false; - if ( !TDEStandardDirs::findExe( "xz" ).isNull() ) - { - havexz = true; - m_extractMimeTypes << "application/x-xz"; - } - if ( !TDEStandardDirs::findExe( "tar" ).isNull() ) { - m_extractMimeTypes << "application/x-tar"; + if ( havexz ) + m_extractMimeTypes << "application/x-txz"; if ( havegz ) m_extractMimeTypes << "application/x-tgz"; if ( havebz2 ) @@ -397,8 +398,7 @@ void ArkMenu::extMimeTypes() m_extractMimeTypes << "application/x-tzo"; if ( havelzma ) m_extractMimeTypes << "application/x-tlz"; - if ( havexz ) - m_extractMimeTypes << "application/x-txz"; + m_extractMimeTypes << "application/x-tar"; } if ( !TDEStandardDirs::findExe( "lha" ).isNull() ) -- cgit v1.2.3