Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > d9b360ee2bb591aec74456d859429422 > files > 1

kdelibs4-4.1.2-5mdv2009.0.src.rpm

--- kdelibs-4.0.98/CMakeLists.txt.liblzma	2008-07-09 16:12:20.000000000 +0200
+++ kdelibs-4.0.98/CMakeLists.txt	2008-07-21 19:45:25.567709793 +0200
@@ -47,6 +47,9 @@ find_package(Strigi REQUIRED)
 macro_optional_find_package(BZip2)
 macro_log_feature(BZIP2_FOUND "BZip2" "A high-quality data compressor" "http://www.bzip.org" FALSE "" "STRONGLY RECOMMENDED: Provides the ability to read and write bzip2 compressed data files.")
 
+macro_optional_find_package(LZMA)
+macro_log_feature(LZMA_FOUND "LZMA" "A very high compression ratio data compressor" "http://tukaani.org/lzma/" FALSE "" "STRONGLY RECOMMENDED: Provides the ability to read and write lzma compressed data files.")
+
 macro_optional_find_package(OpenSSL)
 macro_log_feature(OPENSSL_FOUND "OpenSSL" "A toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols" "http://openssl.org" FALSE "" "STRONGLY RECOMMENDED: KDE uses OpenSSL for the bulk of secure communications, including secure web browsing via HTTPS.")
 
--- kdelibs-4.0.98/cmake/modules/FindLZMA.cmake.liblzma	2008-07-21 19:45:25.567709793 +0200
+++ kdelibs-4.0.98/cmake/modules/FindLZMA.cmake	2008-07-21 19:45:25.567709793 +0200
@@ -0,0 +1,30 @@
+# - Find LZMA
+# Find LZMA headers and library
+#
+#  LZMA_FOUND       - True if lzma is found.
+#  LZMA_INCLUDE_DIR - Directory where lzma headers are located.
+#  LZMA_LIBRARIES   - Lzma libraries to link against.
+
+# Copyright (c) 2008, Per Øyvind Karlsen, <peroyvind@mandriva.org>
+
+
+IF (LZMA_INCLUDE_DIR)
+    SET(LZMA_FIND_QUIETLY TRUE)
+ENDIF (LZMA_INCLUDE_DIR)
+
+FIND_PATH(LZMA_INCLUDE_DIR lzma.h )
+
+FIND_LIBRARY(LZMA_LIBRARY NAMES lzma )
+
+# handle the QUIETLY and REQUIRED arguments and set LZMA_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMA DEFAULT_MSG LZMA_INCLUDE_DIR LZMA_LIBRARY)
+
+IF (LZMA_FOUND)
+  SET( LZMA_LIBRARIES ${LZMA_LIBRARY} )
+ELSE(LZMA_FOUND)
+  SET( LZMA_LIBRARIES )
+ENDIF(LZMA_FOUND)
+
+MARK_AS_ADVANCED( LZMA_INCLUDE_DIR LZMA_LIBRARY )
--- kdelibs-4.0.98/config.h.cmake.liblzma	2008-05-21 13:09:18.000000000 +0200
+++ kdelibs-4.0.98/config.h.cmake	2008-07-21 19:45:25.568719977 +0200
@@ -22,6 +22,9 @@
 /* Define if you have libz */
 #cmakedefine   HAVE_LIBZ 1
 
+/* Define if you have lzma */
+#cmakedefine   HAVE_LZMA_SUPPORT 1
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #cmakedefine   HAVE_DLFCN_H 1
 
--- kdelibs-4.0.98/ConfigureChecks.cmake.liblzma	2008-05-21 13:09:18.000000000 +0200
+++ kdelibs-4.0.98/ConfigureChecks.cmake	2008-07-22 20:16:32.048950425 +0200
@@ -27,6 +27,8 @@ if(BZIP2_FOUND AND BZIP2_NEED_PREFIX)
    set(NEED_BZ2_PREFIX 1)
 endif(BZIP2_FOUND AND BZIP2_NEED_PREFIX)
 
+macro_bool_to_01(LZMA_FOUND HAVE_LZMA_SUPPORT)          # kdecore
+
 macro_bool_to_01(CARBON_FOUND HAVE_CARBON)              # kdecore
 
 macro_bool_to_01(LIBINTL_FOUND ENABLE_NLS)              # kdecore, khtml, kjs
--- kdelibs-4.0.98/kate/syntax/data/bash.xml.liblzma	2008-05-21 13:06:34.000000000 +0200
+++ kdelibs-4.0.98/kate/syntax/data/bash.xml	2008-07-21 19:45:25.570703819 +0200
@@ -157,6 +157,17 @@
       <item> lsattr </item>
       <item> lsmod </item>
       <item> lsmod.old </item>
+      <item> lzcat </item>
+      <item> lzcmp </item>
+      <item> lzdiff </item>
+      <item> lzegrep </item>
+      <item> lzfgrep </item>
+      <item> lzgrep </item>
+      <item> lzless </item>
+      <item> lzcat </item>
+      <item> lzma </item>
+      <item> lzmainfo </item>
+      <item> lzmore </item>
       <item> mapscrn </item>
       <item> mesg </item>
       <item> mkdir </item>
--- kdelibs-4.0.98/kdecore/CMakeLists.txt.liblzma	2008-07-03 07:06:30.000000000 +0200
+++ kdelibs-4.0.98/kdecore/CMakeLists.txt	2008-07-21 19:45:25.571722314 +0200
@@ -41,6 +41,13 @@ if(BZIP2_FOUND)
    set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${BZIP2_LIBRARIES})
 endif(BZIP2_FOUND)
 
+# compile lzma support if available
+if(LZMA_FOUND)
+   include_directories(${LZMA_INCLUDE_DIR})
+   set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS} compression/klzmafilter.cpp )
+   set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${LZMA_LIBRARIES})
+endif(LZMA_FOUND)
+
 # compile Gettext support if available
 if(LIBINTL_FOUND)
   include_directories(${LIBINTL_INCLUDE_DIR})
--- kdelibs-4.0.98/kdecore/compression/kfilterbase.cpp.liblzma	2008-05-21 13:09:11.000000000 +0200
+++ kdelibs-4.0.98/kdecore/compression/kfilterbase.cpp	2008-07-21 19:45:25.571722314 +0200
@@ -26,6 +26,9 @@
 #ifdef HAVE_BZIP2_SUPPORT
 #include "kbzip2filter.h"
 #endif
+#ifdef HAVE_LZMA_SUPPORT
+#include "klzmafilter.h"
+#endif
 
 KFilterBase::KFilterBase()
     : m_dev( 0L ), m_bAutoDel( false ), d(0)
@@ -71,6 +74,12 @@ KFilterBase * KFilterBase::findFilterByF
         return new KBzip2Filter;
     }
 #endif
+#ifdef HAVE_LZMA_SUPPORT
+    if ( fileName.endsWith( ".lzma", Qt::CaseInsensitive ) )
+    {
+        return new KLzmaFilter;
+    }
+#endif
     else
     {
         // not a warning, since this is called often with other mimetypes (see #88574)...
@@ -96,6 +105,12 @@ KFilterBase * KFilterBase::findFilterByM
         return new KBzip2Filter;
     }
 #endif
+#ifdef HAVE_LZMA_SUPPORT
+    if ( mimeType == QLatin1String( "application/x-lzma" ) || (mime && mime->is("application/x-lzma")) )
+    {
+        return new KLzmaFilter;
+    }
+#endif
     else
     {
         // not a warning, since this is called often with other mimetypes (see #88574)...
--- kdelibs-4.0.98/kdecore/compression/klzmafilter.cpp.liblzma	2008-07-21 19:45:25.572719368 +0200
+++ kdelibs-4.0.98/kdecore/compression/klzmafilter.cpp	2008-07-22 20:15:36.171950137 +0200
@@ -0,0 +1,169 @@
+/* This file is part of the KDE libraries
+   Copyright (C) 2007-2008 Per Øyvind Karlsen <peroyvind@mandriva.org>
+
+   Based on kbzip2filter:
+   Copyright (C) 2000-2005 David Faure <faure@kde.org>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License version 2 as published by the Free Software Foundation.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "klzmafilter.h"
+
+#include <config.h>
+#define __STDC_LIMIT_MACROS 1 // Needed for UINT64_MAX in LZMA_VLI_VALUE_UNKNOWN
+#include <sys/types.h>
+#include <inttypes.h>
+
+#if defined( HAVE_LZMA_SUPPORT )
+extern "C" {
+	#include <lzma.h>
+}
+
+#include <kdebug.h>
+
+#include <qiodevice.h>
+
+
+class KLzmaFilter::Private
+{
+public:
+    Private()
+    {
+        memset(&zStream, 0, sizeof(zStream));
+        mode = 0;
+    }
+
+    lzma_stream zStream;
+    int mode;
+};
+
+KLzmaFilter::KLzmaFilter()
+    :d(new Private)
+{
+}
+
+
+KLzmaFilter::~KLzmaFilter()
+{
+    delete d;
+}
+
+void KLzmaFilter::init( int mode )
+{
+    lzma_ret result;
+    d->zStream.next_in = 0;
+    d->zStream.avail_in = 0;
+    if ( mode == QIODevice::ReadOnly )
+    {
+        result = lzma_auto_decoder(&d->zStream, 0, 0);
+    	//kDebug(7130) << "lzma_auto_decoder returned " << result;
+    } else if ( mode == QIODevice::WriteOnly ) {
+        // force old LZMA_Alone format since new lzma utils isn't stable yet..
+        lzma_options_alone alone;
+	alone.lzma = lzma_preset_lzma[6];
+	alone.uncompressed_size = LZMA_VLI_VALUE_UNKNOWN;
+        result = lzma_alone_encoder(&d->zStream, &alone);
+    	//kDebug(7130) << "lzma_alone_encoder returned " << result;
+    } else
+        kWarning(7130) << "Unsupported mode " << mode << ". Only QIODevice::ReadOnly and QIODevice::WriteOnly supported";
+    d->mode = mode;
+}
+
+int KLzmaFilter::mode() const
+{
+    return d->mode;
+}
+
+void KLzmaFilter::terminate()
+{
+    if ( d->mode == QIODevice::ReadOnly || d->mode == QIODevice::WriteOnly )
+    {
+        lzma_end(&d->zStream);
+    } else
+        kWarning(7130) << "Unsupported mode " << d->mode << ". Only QIODevice::ReadOnly and QIODevice::WriteOnly supported";
+}
+
+
+void KLzmaFilter::reset()
+{
+    kDebug(7130) << "KLzmaFilter::reset";
+    // liblzma doesn't have a reset call...
+    terminate();
+    init( d->mode );
+}
+
+void KLzmaFilter::setOutBuffer( char * data, uint maxlen )
+{
+    d->zStream.avail_out = maxlen;
+    d->zStream.next_out = (uint8_t *)data;
+}
+
+void KLzmaFilter::setInBuffer( const char *data, unsigned int size )
+{
+    d->zStream.avail_in = size;
+    d->zStream.next_in = (uint8_t *)const_cast<char *>(data);
+}
+
+int KLzmaFilter::inBufferAvailable() const
+{
+    return d->zStream.avail_in;
+}
+
+int KLzmaFilter::outBufferAvailable() const
+{
+    return d->zStream.avail_out;
+}
+
+KLzmaFilter::Result KLzmaFilter::uncompress()
+{
+    //kDebug(7130) << "Calling lzma_code with avail_in=" << inBufferAvailable() << " avail_out =" << outBufferAvailable();
+    lzma_ret result = lzma_code(&d->zStream, LZMA_RUN);
+    if ( result != LZMA_OK )
+    {
+        kDebug(7130) << "lzma_code returned " << result;
+        kDebug(7130) << "KLzmaFilter::uncompress " << ( result == LZMA_STREAM_END ? KFilterBase::End : KFilterBase::Error );
+    }
+
+    switch (result) {
+        case LZMA_OK:
+                return KFilterBase::Ok;
+        case LZMA_STREAM_END:
+                return KFilterBase::End;
+        default:
+                return KFilterBase::Error;
+    }
+}
+
+KLzmaFilter::Result KLzmaFilter::compress( bool finish )
+{
+    //kDebug(7130) << "Calling lzma_code with avail_in=" << inBufferAvailable() << " avail_out=" << outBufferAvailable();
+    lzma_ret result = lzma_code(&d->zStream, finish ? LZMA_FINISH : LZMA_RUN );
+
+    switch (result) {
+        case LZMA_OK:
+                return KFilterBase::Ok;
+                break;
+        case LZMA_STREAM_END:
+                kDebug(7130) << "  lzma_code returned " << result;
+                return KFilterBase::End;
+		break;
+        default:
+                kDebug(7130) << "  lzma_code returned " << result;
+                return KFilterBase::Error;
+                break;
+    }
+}
+
+#endif  /* HAVE_LZMA_SUPPORT */
--- kdelibs-4.0.98/kdecore/compression/klzmafilter.h.liblzma	2008-07-21 19:45:25.572719368 +0200
+++ kdelibs-4.0.98/kdecore/compression/klzmafilter.h	2008-07-21 19:45:25.572719368 +0200
@@ -0,0 +1,60 @@
+/* This file is part of the KDE libraries
+   Copyright (C) 2007-2008 Per Øyvind Karlsen <peroyvind@mandriva.org>
+
+   Based on kbzip2filter:
+   Copyright (C) 2000 David Faure <faure@kde.org>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License version 2 as published by the Free Software Foundation.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __klzmafilter__h
+#define __klzmafilter__h
+
+#include <config.h>
+
+#if defined( HAVE_LZMA_SUPPORT )
+
+#include "kfilterbase.h"
+
+/**
+ * Internal class used by KFilterDev
+ * @internal
+ */
+class KLzmaFilter : public KFilterBase
+{
+public:
+    KLzmaFilter();
+    virtual ~KLzmaFilter();
+
+    virtual void init( int );
+    virtual int mode() const;
+    virtual void terminate();
+    virtual void reset();
+    virtual bool readHeader() { return true; } // lzma handles it by itself ! Cool !
+    virtual bool writeHeader( const QByteArray & ) { return true; }
+    virtual void setOutBuffer( char * data, uint maxlen );
+    virtual void setInBuffer( const char * data, uint size );
+    virtual int  inBufferAvailable() const;
+    virtual int  outBufferAvailable() const;
+    virtual Result uncompress();
+    virtual Result compress( bool finish );
+private:
+    class Private;
+    Private* const d;
+};
+
+#endif
+
+#endif /* __klzmafilter__h */
--- kdelibs-4.0.98/kdecore/io/kurl.cpp.liblzma	2008-07-03 07:06:30.000000000 +0200
+++ kdelibs-4.0.98/kdecore/io/kurl.cpp	2008-07-21 19:45:25.600727328 +0200
@@ -936,6 +936,10 @@ inline static bool hasSubUrl( const QUrl
     if ( ref.startsWith("bzip:") || ref.startsWith("bzip2:") )
       return true;
     break;
+  case 'l':
+    if ( ref.startsWith("lzma:") )
+      return true;
+    break;
   case 't':
     if ( ref.startsWith("tar:") )
       return true;
--- kdelibs-4.0.98/kdecore/kdebug.areas.liblzma	2008-06-18 14:42:26.000000000 +0200
+++ kdelibs-4.0.98/kdecore/kdebug.areas	2008-07-21 19:45:25.600727328 +0200
@@ -332,6 +332,7 @@
 7127        kio_fish
 7128        kio_svn
 7129        kio_akonadi
+7130        kio_lzma
 
 # kdesdk
 8100        kompare
--- kdelibs-4.0.98/kdecore/tests/kfiltertest.cpp.liblzma	2008-05-21 13:09:07.000000000 +0200
+++ kdelibs-4.0.98/kdecore/tests/kfiltertest.cpp	2008-07-22 20:11:20.709952173 +0200
@@ -36,6 +36,7 @@ void KFilterTest::initTestCase()
     QString currentdir = QDir::currentPath();
     pathgz = currentdir + "/test.gz";
     pathbz2 = currentdir + "/test.bz2";
+    pathlzma = currentdir + "/test.lzma";
 
     // warning, update the COMPAREs in test_block_write() if changing the test data...
     testData = "hello world\n";
@@ -66,6 +67,10 @@ void KFilterTest::test_block_write()
     kDebug() << " -- test_block_write bzip2 -- ";
     test_block_write(pathbz2);
     QCOMPARE( QFileInfo( pathbz2 ).size(), 52LL ); // size of test.bz2
+
+    kDebug() << " -- test_block_write lzma -- ";
+    test_block_write(pathlzma);
+    QCOMPARE( QFileInfo( pathlzma ).size(), 35LL ); // size of test.lzma
 }
 
 void KFilterTest::test_block_read( const QString & fileName )
@@ -110,6 +115,8 @@ void KFilterTest::test_block_read()
     test_block_read(pathgz);
     kDebug() << " -- test_block_read bzip2 -- ";
     test_block_read(pathbz2);
+    kDebug() << " -- test_block_read lzma -- ";
+    test_block_read(pathlzma);
 }
 
 void KFilterTest::test_getch( const QString & fileName )
@@ -135,6 +142,9 @@ void KFilterTest::test_getch()
     test_getch(pathgz);
     kDebug() << " -- test_getch bzip2 -- ";
     test_getch(pathbz2);
+    kDebug() << " -- test_getch lzma -- ";
+    test_getch(pathlzma);
+
 }
 
 void KFilterTest::test_textstream(  const QString & fileName )
@@ -158,6 +168,8 @@ void KFilterTest::test_textstream()
     test_textstream(pathgz);
     kDebug() << " -- test_textstream bzip2 -- ";
     test_textstream(pathbz2);
+    kDebug() << " -- test_textstream lzma -- ";
+    test_textstream(pathlzma);
 }
 
 void KFilterTest::test_readall( const QString & fileName, const QString& mimeType )
@@ -177,6 +189,8 @@ void KFilterTest::test_readall()
     test_readall(pathgz, QString::fromLatin1("application/x-gzip"));
     kDebug() << " -- test_readall bzip2 -- ";
     test_readall(pathbz2, QString::fromLatin1("application/x-bzip"));
+    kDebug() << " -- test_readall lzma -- ";
+    test_readall(pathlzma, QString::fromLatin1("application/x-lzma"));
     kDebug() << " -- test_readall gzip-derived -- ";
     test_readall(pathgz, QString::fromLatin1("image/svg+xml-compressed"));
 }
--- kdelibs-4.0.98/kdecore/tests/kfiltertest.h.liblzma	2008-05-21 13:09:07.000000000 +0200
+++ kdelibs-4.0.98/kdecore/tests/kfiltertest.h	2008-07-21 19:45:25.602700833 +0200
@@ -43,6 +43,7 @@ private:
 
     QString pathgz;
     QString pathbz2;
+    QString pathlzma;
     QByteArray testData;
 };
 
--- kdelibs-4.0.98/kfile/kurlnavigator.cpp.liblzma	2008-07-03 07:06:23.000000000 +0200
+++ kdelibs-4.0.98/kfile/kurlnavigator.cpp	2008-07-21 19:45:25.603700331 +0200
@@ -805,6 +805,7 @@ bool KUrlNavigator::Private::isCompresse
     // Note: this list of MIME types depends on the protocols implemented by kio_archive
     return  mime->is("application/x-compressed-tar") ||
             mime->is("application/x-bzip-compressed-tar") ||
+	    mime->is("application/x-lzma-compressed-tar") ||
             mime->is("application/x-tar") ||
             mime->is("application/x-tarz") ||
             mime->is("application/x-tzo") || // (not sure KTar supports those?)
--- kdelibs-4.0.98/kio/kio/krun.cpp.liblzma	2008-06-10 13:41:32.000000000 +0200
+++ kdelibs-4.0.98/kio/kio/krun.cpp	2008-07-21 19:45:25.604701087 +0200
@@ -1162,7 +1162,8 @@ void KRun::foundMimeType( const QString&
 
   if ( type == "application/x-gzip"  ||
        type == "application/x-bzip"  ||
-       type == "application/x-bzip"  )
+       type == "application/x-bzip"  ||
+       type == "application/x-lzma"  )
   {
     KUrl::List lst = KUrl::split( m_strURL );
     if ( lst.isEmpty() )
@@ -1180,6 +1181,8 @@ void KRun::foundMimeType( const QString&
       lst.prepend( KUrl( "bzip:/decompress" ) );
     else if ( type == "application/x-bzip" )
       lst.prepend( KUrl( "bzip2:/decompress" ) );
+    else if ( type == "application/x-lzma" )
+      lst.prepend( KUrl( "lzma:/decompress" ) );
     else if ( type == "application/x-tar" )
       lst.prepend( KUrl( "tar:/" ) );
 
--- kdelibs-4.0.98/kio/kio/ktar.cpp.liblzma	2008-05-21 13:07:57.000000000 +0200
+++ kdelibs-4.0.98/kio/kio/ktar.cpp	2008-07-21 19:45:25.606700084 +0200
@@ -102,6 +102,10 @@ bool KTar::createDevice( QIODevice::Open
         {
             d->mimetype = "application/x-bzip";
         }
+        else if ( d->mimetype == "application/x-lzma-compressed-tar" ) // that's a lzma compressed tar file, so ask for lzma filter
+        {
+            d->mimetype = "application/x-lzma";
+        }
         else
         {
             // Something else. Check if it's not really gzip though (e.g. for old-style KOffice files)
@@ -116,6 +120,14 @@ bool KTar::createDevice( QIODevice::Open
                         d->mimetype = "application/x-gzip";
                     else if ( firstByte == 'B' && secondByte == 'Z' && thirdByte == 'h' )
                         d->mimetype = "application/x-bzip";
+                    else if ( firstByte == '\xFF' && secondByte == 'L' && thirdByte == 'Z' )
+                    {
+                        char fourthByte, fifthByte, sixthByte;
+                        if ( file.getChar(&fourthByte) && fourthByte == 'M' &&
+			     file.getChar(&fifthByte) && fifthByte == 'A' &&
+			     file.getChar(&sixthByte) && sixthByte == '\x00' )
+                            d->mimetype = "application/x-lzma";
+                    }
                     else if ( firstByte == 'P' && secondByte == 'K' && thirdByte == 3 )
                     {
                         char fourthByte;
@@ -494,7 +506,8 @@ bool KTar::KTarPrivate::writeBackTempFil
 
     bool forced = false;
     if( "application/x-gzip" == mimetype
-        || "application/x-bzip" == mimetype)
+        || "application/x-bzip" == mimetype
+	|| "application/x-lzma" == mimetype)
         forced = true;
 
     // #### TODO this should use KSaveFile to avoid problems on disk full
--- kdelibs-4.0.98/kio/kio/ktar.h.liblzma	2008-05-21 13:07:57.000000000 +0200
+++ kdelibs-4.0.98/kio/kio/ktar.h	2008-07-21 19:45:25.606700084 +0200
@@ -25,7 +25,7 @@
  * A class for reading / writing (optionally compressed) tar archives.
  *
  * KTar allows you to read and write tar archives, including those
- * that are compressed using gzip or bzip2.
+ * that are compressed using gzip, bzip2 or lzma.
  *
  * @author Torben Weis <weis@kde.org>, David Faure <faure@kde.org>
  */
@@ -37,7 +37,8 @@ public:
      * using the compression filter associated to given mimetype.
      *
      * @param filename is a local path (e.g. "/home/weis/myfile.tgz")
-     * @param mimetype "application/x-gzip" or "application/x-bzip"
+     * @param mimetype "application/x-gzip", "application/x-bzip" or
+     * "application/x-lzma"
      * Do not use application/x-compressed-tar or similar - you only need to
      * specify the compression layer !  If the mimetype is omitted, it
      * will be determined from the filename.
--- kdelibs-4.0.98/knewstuff/knewstuff2/core/coreengine.cpp.liblzma	2008-07-08 11:54:21.000000000 +0200
+++ kdelibs-4.0.98/knewstuff/knewstuff2/core/coreengine.cpp	2008-07-21 19:45:25.608700199 +0200
@@ -1410,7 +1410,8 @@ bool CoreEngine::install(const QString &
                 archive = new KZip(payloadfile);
             } else if (mimeType->name() == "application/tar"
                        || mimeType->name() == "application/x-gzip"
-                       || mimeType->name() == "application/x-bzip") {
+                       || mimeType->name() == "application/x-bzip"
+                       || mimeType->name() == "application/x-lzma") {
                 archive = new KTar(payloadfile);
             } else {
                 delete archive;
--- kdelibs-4.0.98/kutils/kemoticons/kemoticons.cpp.liblzma	2008-06-25 09:57:24.000000000 +0200
+++ kdelibs-4.0.98/kutils/kemoticons/kemoticons.cpp	2008-07-21 19:45:25.609700815 +0200
@@ -195,8 +195,10 @@ QStringList KEmoticons::installTheme(con
         archive = new KZip(archiveName);
     } else if (currentBundleMimeType == "application/x-compressed-tar" ||
                currentBundleMimeType == "application/x-bzip-compressed-tar" ||
+               currentBundleMimeType == "application/x-lzma-compressed-tar" ||
                currentBundleMimeType == "application/x-gzip" ||
-               currentBundleMimeType == "application/x-bzip") {
+               currentBundleMimeType == "application/x-bzip" ||
+	       currentBundleMimeType == "application/x-lzma") {
         archive = new KTar(archiveName);
     } else if (archiveName.endsWith("jisp") || archiveName.endsWith("zip")) {
         archive = new KZip(archiveName);