#include "archivewidget.h"
#include "titlewidget.h"
-#include <KLocale>
+#include <KLocalizedString>
#include <KDiskFreeSpaceInfo>
#include <KUrlRequester>
#include <KFileDialog>
// Check that it is a kdenlive project archive
bool isProjectArchive = false;
QStringList files = m_extractArchive->directory()->entries();
- for (int i = 0; i < files.count(); i++) {
+ for (int i = 0; i < files.count(); ++i) {
if (files.at(i).endsWith(".kdenlive")) {
m_projectName = files.at(i);
isProjectArchive = true;
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
QStringList slideImages;
qint64 totalSize = 0;
- for (int i = 0; i < resultList.count(); i++) {
+ for (int i = 0; i < resultList.count(); ++i) {
totalSize += resultList.at(i).size();
slideImages << resultList.at(i).absoluteFilePath();
}
QFileInfoList resultList = dir.entryInfoList(QDir::Files);
QStringList slideImages;
qint64 totalSize = 0;
- for (int i = 0; i < resultList.count(); i++) {
+ for (int i = 0; i < resultList.count(); ++i) {
totalSize += resultList.at(i).size();
slideImages << resultList.at(i).absoluteFilePath();
}
int items = 0;
// We parse all files going into one folder, then start the copy job
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
parentItem = files_list->topLevelItem(i);
if (parentItem->isDisabled()) {
parentItem->setExpanded(false);
if (isArchive) {
m_foldersList.append(destPath);
- for (int i = 0; i < files.count(); i++) {
+ for (int i = 0; i < files.count(); ++i) {
m_filesList.insert(files.at(i).path(), destPath + files.at(i).fileName());
}
slotArchivingFinished();
archive_url->setEnabled(true);
proxy_only->setEnabled(true);
compressed_archive->setEnabled(true);
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
files_list->topLevelItem(i)->setDisabled(false);
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
files_list->topLevelItem(i)->child(j)->setDisabled(false);
QTreeWidgetItem *item;
bool isArchive = compressed_archive->isChecked();
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
if (parentItem->childCount() > 0) {
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + parentItem->data(0, Qt::UserRole).toString());
// process kdenlive producers
QDomNodeList prods = mlt.elementsByTagName("kdenlive_producer");
- for (int i = 0; i < prods.count(); i++) {
+ for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
if (e.hasAttribute("resource")) {
// process mlt producers
prods = mlt.elementsByTagName("producer");
- for (int i = 0; i < prods.count(); i++) {
+ for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
QString src = EffectsList::property(e, "resource");
// process mlt transitions (for luma files)
prods = mlt.elementsByTagName("transition");
QString attribute;
- for (int i = 0; i < prods.count(); i++) {
+ for (int i = 0; i < prods.count(); ++i) {
QDomElement e = prods.item(i).toElement();
if (e.isNull()) continue;
attribute = "resource";
// Add project file
bool result = false;
if (m_temp) {
- archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
- result = archive.close();
- delete m_temp;
+ archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
+ result = archive.close();
+ delete m_temp;
+ m_temp = 0;
}
emit archivingFinished(result);
}
archive_url->setEnabled(true);
proxy_only->setEnabled(true);
compressed_archive->setEnabled(true);
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
files_list->topLevelItem(i)->setDisabled(false);
for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++)
files_list->topLevelItem(i)->child(j)->setDisabled(false);
emit extractingFinished();
}
-QString ArchiveWidget::extractedProjectFile()
+QString ArchiveWidget::extractedProjectFile() const
{
return archive_url->url().path(KUrl::AddTrailingSlash) + m_projectName;
}
QTreeWidgetItem *parentItem = NULL;
// Build list of existing proxy ids
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
parentItem = files_list->topLevelItem(i);
if (parentItem->data(0, Qt::UserRole).toString() == "proxy") break;
}
}
// Parse all items to disable original clips for existing proxies
- for (int i = 0; i < proxyIdList.count(); i++) {
+ for (int i = 0; i < proxyIdList.count(); ++i) {
QString id = proxyIdList.at(i);
if (id.isEmpty()) continue;
for (int j = 0; j < files_list->topLevelItemCount(); j++) {
}
else {
// Archive all clips
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
int items = parentItem->childCount();
for (int j = 0; j < items; j++) {
// Calculate requested size
int total = 0;
- for (int i = 0; i < files_list->topLevelItemCount(); i++) {
+ for (int i = 0; i < files_list->topLevelItemCount(); ++i) {
QTreeWidgetItem *parentItem = files_list->topLevelItem(i);
int items = parentItem->childCount();
int itemsCount = 0;
slotCheckSpace();
}
+
+#include "archivewidget.moc"