Commit f21c5f58 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

Create a getter for m_autoSubfolder, add apidox for it

svn path=/trunk/KDE/kdeutils/ark/; revision=1001692
parent 94191b5f
......@@ -43,7 +43,7 @@
namespace Kerfuffle
{
BatchExtract::BatchExtract()
: m_autoSubfolders(false),
: m_autoSubfolder(false),
m_preservePaths(true)
{
setCapabilities(KJob::Killable);
......@@ -64,7 +64,7 @@ void BatchExtract::addExtraction(Kerfuffle::Archive* archive, QString destinatio
QString autoDestination = destinationFolder;
if (m_autoSubfolders) {
if (autoSubfolder()) {
if (!archive->isSingleFolderArchive()) {
QDir destinationDir(destinationFolder);
QString subfolderName = archive->subfolderName();
......@@ -103,9 +103,14 @@ void BatchExtract::slotUserQuery(Query *query)
query->execute();
}
bool BatchExtract::autoSubfolder()
{
return m_autoSubfolder;
}
void BatchExtract::setAutoSubfolder(bool value)
{
m_autoSubfolders = value;
m_autoSubfolder = value;
}
void BatchExtract::start()
......@@ -248,7 +253,7 @@ bool BatchExtract::showExtractDialog()
else
dialog->setCurrentUrl(m_destinationFolder);
dialog->setAutoSubfolder(m_autoSubfolders);
dialog->setAutoSubfolder(autoSubfolder());
dialog->setPreservePaths(m_preservePaths);
if (m_subfolder.isEmpty() && m_inputs.size() == 1) {
......
......@@ -70,6 +70,28 @@ public:
*/
void start();
/**
* Whether to automatically create a folder inside the destination
* directory if the archive has more than one directory or file
* at top level.
*
* @return @c true Create the subdirectory automatically.
* @return @c false Do not create the subdirectory automatically.
*/
bool autoSubfolder();
/**
* Set whether a folder should be created when necessary so
* the archive is extracted to it.
*
* If set to @c true, when the archive does not consist of a
* single folder with the other files and directories inside,
* a directory will be automatically created inside the destination
* directory and the archive will be extracted there.
*
* @param value Whether to create this directory automatically
* when needed.
*/
void setAutoSubfolder(bool value);
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment