Git commit 066663aa3816adb45154f8b5aedcefebc3eac64d by Jean-Baptiste Mardel= le. Committed on 03/01/2017 at 15:33. Pushed by mardelle into branch 'master'. Merge branch '16.12' M +13 -1 src/bin/bin.cpp M +5 -5 src/doc/kdenlivedoc.cpp M +12 -7 src/mainwindow.cpp M +9 -5 src/monitor/monitor.cpp M +5 -1 src/project/dialogs/profilewidget.cpp https://commits.kde.org/kdenlive/066663aa3816adb45154f8b5aedcefebc3eac64d diff --cc src/bin/bin.cpp index 9ee5994b8,45a2a8ec6..f30517abd --- a/src/bin/bin.cpp +++ b/src/bin/bin.cpp @@@ -812,83 -792,80 +812,90 @@@ void Bin::slotDeleteClip( QStringList subClipIds; QStringList foldersIds; ProjectSubClip *sub; - QString subId; QPoint zone; + bool usedFolder =3D false; // check folders, remove child folders if there is any - QList topFolders; + QList topFolders; foreach (const QModelIndex &ix, indexes) { - if (!ix.isValid() || ix.column() !=3D 0) continue; - AbstractProjectItem *item =3D static_cast(m= _proxyModel->mapToSource(ix).internalPointer()); - if (!item) continue; - if (item->itemType() =3D=3D AbstractProjectItem::SubClipItem) { - QString subId =3D item->clipId(); - sub =3D static_cast(item); - zone =3D sub->zone(); - subId.append(":" + QString::number(zone.x()) + ":" + QStr= ing::number(zone.y())); - subClipIds << subId; - continue; - } - if (item->itemType() !=3D AbstractProjectItem::FolderItem) contin= ue; - ProjectFolder *current =3D static_cast(item); + if (!ix.isValid() || ix.column() !=3D 0) { + continue; + } + AbstractProjectItem *item =3D static_cast(= m_proxyModel->mapToSource(ix).internalPointer()); + if (!item) { + continue; + } + if (item->itemType() =3D=3D AbstractProjectItem::SubClipItem) { + QString subId =3D item->clipId(); + sub =3D static_cast(item); + zone =3D sub->zone(); + subId.append(":" + QString::number(zone.x()) + ":" + QString:= :number(zone.y())); + subClipIds << subId; + continue; + } + if (item->itemType() !=3D AbstractProjectItem::FolderItem) { + continue; + } + ProjectFolder *current =3D static_cast(item); + if (!usedFolder && !current->isEmpty()) { + usedFolder =3D true; + } - if (topFolders.isEmpty()) { - topFolders << current; - continue; - } - // parse all folders to check for children - bool isChild =3D false; - foreach (ProjectFolder *f, topFolders) { - if (f->folder(current->clipId())) { - // Current is a child, no need to take it into account - isChild =3D true; - break; - } - } - if (isChild) continue; - QList childFolders; - // parse all folders to check for children - foreach (ProjectFolder *f, topFolders) { - if (current->folder(f->clipId())) { - childFolders << f; - } - } - if (!childFolders.isEmpty()) { - // children are in the list, remove from - foreach (ProjectFolder *f, childFolders) { - topFolders.removeAll(f); - } - } - topFolders << current; + if (topFolders.isEmpty()) { + topFolders << current; + continue; + } + // parse all folders to check for children + bool isChild =3D false; + foreach (ProjectFolder *f, topFolders) { + if (f->folder(current->clipId())) { + // Current is a child, no need to take it into account + isChild =3D true; + break; + } + } + if (isChild) { + continue; + } + QList childFolders; + // parse all folders to check for children + foreach (ProjectFolder *f, topFolders) { + if (current->folder(f->clipId())) { + childFolders << f; + } + } + if (!childFolders.isEmpty()) { + // children are in the list, remove from + foreach (ProjectFolder *f, childFolders) { + topFolders.removeAll(f); + } + } + topFolders << current; } foreach (const ProjectFolder *f, topFolders) { - foldersIds << f->clipId(); + foldersIds << f->clipId(); } - = + bool usedClips =3D false; - QList topClips; + QList topClips; // Check if clips are in already selected folders foreach (const QModelIndex &ix, indexes) { - if (!ix.isValid() || ix.column() !=3D 0) continue; - AbstractProjectItem *item =3D static_cast(m= _proxyModel->mapToSource(ix).internalPointer()); - if (!item || item->itemType() !=3D AbstractProjectItem::ClipItem)= continue; - ProjectClip *current =3D static_cast(item); - bool isChild =3D false; - foreach (const ProjectFolder *f, topFolders) { - if (current->hasParent(f->clipId())) { - isChild =3D true; - break; - } - } - if (!isChild) { + if (!ix.isValid() || ix.column() !=3D 0) { + continue; + } + AbstractProjectItem *item =3D static_cast(= m_proxyModel->mapToSource(ix).internalPointer()); + if (!item || item->itemType() !=3D AbstractProjectItem::ClipItem)= { + continue; + } + ProjectClip *current =3D static_cast(item); + bool isChild =3D false; + foreach (const ProjectFolder *f, topFolders) { + if (current->hasParent(f->clipId())) { + isChild =3D true; + break; + } + } + if (!isChild) { + if (!usedClips && current->refCount() > 0) { + usedClips =3D true; - = + } clipIds << current->clipId(); } } diff --cc src/doc/kdenlivedoc.cpp index 3d8be9d8d,563da4366..7f9740735 --- a/src/doc/kdenlivedoc.cpp +++ b/src/doc/kdenlivedoc.cpp @@@ -561,10 -559,10 +561,10 @@@ void KdenliveDoc::slotAutoSave( if (m_render && m_autosave) { if (!m_autosave->isOpen() && !m_autosave->open(QIODevice::ReadWri= te)) { // show error: could not open the autosave file - qDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE"; + qCDebug(KDENLIVE_LOG) << "ERROR; CANNOT CREATE AUTOSAVE FILE"; } - //qDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName(); + //qCDebug(KDENLIVE_LOG) << "// AUTOSAVE FILE: " << m_autosave->fi= leName(); - QDomDocument sceneList =3D xmlSceneList(m_render->sceneList(m_url= .adjusted(QUrl::RemoveFilename).path())); + QDomDocument sceneList =3D xmlSceneList(m_render->sceneList(m_url= .adjusted(QUrl::RemoveFilename).toLocalFile())); if (sceneList.isNull()) { //Make sure we don't save if scenelist is corrupted KMessageBox::error(QApplication::activeWindow(), i18n("Cannot= write to file %1, scene list is corrupted.", m_autosave->fileName())); @@@ -772,9 -764,7 +772,9 @@@ void KdenliveDoc::moveProjectData(cons if (!oldUrl.isEmpty()) { QUrl newUrl =3D QUrl::fromLocalFile(dest + QStringLiteral= ("/titles/") + oldUrl.fileName()); KIO::Job *job =3D KIO::copy(oldUrl, newUrl); - if (job->exec()) clip->setProperty(QStringLiteral("resour= ce"), newUrl.toLocalFile()); + if (job->exec()) { - clip->setProperty(QStringLiteral("resource"), newUrl.= path()); ++ clip->setProperty(QStringLiteral("resource"), newUrl.= toLocalFile()); + } } continue; } diff --cc src/mainwindow.cpp index 1d70d4f30,910b604ba..661574ab0 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@@ -173,12 -177,18 +173,17 @@@ MainWindow::MainWindow(const QString &M // GTK theme does not work well with Kdenlive, and does not support c= olor theming, so avoid it QStringList availableStyles =3D QStyleFactory::keys(); QString desktopStyle =3D QApplication::style()->objectName(); - if (QString::compare(desktopStyle, QLatin1String("GTK+"), Qt::CaseIns= ensitive) =3D=3D 0 && KdenliveSettings::widgetstyle().isEmpty()) { - if (availableStyles.contains(QStringLiteral("breeze"), Qt::CaseIn= sensitive)) { - // Auto switch to Breeze theme - KdenliveSettings::setWidgetstyle(QStringLiteral("Breeze")); - } else if (availableStyles.contains(QStringLiteral("fusion"), Qt:= :CaseInsensitive)) { - KdenliveSettings::setWidgetstyle(QStringLiteral("Fusion")); + if (KdenliveSettings::widgetstyle().isEmpty()) { + // First run + QStringList incompatibleStyles; + incompatibleStyles << QStringLiteral("GTK+") << QStringLiteral("w= indowsvista") << QStringLiteral("windowsxp"); + if (incompatibleStyles.contains(desktopStyle, Qt::CaseInsensitive= )) { - if (availableStyles.contains(QLatin1String("breeze"), Qt::Cas= eInsensitive)) { ++ if (availableStyles.contains(QStringLiteral("breeze"), Qt::Ca= seInsensitive)) { + // Auto switch to Breeze theme + KdenliveSettings::setWidgetstyle(QStringLiteral("Breeze")= ); - } else if (availableStyles.contains(QLatin1String("fusion"), = Qt::CaseInsensitive)) { ++ } else if (availableStyles.contains(QStringLiteral("fusion"),= Qt::CaseInsensitive)) { + KdenliveSettings::setWidgetstyle(QStringLiteral("Fusion")= ); + } } } = diff --cc src/project/dialogs/profilewidget.cpp index 076f4f468,cb93adcab..5e29a7677 --- a/src/project/dialogs/profilewidget.cpp +++ b/src/project/dialogs/profilewidget.cpp @@@ -331,57 -342,56 +331,61 @@@ void ProfileWidget::checkInterlace(cons } else { fps =3D QString::number((double)prof.frame_rate_num / prof.fr= ame_rate_den, 'f', 2); } - if (fps !=3D rate) + if (fps !=3D rate) { continue; - QString res =3D QString("%1x%2").arg(prof.width).arg(prof.height); - if (res !=3D size) + } + QString res =3D QStringLiteral("%1x%2").arg(prof.width).arg(prof.= height); + if (res !=3D size) { continue; - if (prof.progressive) + } + if (prof.progressive) { allowProgressive =3D true; - else + } else { allowInterlaced =3D true; + } } - m_interlaced->setChecked(!m_currentProfile.progressive); m_interlaced->setEnabled(allowInterlaced && allowProgressive); + if (m_interlaced->isEnabled()) { + m_interlaced->setChecked(!m_currentProfile.progressive); + } else { + m_interlaced->setChecked(allowInterlaced); + } } = -ProfileWidget::VIDEOSTD ProfileWidget::getStandard(MltVideoProfile profil= e) +ProfileWidget::VIDEOSTD ProfileWidget::getStandard(const MltVideoProfile = &profile) { - switch(profile.height) { - case 2160: - return Std4K; - break; - case 1440: - return Std2K; - break; - case 1080: - if (profile.width !=3D 1920) - return StdCustom; - else = - return StdFHD; - break; - case 720: - return StdHD; - break; - case 576: - case 480: - if (profile.width !=3D 720) - return StdCustom; - else if (profile.display_aspect_num =3D=3D 4) - return StdSD; - else if (profile.display_aspect_num =3D=3D 16) - return StdSDWide; - else - return StdCustom; - break; - default: + switch (profile.height) { + case 2160: + return Std4K; + break; + case 1440: + return Std2K; + break; + case 1080: + if (profile.width !=3D 1920) { return StdCustom; - break; + } else { + return StdFHD; + } + break; + case 720: + return StdHD; + break; + case 576: + case 480: + if (profile.width !=3D 720) { + return StdCustom; + } else if (profile.display_aspect_num =3D=3D 4) { + return StdSD; + } else if (profile.display_aspect_num =3D=3D 16) { + return StdSDWide; + } else { + return StdCustom; + } + break; + default: + return StdCustom; + break; } } =20