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

Apidox++, use getters whenever possible

svn path=/trunk/KDE/kdeutils/ark/; revision=1001726
parent c4af2c02
......@@ -119,19 +119,19 @@ void BatchExtract::start()
return;
}
if (!m_subfolder.isEmpty()) {
kDebug() << "Creating subfolder" << m_subfolder;
QDir dest(m_destinationFolder);
dest.mkpath(m_subfolder);
m_destinationFolder += '/' + m_subfolder;
if (!subfolder().isEmpty()) {
kDebug() << "Creating subfolder" << subfolder();
QDir dest(destinationFolder());
dest.mkpath(subfolder());
m_destinationFolder += '/' + subfolder();
}
foreach(Kerfuffle::Archive *archive, m_inputs) {
QString finalDestination;
if (m_destinationFolder.isEmpty()) {
if (destinationFolder().isEmpty()) {
finalDestination = QDir::currentPath();
} else {
finalDestination = m_destinationFolder;
finalDestination = destinationFolder();
}
addExtraction(archive, finalDestination);
......@@ -221,8 +221,14 @@ bool BatchExtract::preservePaths()
return m_preservePaths;
}
QString BatchExtract::destinationFolder()
{
return m_destinationFolder;
}
void BatchExtract::setDestinationFolder(QString folder)
{
// TODO: check whether the directory is valid
if (!folder.isEmpty()) {
m_destinationFolder = folder;
}
......@@ -233,6 +239,11 @@ void BatchExtract::setPreservePaths(bool value)
m_preservePaths = value;
}
QString BatchExtract::subfolder()
{
return m_subfolder;
}
void BatchExtract::setSubfolder(QString subfolder)
{
m_subfolder = subfolder;
......@@ -245,22 +256,22 @@ bool BatchExtract::showExtractDialog()
dialog->batchModeOption();
}
if (m_destinationFolder.isEmpty()) {
if (destinationFolder().isEmpty()) {
dialog->setCurrentUrl(QDir::currentPath());
} else {
dialog->setCurrentUrl(m_destinationFolder);
dialog->setCurrentUrl(destinationFolder());
}
dialog->setAutoSubfolder(autoSubfolder());
dialog->setPreservePaths(preservePaths());
if (m_subfolder.isEmpty() && m_inputs.size() == 1) {
if (subfolder().isEmpty() && m_inputs.size() == 1) {
if (m_inputs.at(0)->isSingleFolderArchive()) {
dialog->setSingleFolderArchive(true);
}
dialog->setSubfolder(m_inputs.at(0)->subfolderName());
} else {
dialog->setSubfolder(m_subfolder);
dialog->setSubfolder(subfolder());
}
if (!dialog->exec()) {
......@@ -270,7 +281,7 @@ bool BatchExtract::showExtractDialog()
setDestinationFolder(dialog->destinationDirectory().path());
if (dialog->extractToSubfolder()) {
m_subfolder = dialog->subfolder();
setSubfolder(dialog()->subfolder());
}
setAutoSubfolder(dialog->autoSubfolders());
......
......@@ -113,8 +113,47 @@ public:
* plugin could not be found.
*/
bool addInput(const KUrl& url);
/**
* Shows the extract options dialog before extracting the files.
*
* @return @c true The user has set some options and clicked OK.
* @return @c false The user has canceled extraction.
*/
bool showExtractDialog();
/**
* Returns the destination directory where the archives
* will be extracted to.
*
* @return The destination directory.
*/
QString destinationFolder();
/**
* Sets the directory the archives will be extracted to.
* If @c setSubfolder has been used, the final destination
* directory will be the concatenation of both.
*
* @param folder The directory that will be used.
*/
void setDestinationFolder(QString folder);
/**
* Returns the subdirectory into which the archives
* will be extracted, if it has been set.
*
* @return The subdirectory that will be used, or an
* empty @c QString if none has been set.
*/
QString subfolder();
/**
* Force the creation of a subdirectory inside the destination
* directory, so that the archives are extracted into it.
*
* @param subfolder The subdirectory that will be created.
*/
void setSubfolder(QString subfolder);
/**
......
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