}
}
else total += items;
- parentItem->setText(0, files_list->topLevelItem(i)->text(0) + " " + i18np("(%1 item)", "(%1 items)", items));
+ parentItem->setText(0, files_list->topLevelItem(i)->text(0) + ' ' + i18np("(%1 item)", "(%1 items)", items));
}
}
if (m_name.isEmpty()) m_name = i18n("Untitled");
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);
QString filter = slideUrl.fileName();
QString ext = filter.section('.', -1);
filter = filter.section('%', 0, -2);
- QString regexp = "^" + filter + "\\d+\\." + ext + "$";
+ QString regexp = '^' + filter + "\\d+\\." + ext + '$';
QRegExp rx(regexp);
QStringList slideImages;
QString directory = dir.absolutePath();
else if (filesList.contains(fileName)) {
// we have 2 files with same name
int ix = 0;
- QString newFileName = fileName.section('.', 0, -2) + "_" + QString::number(ix) + "." + fileName.section('.', -1);
+ QString newFileName = fileName.section('.', 0, -2) + '_' + QString::number(ix) + '.' + fileName.section('.', -1);
while (filesList.contains(newFileName)) {
ix ++;
- newFileName = fileName.section('.', 0, -2) + "_" + QString::number(ix) + "." + fileName.section('.', -1);
+ newFileName = fileName.section('.', 0, -2) + '_' + QString::number(ix) + '.' + fileName.section('.', -1);
}
fileName = newFileName;
item->setData(0, Qt::UserRole, fileName);
QString filter = slideUrl.fileName();
QString ext = filter.section('.', -1);
filter = filter.section('%', 0, -2);
- QString regexp = "^" + filter + "\\d+\\." + ext + "$";
+ QString regexp = '^' + filter + "\\d+\\." + ext + '$';
QRegExp rx(regexp);
QStringList slideImages;
qint64 totalSize = 0;
else if (filesList.contains(fileName)) {
// we have 2 files with same name
int ix = 0;
- QString newFileName = fileName.section('.', 0, -2) + "_" + QString::number(ix) + "." + fileName.section('.', -1);
+ QString newFileName = fileName.section('.', 0, -2) + '_' + QString::number(ix) + '.' + fileName.section('.', -1);
while (filesList.contains(newFileName)) {
ix ++;
newFileName = fileName.section('.', 0, -2) + "_" + QString::number(ix) + "." + fileName.section('.', -1);
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()) {
else isSlideshow = false;
files_list->setCurrentItem(parentItem);
parentItem->setExpanded(true);
- destPath = parentItem->data(0, Qt::UserRole).toString() + "/";
+ destPath = parentItem->data(0, Qt::UserRole).toString() + '/';
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + destPath);
QTreeWidgetItem *item;
for (int j = 0; j < parentItem->childCount(); j++) {
// Special case: slideshows
items++;
if (isSlideshow) {
- destPath += item->data(0, Qt::UserRole).toString() + "/";
+ destPath += item->data(0, Qt::UserRole).toString() + '/';
destUrl = KUrl(archive_url->url().path(KUrl::AddTrailingSlash) + destPath);
QStringList srcFiles = item->data(0, Qt::UserRole + 1).toStringList();
for (int k = 0; k < srcFiles.count(); k++) {
if (items == 0) {
// No clips to archive
- if (isArchive) slotArchivingFinished(NULL, true);
+ slotArchivingFinished(NULL, true);
return true;
}
KUrl src(item->text(0));
KUrl dest = destUrl;
if (isSlideshow) {
- dest = KUrl(destUrl.path(KUrl::AddTrailingSlash) + item->data(0, Qt::UserRole).toString() + "/" + src.fileName());
+ dest = KUrl(destUrl.path(KUrl::AddTrailingSlash) + item->data(0, Qt::UserRole).toString() + '/' + src.fileName());
}
else if (item->data(0, Qt::UserRole).isNull()) {
dest.addPath(src.fileName());
}
QDomElement mlt = m_doc.documentElement();
- QString root = mlt.attribute("root") + "/";
+ QString root = mlt.attribute("root") + '/';
// Adjust global settings
QString basePath;
QString endString("\"");
endString.append(basePath);
playList.replace(startString, endString);
- startString = ">" + archive_url->url().path(KUrl::RemoveTrailingSlash);
- endString = ">" + basePath;
+ startString = '>' + archive_url->url().path(KUrl::RemoveTrailingSlash);
+ endString = '>' + basePath;
playList.replace(startString, endString);
}
error = true;
}
else {
- QString playList = file.readAll();
+ QString playList = QString::fromUtf8(file.readAll());
file.close();
if (playList.isEmpty()) {
error = true;
itemsCount ++;
}
}
- parentItem->setText(0, parentItem->text(0).section("(", 0, 0) + i18np("(%1 item)", "(%1 items)", itemsCount));
+ parentItem->setText(0, parentItem->text(0).section('(', 0, 0) + i18np("(%1 item)", "(%1 items)", itemsCount));
}
project_files->setText(i18np("%1 file to archive, requires %2", "%1 files to archive, requires %2", total, KIO::convertSize(m_requestedSize)));
slotCheckSpace();