• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

ark

archivebase.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  *
00014  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00015  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00016  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00017  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00018  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
00019  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00020  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
00021  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00022  * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
00023  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00024  */
00025 
00026 #include "archivebase.h"
00027 #include "internaljobs.h"
00028 
00029 #include <kdebug.h>
00030 #include <ThreadWeaver/Job>
00031 #include <ThreadWeaver/Weaver>
00032 
00033 #include <QFile>
00034 #include <QDir>
00035 #include <QList>
00036 #include <QStringList>
00037 #include <QDateTime>
00038 
00039 namespace Kerfuffle
00040 {
00041     ArchiveBase::ArchiveBase( ReadOnlyArchiveInterface *archive )
00042         : QObject(), Archive(), m_iface( archive )
00043     {
00044         Q_ASSERT( archive );
00045         archive->setParent( this );
00046         //setReadOnly( archive->isReadOnly() );
00047     }
00048 
00049     ArchiveBase::~ArchiveBase()
00050     {
00051         delete m_iface;
00052         m_iface = 0;
00053     }
00054 
00055     bool ArchiveBase::isReadOnly()
00056     {
00057         return m_iface->isReadOnly();
00058     }
00059 
00060     KJob* ArchiveBase::open()
00061     {
00062         return 0;
00063     }
00064 
00065     KJob* ArchiveBase::create()
00066     {
00067         return 0;
00068     }
00069 
00070     ListJob* ArchiveBase::list()
00071     {
00072         return new ListJob( m_iface, this );
00073     }
00074 
00075     DeleteJob* ArchiveBase::deleteFiles( const QList<QVariant> & files )
00076     {
00077         if ( m_iface->isReadOnly() )
00078         {
00079             return 0;
00080         }
00081         return new DeleteJob( files, static_cast<ReadWriteArchiveInterface*>( m_iface ), this );
00082     }
00083 
00084     AddJob* ArchiveBase::addFiles( const QStringList & files )
00085     {
00086         Q_ASSERT( !m_iface->isReadOnly() );
00087         return new AddJob( files, static_cast<ReadWriteArchiveInterface*>( m_iface ), this );
00088     }
00089 
00090     ExtractJob* ArchiveBase::copyFiles( const QList<QVariant> & files, const QString & destinationDir, bool preservePaths )
00091     {
00092         return new ExtractJob( files, destinationDir, preservePaths, m_iface, this );
00093     }
00094 
00095     QString ArchiveBase::fileName()
00096     {
00097         return m_iface->filename();
00098     }
00099 
00100 } // namespace Kerfuffle
00101 
00102 #include "archivebase.moc"

ark

Skip menu "ark"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal