[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive] src: Merge branch '16.12'
From:       Jean-Baptiste Mardelle <null () kde ! org>
Date:       2017-01-03 15:35:35
Message-ID: E1cOR7f-0000pa-51 () code ! kde ! org
[Download RAW message or body]

Git commit 066663aa3816adb45154f8b5aedcefebc3eac64d by Jean-Baptiste Mardelle.
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 = false;
      // check folders, remove child folders if there is any
 -    QList <ProjectFolder*> topFolders;
 +    QList<ProjectFolder *> topFolders;
      foreach (const QModelIndex &ix, indexes) {
 -        if (!ix.isValid() || ix.column() != 0) continue;
 -        AbstractProjectItem *item = \
                static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(ix).internalPointer());
                
 -	if (!item) continue;
 -	if (item->itemType() == AbstractProjectItem::SubClipItem) {
 -                QString subId = item->clipId();
 -                sub = static_cast<ProjectSubClip*>(item);
 -                zone = sub->zone();
 -                subId.append(":" + QString::number(zone.x()) + ":" + \
                QString::number(zone.y()));
 -                subClipIds << subId;
 -		continue;
 -	}
 -        if (item->itemType() != AbstractProjectItem::FolderItem) continue;
 -	ProjectFolder *current = static_cast<ProjectFolder*>(item);
 +        if (!ix.isValid() || ix.column() != 0) {
 +            continue;
 +        }
 +        AbstractProjectItem *item = static_cast<AbstractProjectItem \
*>(m_proxyModel->mapToSource(ix).internalPointer());  +        if (!item) {
 +            continue;
 +        }
 +        if (item->itemType() == AbstractProjectItem::SubClipItem) {
 +            QString subId = item->clipId();
 +            sub = static_cast<ProjectSubClip *>(item);
 +            zone = sub->zone();
 +            subId.append(":" + QString::number(zone.x()) + ":" + \
QString::number(zone.y()));  +            subClipIds << subId;
 +            continue;
 +        }
 +        if (item->itemType() != AbstractProjectItem::FolderItem) {
 +            continue;
 +        }
 +        ProjectFolder *current = static_cast<ProjectFolder *>(item);
+         if (!usedFolder && !current->isEmpty()) {
+             usedFolder = true;
+         }
 -	if (topFolders.isEmpty()) {
 -	    topFolders << current;
 -	    continue;
 -	}
 -	// parse all folders to check for children
 -	bool isChild = false;
 -	foreach (ProjectFolder *f, topFolders) {
 -	    if (f->folder(current->clipId())) {
 -		// Current is a child, no need to take it into account
 -		isChild = true;
 -		break;
 -	    }
 -	}
 -	if (isChild) continue;
 -	QList <ProjectFolder*> 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 = false;
 +        foreach (ProjectFolder *f, topFolders) {
 +            if (f->folder(current->clipId())) {
 +                // Current is a child, no need to take it into account
 +                isChild = true;
 +                break;
 +            }
 +        }
 +        if (isChild) {
 +            continue;
 +        }
 +        QList<ProjectFolder *> 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 = false;
 -    QList <ProjectFolder*> topClips;
 +    QList<ProjectFolder *> topClips;
      // Check if clips are in already selected folders
      foreach (const QModelIndex &ix, indexes) {
 -        if (!ix.isValid() || ix.column() != 0) continue;
 -        AbstractProjectItem *item = \
                static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(ix).internalPointer());
                
 -        if (!item || item->itemType() != AbstractProjectItem::ClipItem) continue;
 -	ProjectClip *current = static_cast<ProjectClip*>(item);
 -	bool isChild = false;
 -	foreach (const ProjectFolder *f, topFolders) {
 -	    if (current->hasParent(f->clipId())) {
 -		  isChild = true;
 -		  break;
 -	    }
 -	}
 -	if (!isChild) {
 +        if (!ix.isValid() || ix.column() != 0) {
 +            continue;
 +        }
 +        AbstractProjectItem *item = static_cast<AbstractProjectItem \
*>(m_proxyModel->mapToSource(ix).internalPointer());  +        if (!item || \
item->itemType() != AbstractProjectItem::ClipItem) {  +            continue;
 +        }
 +        ProjectClip *current = static_cast<ProjectClip *>(item);
 +        bool isChild = false;
 +        foreach (const ProjectFolder *f, topFolders) {
 +            if (current->hasParent(f->clipId())) {
 +                isChild = true;
 +                break;
 +            }
 +        }
 +        if (!isChild) {
+             if (!usedClips && current->refCount() > 0) {
+                 usedClips = 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::ReadWrite)) {
              // 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->fileName();
-         QDomDocument sceneList = \
xmlSceneList(m_render->sceneList(m_url.adjusted(QUrl::RemoveFilename).path())); +     \
QDomDocument sceneList = \
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 = QUrl::fromLocalFile(dest + QStringLiteral("/titles/") \
+ oldUrl.fileName());  KIO::Job *job = KIO::copy(oldUrl, newUrl);
 -                if (job->exec()) clip->setProperty(QStringLiteral("resource"), \
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 color \
theming, so avoid it  QStringList availableStyles = QStyleFactory::keys();
      QString desktopStyle = QApplication::style()->objectName();
-     if (QString::compare(desktopStyle, QLatin1String("GTK+"), Qt::CaseInsensitive) \
                == 0 && KdenliveSettings::widgetstyle().isEmpty()) {
-         if (availableStyles.contains(QStringLiteral("breeze"), \
                Qt::CaseInsensitive)) {
-             // 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("windowsvista") << QStringLiteral("windowsxp"); +         if \
                (incompatibleStyles.contains(desktopStyle, Qt::CaseInsensitive)) {
 -            if (availableStyles.contains(QLatin1String("breeze"), \
Qt::CaseInsensitive)) { ++            if \
(availableStyles.contains(QStringLiteral("breeze"), Qt::CaseInsensitive)) { +         \
// 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 = QString::number((double)prof.frame_rate_num / \
prof.frame_rate_den, 'f', 2);  }
 -        if (fps != rate)
 +        if (fps != rate) {
              continue;
 -        QString res = QString("%1x%2").arg(prof.width).arg(prof.height);
 -        if (res != size)
 +        }
 +        QString res = QStringLiteral("%1x%2").arg(prof.width).arg(prof.height);
 +        if (res != size) {
              continue;
 -        if (prof.progressive)
 +        }
 +        if (prof.progressive) {
              allowProgressive = true;
 -        else
 +        } else {
              allowInterlaced = 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 profile)
 +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 != 1920)
 -                return StdCustom;
 -            else 
 -                return StdFHD;
 -            break;
 -        case 720:
 -            return StdHD;
 -            break;
 -        case 576:
 -        case 480:
 -            if (profile.width != 720)
 -                return StdCustom;
 -            else if (profile.display_aspect_num == 4)
 -                return StdSD;
 -            else if (profile.display_aspect_num == 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 != 1920) {
              return StdCustom;
 -            break;
 +        } else {
 +            return StdFHD;
 +        }
 +        break;
 +    case 720:
 +        return StdHD;
 +        break;
 +    case 576:
 +    case 480:
 +        if (profile.width != 720) {
 +            return StdCustom;
 +        } else if (profile.display_aspect_num == 4) {
 +            return StdSD;
 +        } else if (profile.display_aspect_num == 16) {
 +            return StdSDWide;
 +        } else {
 +            return StdCustom;
 +        }
 +        break;
 +    default:
 +        return StdCustom;
 +        break;
      }
  }
  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic