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

ark

  • sources
  • kde-4.14
  • kdeutils
  • ark
  • app
batchextract.h
Go to the documentation of this file.
1 /*
2  * ark -- archiver for the KDE project
3  *
4  * Copyright (C) 2008 Harald Hvaal <haraldhv@stud.ntnu.no>
5  * Copyright (C) 2009-2010 Raphael Kubo da Costa <rakuco@FreeBSD.org>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef BATCHEXTRACT_H
30 #define BATCHEXTRACT_H
31 
32 #include <kcompositejob.h>
33 #include <KUrl>
34 
35 #include <QtCore/QMap>
36 #include <QtCore/QPair>
37 #include <QtCore/QString>
38 #include <QtCore/QStringList>
39 
40 namespace Kerfuffle
41 {
42 class Archive;
43 class Query;
44 }
45 
54 class BatchExtract : public KCompositeJob
55 {
56  Q_OBJECT
57 
58 public:
62  BatchExtract();
63 
67  virtual ~BatchExtract();
68 
78  void addExtraction(Kerfuffle::Archive* archive);
79 
83  void start();
84 
93  bool autoSubfolder() const;
94 
107  void setAutoSubfolder(bool value);
108 
119  bool addInput(const KUrl& url);
120 
127  bool showExtractDialog();
128 
137  QString destinationFolder() const;
138 
150  void setDestinationFolder(const QString& folder);
151 
159  bool openDestinationAfterExtraction() const;
160 
167  void setOpenDestinationAfterExtraction(bool value);
168 
178  bool preservePaths() const;
179 
188  void setPreservePaths(bool value);
189 
190 private slots:
194  void forwardProgress(KJob *job, unsigned long percent);
195 
200  void showFailedFiles();
201 
207  void slotResult(KJob *job);
208 
212  void slotUserQuery(Kerfuffle::Query *query);
213 
220  void slotStartJob();
221 
222 private:
223  int m_initialJobCount;
224  QMap<KJob*, QPair<QString, QString> > m_fileNames;
225  bool m_autoSubfolder;
226 
227  QList<Kerfuffle::Archive*> m_inputs;
228  QString m_destinationFolder;
229  QStringList m_failedFiles;
230  bool m_preservePaths;
231  bool m_openDestinationAfterExtraction;
232 };
233 
234 #endif // BATCHEXTRACT_H
BatchExtract::~BatchExtract
virtual ~BatchExtract()
Destroys a BatchExtract object.
Definition: batchextract.cpp:60
BatchExtract::setOpenDestinationAfterExtraction
void setOpenDestinationAfterExtraction(bool value)
Whether to open the destination folder after all archives are extracted.
Definition: batchextract.cpp:247
Kerfuffle::Query
Definition: queries.h:44
QMap
BatchExtract::addExtraction
void addExtraction(Kerfuffle::Archive *archive)
Creates an ExtractJob for the given archive and puts it on the queue.
Definition: batchextract.cpp:67
BatchExtract::addInput
bool addInput(const KUrl &url)
Adds a file to the list of files that will be extracted.
Definition: batchextract.cpp:207
BatchExtract::setAutoSubfolder
void setAutoSubfolder(bool value)
Set whether a folder should be created when necessary so the archive is extracted to it...
Definition: batchextract.cpp:111
BatchExtract::BatchExtract
BatchExtract()
Creates a new BatchExtract object.
Definition: batchextract.cpp:49
BatchExtract::destinationFolder
QString destinationFolder() const
Returns the destination directory where the archives will be extracted to.
Definition: batchextract.cpp:231
BatchExtract::preservePaths
bool preservePaths() const
Whether all files should be extracted to the same directory, even if they're in different directories...
Definition: batchextract.cpp:226
QString
QList< Kerfuffle::Archive * >
QStringList
Kerfuffle::Archive
Definition: archive.h:88
BatchExtract::openDestinationAfterExtraction
bool openDestinationAfterExtraction() const
Returns whether the destination folder should be open after all archives are extracted.
Definition: batchextract.cpp:221
BatchExtract::setPreservePaths
void setPreservePaths(bool value)
Sets whether paths should be preserved during extraction.
Definition: batchextract.cpp:252
BatchExtract::start
void start()
A wrapper that calls slotStartJob() when the event loop has started.
Definition: batchextract.cpp:116
BatchExtract::setDestinationFolder
void setDestinationFolder(const QString &folder)
Sets the directory the archives will be extracted to.
Definition: batchextract.cpp:240
BatchExtract::autoSubfolder
bool autoSubfolder() const
Whether to automatically create a folder inside the destination directory if the archive has more tha...
Definition: batchextract.cpp:106
BatchExtract::showExtractDialog
bool showExtractDialog()
Shows the extract options dialog before extracting the files.
Definition: batchextract.cpp:257
BatchExtract
This class schedules the extraction of all given compressed archives.
Definition: batchextract.h:54
KCompositeJob
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:37 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ark

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

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal