ArchiveWidget::ArchiveWidget(QString projectName, QDomDocument doc, QList <DocClipBase*> list, QStringList luma_list, QWidget * parent) :
- QDialog(parent),
- m_requestedSize(0),
- m_copyJob(NULL),
- m_name(projectName.section('.', 0, -2)),
- m_doc(doc),
- m_abortArchive(false),
- m_extractMode(false),
- m_extractArchive(NULL),
- m_missingClips(0)
+ QDialog(parent)
+ , m_requestedSize(0)
+ , m_copyJob(NULL)
+ , m_name(projectName.section('.', 0, -2))
+ , m_doc(doc)
+ , m_temp(NULL)
+ , m_abortArchive(false)
+ , m_extractMode(false)
+ , m_progressTimer(NULL)
+ , m_extractArchive(NULL)
+ , m_missingClips(0)
{
setAttribute(Qt::WA_DeleteOnClose);
setupUi(this);
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Archive"));
connect(buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotStartArchiving()));
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
-
+
slotCheckSpace();
}
//setAttribute(Qt::WA_DeleteOnClose);
setupUi(this);
+ m_progressTimer = new QTimer;
+ m_progressTimer->setInterval(800);
+ m_progressTimer->setSingleShot(false);
+ connect(m_progressTimer, SIGNAL(timeout()), this, SLOT(slotExtractProgress()));
connect(this, SIGNAL(extractingFinished()), this, SLOT(slotExtractingFinished()));
connect(this, SIGNAL(showMessage(const QString &, const QString &)), this, SLOT(slotDisplayMessage(const QString &, const QString &)));
ArchiveWidget::~ArchiveWidget()
{
if (m_extractArchive) delete m_extractArchive;
+ if (m_progressTimer) delete m_progressTimer;
}
void ArchiveWidget::slotDisplayMessage(const QString &icon, const QString &text)
if (!isProjectArchive) {
emit showMessage("dialog-close", i18n("File %1\n is not an archived Kdenlive project", m_extractUrl.path()));
groupBox->setEnabled(false);
+ buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
return;
}
buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
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++) {
parentItem = files_list->topLevelItem(i);
if (parentItem->isDisabled()) {
if (items == 0) {
// No clips to archive
- if (isArchive) slotArchivingFinished(NULL, true);
+ slotArchivingFinished(NULL, true);
return true;
}
}
// Add project file
- archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
- bool result = archive.close();
- delete m_temp;
+ bool result = false;
+ if (m_temp) {
+ archive.addLocalFile(m_temp->fileName(), m_name + ".kdenlive");
+ result = archive.close();
+ delete m_temp;
+ }
emit archivingFinished(result);
}
KIO::NetAccess::mkdir(archive_url->url().path(KUrl::RemoveTrailingSlash), this);
slotDisplayMessage("system-run", i18n("Extracting..."));
buttonBox->button(QDialogButtonBox::Apply)->setText(i18n("Abort"));
- m_progressTimer = new QTimer;
- m_progressTimer->setInterval(800);
- m_progressTimer->setSingleShot(false);
- connect(m_progressTimer, SIGNAL(timeout()), this, SLOT(slotExtractProgress()));
m_archiveThread = QtConcurrent::run(this, &ArchiveWidget::doExtracting);
m_progressTimer->start();
}
void ArchiveWidget::slotExtractingFinished()
{
m_progressTimer->stop();
- delete m_progressTimer;
// Process project file
QFile file(extractedProjectFile());
bool error = false;
error = true;
}
else {
- QString playList = file.readAll();
+ QString playList = QString::fromUtf8(file.readAll());
file.close();
if (playList.isEmpty()) {
error = true;