Hello community,

here is the log from the commit of package kdeutils3 for openSUSE:Factory 
checked in at 2012-06-26 16:05:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdeutils3 (Old)
 and      /work/SRC/openSUSE:Factory/.kdeutils3.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdeutils3", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdeutils3/kdeutils3.changes      2011-10-04 
18:12:57.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kdeutils3.new/kdeutils3.changes 2012-06-26 
16:05:47.000000000 +0200
@@ -1,0 +2,6 @@
+Sun Jun 24 01:55:48 UTC 2012 - [email protected]
+
+- add four patches from Alt Linux for Ark: support for arj archives
+  and password-protected zip and rar archives
+
+-------------------------------------------------------------------

New:
----
  kdeutils-3.5.8-alt-ark-arj-format.patch
  kdeutils-3.5.8-alt-ark-rar-password.patch
  kdeutils-3.5.8-alt-ark-zip-password.patch
  kdeutils-3.5.8-alt-create-password-zip-rar-7zip.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdeutils3.spec ++++++
--- /var/tmp/diff_new_pack.gi2LV9/_old  2012-06-26 16:05:49.000000000 +0200
+++ /var/tmp/diff_new_pack.gi2LV9/_new  2012-06-26 16:05:49.000000000 +0200
@@ -22,9 +22,6 @@
 BuildRequires:  net-snmp-devel
 BuildRequires:  pcsc-lite
 BuildRequires:  python-devel
-%if 0%{?suse_version} < 1210
-BuildRequires:  unsermake
-%endif
 %ifarch ppc
 BuildRequires:  pbbuttonsd
 %endif
@@ -35,17 +32,11 @@
 Url:            http://www.kde.org
 Group:          Productivity/File utilities
 Source0:        kdeutils-%{version}.tar.bz2
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch0:         3_5_BRANCH.diff
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch2:         klaptop.diff
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch5:         disable-nonsense-security-check.diff
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch11:        ppc.dif
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch13:        FIXME.diff
-# PATCH-MISSING-TAG -- See 
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch14:        ark-decoding.diff
 # PATCH-FIX-UPSTREAM ark-rar_encrypted.patch ark-rar_encrypted.patch kde#35371 
[email protected]
 # -- fixes open/extract rar archives with encrypted header
@@ -53,6 +44,11 @@
 # This patch replaces the old MPL-licensed headers with newer ones, licensed 
under GPL-2.0
 # The files are taken directly from the Linux kernel sources
 Patch16:        trinity-r1254856-replace-linux-headers.diff
+Patch17:        kdeutils-3.5.8-alt-ark-arj-format.patch
+Patch18:        kdeutils-3.5.8-alt-ark-rar-password.patch
+Patch19:        kdeutils-3.5.8-alt-ark-zip-password.patch
+Patch20:        kdeutils-3.5.8-alt-create-password-zip-rar-7zip.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -119,6 +115,10 @@
 %prep
 %setup -q -n kdeutils-%{version}
 %patch0
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
 %patch2
 %patch5
 %ifarch ppc ppc64
@@ -267,9 +267,6 @@
 /opt/kde3/bin/kfloppy
 %doc %lang(en) /opt/kde3/share/doc/HTML/en/kfloppy
 %endif
-%if 0%{?suse_version} < 1210
-%{_mandir}/man1/ark*
-%endif
 
 %files extra
 %defattr(-,root,root)

++++++ kdeutils-3.5.8-alt-ark-arj-format.patch ++++++
diff -u'Nrpk~' kdeutils-3.5.8~/ark/arch.cpp kdeutils-3.5.8/ark/arch.cpp
--- kdeutils-3.5.8~/ark/arch.cpp        2007-11-08 13:32:30 +0300
+++ kdeutils-3.5.8/ark/arch.cpp 2007-11-02 15:07:36 +0300
@@ -60,6 +60,7 @@
 #include "ar.h"
 #include "sevenzip.h"
 #include "ace.h"
+#include "arj.h"
 
 Arch::ArchColumns::ArchColumns( int col, QRegExp reg, int length, bool opt )
   : colRef( col ), pattern( reg ), maxLength( length ), optional( opt )
@@ -401,6 +402,9 @@ Arch *Arch::archFactory( ArchType aType,
     case ACE_FORMAT:
       return new AceArch( parent, filename );
 
+    case ARJ_FORMAT:
+      return new ArjArch( parent, filename );
+
     case UNKNOWN_FORMAT:
     default:
       return 0;
diff -u'Nrpk~' kdeutils-3.5.8~/ark/arch.h kdeutils-3.5.8/ark/arch.h
--- kdeutils-3.5.8~/ark/arch.h  2007-11-08 13:32:30 +0300
+++ kdeutils-3.5.8/ark/arch.h   2007-11-02 14:47:03 +0300
@@ -65,7 +65,7 @@ class ArkWidget;
 
 enum ArchType { UNKNOWN_FORMAT, ZIP_FORMAT, TAR_FORMAT, AA_FORMAT,
                 LHA_FORMAT, RAR_FORMAT, ZOO_FORMAT, COMPRESSED_FORMAT,
-                SEVENZIP_FORMAT, ACE_FORMAT };
+                SEVENZIP_FORMAT, ACE_FORMAT, ARJ_FORMAT };
 
 typedef QValueList< QPair< QString, Qt::AlignmentFlags > > ColumnList;
 
diff -u'Nrpk~' kdeutils-3.5.8~/ark/archiveformatinfo.cpp 
kdeutils-3.5.8/ark/archiveformatinfo.cpp
--- kdeutils-3.5.8~/ark/archiveformatinfo.cpp   2006-01-19 19:49:29 +0300
+++ kdeutils-3.5.8/ark/archiveformatinfo.cpp    2007-11-02 14:51:57 +0300
@@ -79,6 +79,8 @@ void ArchiveFormatInfo::buildFormatInfos
 
   addFormatInfo( SEVENZIP_FORMAT, "application/x-7z", ".7z" );
 
+  addFormatInfo( ARJ_FORMAT, "application/x-arj", ".arj" );
+
   if ( ArkSettings::aceSupport() )
     addFormatInfo( ACE_FORMAT, "application/x-ace", ".ace" );
 }
diff -u'Nrpk~' kdeutils-3.5.8~/ark/arj.cpp kdeutils-3.5.8/ark/arj.cpp
--- kdeutils-3.5.8~/ark/arj.cpp 1970-01-01 03:00:00 +0300
+++ kdeutils-3.5.8/ark/arj.cpp  2007-11-14 17:46:07 +0300
@@ -0,0 +1,298 @@
+/*
+
+ ark -- archiver for the KDE project
+
+ Copyright (C)
+
+ 1997-1999: Rob Palmbos [email protected]
+ 1999: Francois-Xavier Duranceau [email protected]
+ 1999-2000: Corel Corporation (author: Emily Ezust, [email protected])
+ 2001: Corel Corporation (author: Michael Jarrett, [email protected])
+ 2007: ALT Linux (author: Sergey V Turchin, [email protected])
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+
+*/
+
+
+// Qt includes
+#include <qdir.h>
+#include <qtextcodec.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kpassdlg.h>
+
+// ark includes
+#include "arj.h"
+#include "arkwidget.h"
+#include "settings.h"
+
+
+ArjArch::ArjArch( ArkWidget *_gui, const QString & _fileName )
+  : Arch(  _gui, _fileName )
+{
+  m_archiver_program = "arj";
+  m_unarchiver_program = "arj";
+  verifyCompressUtilityIsAvailable( m_archiver_program );
+  verifyUncompressUtilityIsAvailable( m_unarchiver_program );
+
+  m_headerString = "-----------";
+  m_numCols = 6;
+}
+
+void ArjArch::setHeaders()
+{
+  ColumnList list;
+  list.append( FILENAME_COLUMN );
+  list.append( SIZE_COLUMN );
+  list.append( PACKED_COLUMN );
+  list.append( RATIO_COLUMN );
+  list.append( TIMESTAMP_COLUMN );
+  list.append( PERMISSION_COLUMN );
+
+  emit headers( list );
+}
+
+void ArjArch::create()
+{
+  emit sigCreate( this, true, m_filename,
+                  Arch::Extract | Arch::Delete | Arch::Add | Arch::View );
+}
+
+void ArjArch::createPassword()
+{
+  if( m_password.isEmpty() && ArkSettings::askCreatePassword() )
+    KPasswordDialog::getNewPassword( m_password, i18n("Warning!\nUsing KGpg 
for encryption is more secure.\nCancel this dialog or enter password for %1 
archiver:").arg(m_archiver_program) );
+}
+
+
+void ArjArch::addDir( const QString & _dirName )
+{
+  if ( !_dirName.isEmpty() )
+  {
+    QStringList list;
+    list.append( _dirName );
+    addFile( list );
+  }
+}
+
+void ArjArch::addFile( const QStringList & urls )
+{
+  KProcess *kp = m_currentProcess = new KProcess;
+
+  kp->clearArguments();
+  *kp << m_archiver_program;
+  *kp << "a";
+
+  if ( ArkSettings::replaceOnlyWithNewer() )
+    *kp << "-u";
+
+  if ( ArkSettings::rarRecurseSubdirs() )
+    *kp << "-r";
+
+  if ( !m_password.isEmpty() )
+    *kp << "-g"+m_password;
+
+  *kp << m_filename;
+
+  KURL dir( urls.first() );
+  QDir::setCurrent( dir.directory() );
+
+  QStringList::ConstIterator iter;
+  for ( iter = urls.begin(); iter != urls.end(); ++iter )
+  {
+    KURL url( *iter );
+    *kp << url.fileName();
+  }
+
+  connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( processExited(KProcess*) ),
+           SLOT( slotAddExited(KProcess*) ) );
+
+  if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+  {
+    KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+    emit sigAdd( false );
+  }
+}
+
+bool ArjArch::processLine( const QCString &line )
+{
+  QString unicode_line;
+
+  QTextCodec *codec = QTextCodec::codecForLocale();
+  QTextCodec *codec_alt = QTextCodec::codecForName("CP1251");
+  unicode_line = codec->toUnicode( line );
+
+  QStringList list;
+
+  QStringList l2 = QStringList::split( ' ', line );
+  if( l2.size() >= 2 && l2[0].endsWith(")") && l2[0].length() == 4 )
+  {
+    file_entry = line.mid(4);
+  }
+  else if( l2.size() > 3 )
+  {
+    if( l2[1] == "UNIX" )
+       list << codec->toUnicode(file_entry).stripWhiteSpace(); // filename
+    else
+       list << codec_alt->toUnicode(file_entry).stripWhiteSpace(); // filename
+
+    list << l2[ 2 ]; // size
+    list << l2[ 3 ]; // packed
+    double ratio = l2[4].toDouble();
+    if( ratio == 0 )
+       ratio = 1;
+    list << QString("%1").arg(100-100/ratio); // ratio
+
+    QStringList date =  QStringList::split( '-', l2[ 5 ] );
+    list << ArkUtils::fixYear( date[ 0 ].latin1() ) + '-' + date[ 1 ] + '-' + 
date [ 2 ] + ' ' + l2[6]; // date
+    list << l2[ 7 ]; // attributes
+
+    m_gui->fileList()->addItem( list ); // send to GUI
+    
+    file_entry = "";
+  }
+
+  return true;
+}
+
+
+void ArjArch::open()
+{
+  setHeaders();
+
+  m_buffer = "";
+  m_header_removed = false;
+  m_finished = false;
+
+  KProcess *kp = m_currentProcess = new KProcess;
+
+  *kp << m_unarchiver_program << "v" << m_filename;
+
+  connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+           SLOT( slotReceivedTOC(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( processExited(KProcess*) ),
+           SLOT( slotOpenExited(KProcess*) ) );
+
+  if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+  {
+    KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+    emit sigOpen( this, false, QString::null, 0 );
+  }
+}
+
+void ArjArch::unarchFileInternal()
+{
+  // if fileList is empty, all files are extracted.
+  // if destDir is empty, abort with error.
+  if ( m_destDir.isEmpty() || m_destDir.isNull() )
+  {
+    kdError( 1601 ) << "There was no extract directory given." << endl;
+    return;
+  }
+
+  KProcess *kp = m_currentProcess = new KProcess;
+  kp->clearArguments();
+
+  *kp << m_unarchiver_program;
+  *kp << "x";
+
+  if ( !m_password.isEmpty() )
+    *kp << "-g" + m_password;
+
+  if ( ArkSettings::extractOverwrite() )
+    *kp << "-jyo";
+
+  *kp << "-jycv";
+
+  *kp << "-w" + m_destDir;
+  *kp << "-ht" + m_destDir;
+
+  QTextCodec *codec = QTextCodec::codecForLocale();
+  *kp << codec->fromUnicode(m_filename);
+
+  // if the list is empty, no filenames go on the command line,
+  // and we then extract everything in the archive.
+  if ( m_fileList )
+  {
+    QStringList::Iterator it;
+
+    for ( it = m_fileList->begin(); it != m_fileList->end(); ++it )
+    {
+      *kp << codec->fromUnicode(*it);
+    }
+  }
+
+  connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( processExited(KProcess*) ),
+           SLOT( slotExtractExited(KProcess*) ) );
+
+  if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+  {
+    KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+    emit sigExtract( false );
+  }
+}
+
+bool ArjArch::passwordRequired()
+{
+    return m_lastShellOutput.findRev("File is password encrypted") != -1;
+}
+
+void ArjArch::remove( QStringList *list )
+{
+  if ( !list )
+    return;
+
+  KProcess *kp = m_currentProcess = new KProcess;
+  kp->clearArguments();
+
+  *kp << m_archiver_program << "d" << m_filename;
+
+  QStringList::Iterator it;
+  for ( it = list->begin(); it != list->end(); ++it )
+  {
+    QString str = *it;
+    *kp << str;
+  }
+
+  connect( kp, SIGNAL( receivedStdout(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( receivedStderr(KProcess*, char*, int) ),
+           SLOT( slotReceivedOutput(KProcess*, char*, int) ) );
+  connect( kp, SIGNAL( processExited(KProcess*) ),
+           SLOT( slotDeleteExited(KProcess*) ) );
+
+  if ( !kp->start( KProcess::NotifyOnExit, KProcess::AllOutput ) )
+  {
+    KMessageBox::error( 0, i18n( "Could not start a subprocess." ) );
+    emit sigDelete( false );
+  }
+}
+
+#include "arj.moc"
diff -u'Nrpk~' kdeutils-3.5.8~/ark/arj.h kdeutils-3.5.8/ark/arj.h
--- kdeutils-3.5.8~/ark/arj.h   1970-01-01 03:00:00 +0300
+++ kdeutils-3.5.8/ark/arj.h    2007-11-14 17:26:46 +0300
@@ -0,0 +1,63 @@
+/*
+
+  ark -- archiver for the KDE project
+
+  Copyright (C)
+
+  1997-1999: Rob Palmbos [email protected]
+  1999: Francois-Xavier Duranceau [email protected]
+  1999-2000: Corel Corporation (author: Emily Ezust, [email protected])
+  2001: Corel Corporation (author: Michael Jarrett, [email protected])
+  2007: ALT Linux (author: Sergey V Turchin, [email protected])
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License
+  as published by the Free Software Foundation; either version 2
+  of the License, or (at your option) any later version.
+
+  This program 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 General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA.
+
+*/
+
+#ifndef ARJARCH_H
+#define ARJARCH_H
+
+#include "arch.h"
+
+class QString;
+class QStringList;
+
+class ArkWidget;
+
+class ArjArch : public Arch
+{
+  Q_OBJECT
+  public:
+    ArjArch( ArkWidget *_gui, const QString & _fileName );
+    virtual ~ArjArch() { }
+
+    virtual void open();
+    virtual void create();
+    virtual void remove(QStringList*);
+    virtual void addFile(const QStringList&);
+    virtual void addDir(const QString&);
+
+    virtual void unarchFileInternal();
+    virtual bool passwordRequired();
+    virtual void createPassword();
+
+  protected slots:
+    virtual bool processLine( const QCString & );
+  private:
+    QCString file_entry;
+    void setHeaders();
+};
+
+#endif /* ARJARCH_H */
diff -u'Nrpk~' kdeutils-3.5.8~/ark/Makefile.am kdeutils-3.5.8/ark/Makefile.am
--- kdeutils-3.5.8~/ark/Makefile.am     2006-01-19 19:49:29 +0300
+++ kdeutils-3.5.8/ark/Makefile.am      2007-11-02 14:42:28 +0300
@@ -31,7 +31,7 @@ libarkpart_la_SOURCES = ark_part.cpp ark
                         arkwidget.cpp searchbar.cpp \
                         addition.ui extraction.ui general.ui \
                         arkviewer.cpp sevenzip.cpp extractiondialog.cpp \
-                        ace.cpp tarlistingthread.cpp
+                        ace.cpp tarlistingthread.cpp arj.cpp
 
 METASOURCES = AUTO
 
++++++ kdeutils-3.5.8-alt-ark-rar-password.patch ++++++
--- kdeutils-3.5.8/ark/rar.cpp~ 2007-10-17 20:32:52 +0400
+++ kdeutils-3.5.8/ark/rar.cpp  2007-10-31 14:53:05 +0300
@@ -275,7 +275,7 @@ void RarArch::unarchFileInternal()
 
 bool RarArch::passwordRequired()
 {
-    return m_lastShellOutput.findRev("password incorrect ?)")+1;
+    return m_lastShellOutput.find("Enter password") >= 0;
 }
 
 void RarArch::remove( QStringList *list )
++++++ kdeutils-3.5.8-alt-ark-zip-password.patch ++++++
--- kdeutils-3.5.8/ark/zip.cpp~ 2007-11-15 20:39:36 +0300
+++ kdeutils-3.5.8/ark/zip.cpp  2007-11-15 20:43:53 +0300
@@ -251,7 +251,7 @@ void ZipArch::unarchFileInternal()
 
 bool ZipArch::passwordRequired()
 {
-    return m_lastShellOutput.findRev("unable to get password\n")!=-1 || 
m_lastShellOutput.endsWith("password inflating\n") || 
m_lastShellOutput.findRev("password incorrect--reenter:")!=-1 || 
m_lastShellOutput.endsWith("incorrect password\n");
+    return m_lastShellOutput.findRev("password:") >= 0 || 
m_lastShellOutput.findRev("unable to get password\n")!=-1 || 
m_lastShellOutput.endsWith("password inflating\n") || 
m_lastShellOutput.findRev("password incorrect--reenter:")!=-1 || 
m_lastShellOutput.endsWith("incorrect password\n");
 }
 
 void ZipArch::remove( QStringList *list )
++++++ kdeutils-3.5.8-alt-create-password-zip-rar-7zip.patch ++++++
--- kdeutils-3.5.8/ark/ark.kcfg~        2005-09-10 12:21:35 +0400
+++ kdeutils-3.5.8/ark/ark.kcfg 2007-11-15 16:29:05 +0300
@@ -18,6 +18,11 @@
                        <whatsthis>Overwrite any files that have matching names 
on disk with the one from the archive</whatsthis>
                        <default>false</default>
                </entry>
+               <entry name="askCreatePassword" type="Bool">
+                       <label>Ask for password when create archive if 
possible</label>
+                       <whatsthis>Ask for password when create archive if 
possible</whatsthis>
+                       <default>true</default>
+               </entry>
        </group>
        <group name="Tar">
                <entry name="preservePerms" type="Bool">
--- kdeutils-3.5.8/ark/addition.ui~     2005-09-10 12:21:35 +0400
+++ kdeutils-3.5.8/ark/addition.ui      2007-11-15 16:31:35 +0300
@@ -16,6 +16,15 @@
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
+
+        <widget class="QCheckBox">
+            <property name="name">
+                <cstring>kcfg_askCreatePassword</cstring>
+            </property>
+            <property name="text">
+                <string>Ask for &amp;password when create archive if 
possible</string>
+            </property>
+        </widget>
         <widget class="QCheckBox">
             <property name="name">
                 <cstring>kcfg_replaceOnlyWithNewer</cstring>
--- kdeutils-3.5.8~/ark/arch.h  2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/arch.h   2007-11-02 14:08:34 +0300
@@ -149,6 +149,9 @@ class Arch : public QObject
     static Arch *archFactory( ArchType aType, ArkWidget *parent,
                               const QString &filename,
                               const QString &openAsMimeType = QString::null );
+    QString password() { return m_password; }
+    void setPassword(const QString & pw) { m_password = pw.local8Bit(); }
+    virtual void createPassword() {}
 
   protected slots:
     void slotOpenExited( KProcess* );
--- kdeutils-3.5.8~/ark/arkwidget.cpp   2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/arkwidget.cpp    2007-11-02 14:08:34 +0300
@@ -732,7 +732,10 @@ ArkWidget::file_open(const KURL& url)
     m_url = url;
     //arch->clearShellOutput();
 
-    openArchive( strFile );
+    if( url.hasPass() )
+       openArchive( strFile, url.pass() );
+    else
+       openArchive( strFile );
 }
 
 
@@ -1177,6 +1180,8 @@ ArkWidget::slotAddDone(bool _bSuccess)
         //simulate reload
         KURL u;
         u.setPath( arch->fileName() );
+       if( !arch->password().isEmpty() )
+           u.setPass( arch->password() );
         file_close();
         file_open( u );
         emit setWindowCaption( u.path() );
@@ -2095,6 +2100,7 @@ ArkWidget::slotCreate(Arch * _newarch, b
         m_bIsSimpleCompressedFile =
             (m_archType == COMPRESSED_FORMAT);
         fixEnables();
+       arch->createPassword();
     }
     else
     {
@@ -2108,7 +2114,7 @@ ArkWidget::slotCreate(Arch * _newarch, b
 //////////////////////////////////////////////////////////////////////
 
 void
-ArkWidget::openArchive( const QString & _filename )
+ArkWidget::openArchive( const QString & _filename, const QString & _password )
 {
     Arch *newArch = 0;
     ArchType archtype;
@@ -2165,6 +2171,7 @@ ArkWidget::openArchive( const QString & 
     busy( i18n( "Opening the archive..." ) );
     m_fileListView->setUpdatesEnabled( false );
     arch = newArch;
+    newArch->setPassword(_password);
     newArch->open();
     emit addRecentURL( m_url );
 }
--- kdeutils-3.5.8~/ark/arkwidget.h     2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/arkwidget.h      2007-11-02 14:08:34 +0300
@@ -234,7 +234,7 @@ protected:
     void createFileListView();
 
     bool createArchive(const QString & name);
-    void openArchive(const QString & name);
+    void openArchive(const QString & name, const QString & pass = "");
 
     void showCurrentFile();
 
--- kdeutils-3.5.8~/ark/rar.cpp 2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/rar.cpp  2007-11-02 14:08:34 +0300
@@ -163,6 +163,12 @@ void RarArch::create()
                   Arch::Extract | Arch::Delete | Arch::Add | Arch::View );
 }
 
+void RarArch::createPassword()
+{
+  if( m_password.isEmpty() && ArkSettings::askCreatePassword() )
+    KPasswordDialog::getNewPassword( m_password, i18n("Warning!\nUsing KGpg 
for encryption is more secure.\nCancel this dialog or enter password for %1 
archiver:").arg(m_archiver_program) );
+}
+
 void RarArch::addDir( const QString & _dirName )
 {
   if ( !_dirName.isEmpty() )
@@ -190,6 +196,9 @@ void RarArch::addFile( const QStringList
   if ( ArkSettings::rarRecurseSubdirs() )
     *kp << "-r";
 
+  if ( !m_password.isEmpty() )
+    *kp << "-p"+m_password;
+
   *kp << m_filename;
 
   KURL dir( urls.first() );
--- kdeutils-3.5.8~/ark/rar.h   2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/rar.h    2007-11-02 14:08:34 +0300
@@ -48,6 +48,7 @@ class RarArch : public Arch
     virtual void remove( QStringList * );
     virtual void unarchFileInternal();
     virtual bool passwordRequired();
+    virtual void createPassword();
 
   protected slots:
     virtual bool processLine( const QCString & );
--- kdeutils-3.5.8~/ark/sevenzip.cpp    2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/sevenzip.cpp     2007-11-02 14:08:52 +0300
@@ -120,6 +120,12 @@ void SevenZipArch::create()
                   Arch::Extract | Arch::Delete | Arch::Add | Arch::View );
 }
 
+void SevenZipArch::createPassword()
+{
+  if( m_password.isEmpty() && ArkSettings::askCreatePassword() )
+    KPasswordDialog::getNewPassword( m_password, i18n("Warning!\nUsing KGpg 
for encryption is more secure.\nCancel this dialog or enter password for %1 
archiver:").arg(m_archiver_program) );
+}
+
 void SevenZipArch::addFile( const QStringList & urls )
 {
   KProcess *kp = m_currentProcess = new KProcess;
@@ -127,6 +133,9 @@ void SevenZipArch::addFile( const QStrin
   kp->clearArguments();
   *kp << m_archiver_program << "a" ;
 
+  if ( !m_password.isEmpty() )
+    *kp << "-p" + m_password;
+
   KURL url( urls.first() );
   QDir::setCurrent( url.directory() );
 
@@ -163,6 +172,11 @@ void SevenZipArch::addDir( const QString
   }
 }
 
+bool SevenZipArch::passwordRequired()
+{
+    return m_lastShellOutput.find("Enter password") >= 0;
+}
+
 void SevenZipArch::remove( QStringList *list )
 {
   if ( !list )
@@ -212,6 +226,9 @@ void SevenZipArch::unarchFileInternal( )
     //*kp << "-ao";
   }
 
+  if ( !m_password.isEmpty() )
+    *kp << "-p" + m_password;
+
   *kp << m_filename;
 
   // if the file list is empty, no filenames go on the command line,
 bool SevenZipArch::processLine( const QCString& _line )
 {
   QCString line( _line );
--- kdeutils-3.5.8~/ark/sevenzip.h      2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/sevenzip.h       2007-11-02 14:08:34 +0300
@@ -41,7 +41,9 @@ class SevenZipArch : public Arch
 
     virtual void remove( QStringList * );
     virtual void unarchFileInternal( );
+    virtual bool passwordRequired();
+    virtual void createPassword();
 
   protected slots:
     virtual bool processLine( const QCString& line );
     virtual void slotReceivedTOC( KProcess*, char*, int );
--- kdeutils-3.5.8~/ark/zip.cpp 2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/zip.cpp  2007-11-02 14:08:34 +0300
@@ -35,6 +35,7 @@
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kprocess.h>
+#include <kpassdlg.h>
 
 // ark includes
 #include "zip.h"
@@ -115,6 +116,12 @@ void ZipArch::create()
                  Arch::Extract | Arch::Delete | Arch::Add | Arch::View );
 }
 
+void ZipArch::createPassword()
+{
+  if( m_password.isEmpty() && ArkSettings::askCreatePassword() )
+    KPasswordDialog::getNewPassword( m_password, i18n("Warning!\nUsing KGpg 
for encryption is more secure.\nCancel this dialog or enter password for %1 
archiver:").arg(m_archiver_program) );
+}
+
 void ZipArch::addDir( const QString & _dirName )
 {
   if ( !_dirName.isEmpty() )
--- kdeutils-3.5.8~/ark/zip.h   2007-11-02 14:06:05 +0300
+++ kdeutils-3.5.8/ark/zip.h    2007-11-02 14:08:34 +0300
@@ -51,6 +51,7 @@ class ZipArch : public Arch
     virtual void remove( QStringList * );
     virtual void unarchFileInternal();
     virtual bool passwordRequired();
+    virtual void createPassword();
   private:
     void setHeaders();
 };
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to