[vlmc-devel] Fix build with Qt5

Hugo Beauzée-Luyssen git at videolan.org
Sun Feb 2 13:51:07 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Dec 26 00:39:41 2013 +0100| [6395f650c97528079827daec7ed2a9c8d7f5f735] | committer: Hugo Beauzée-Luyssen

Fix build with Qt5

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=6395f650c97528079827daec7ed2a9c8d7f5f735
---

 src/EffectsEngine/EffectsEngine.cpp       |    6 +++---
 src/Gui/effectsengine/EffectsListView.cpp |    2 ++
 src/Gui/import/ImportController.cpp       |    2 +-
 src/Gui/library/MediaCellView.cpp         |    4 +++-
 src/Gui/library/MediaLibrary.cpp          |    1 +
 src/Gui/preview/LCDTimecode.cpp           |    2 +-
 src/Gui/timeline/Timeline.cpp             |    2 +-
 src/Gui/timeline/TracksView.cpp           |    1 +
 src/Gui/widgets/TrackControls.h           |    2 +-
 src/Library/Library.cpp                   |    3 +--
 src/Media/Clip.cpp                        |    4 ++--
 src/Renderer/WorkflowRenderer.cpp         |    2 +-
 src/Services/YouTube/YouTubeUploader.cpp  |    2 +-
 src/Workflow/ClipWorkflow.h               |    1 +
 14 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index f4dd6e2..5555531 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -27,7 +27,7 @@
 #include "Types.h"
 
 #include <QApplication>
-#include <QDesktopServices>
+#include <QStandardPaths>
 #include <QDir>
 #include <QProcess>
 #include <QSettings>
@@ -41,8 +41,8 @@
 
 EffectsEngine::EffectsEngine()
 {
-    m_cache = new QSettings( QDesktopServices::storageLocation(
-                    QDesktopServices::CacheLocation ) + "/effects",
+    m_cache = new QSettings( QStandardPaths::writableLocation(
+                    QStandardPaths::CacheLocation ) + "/effects",
                              QSettings::IniFormat, this );
     //Create the names entry. A bit ugly but faster (I guess...) afterward.
     m_names.push_back( QStringList() );
diff --git a/src/Gui/effectsengine/EffectsListView.cpp b/src/Gui/effectsengine/EffectsListView.cpp
index 59954ae..377448e 100644
--- a/src/Gui/effectsengine/EffectsListView.cpp
+++ b/src/Gui/effectsengine/EffectsListView.cpp
@@ -29,6 +29,8 @@
 #include <QMouseEvent>
 #include <QStandardItem>
 #include <QVBoxLayout>
+#include <QMimeData>
+#include <QDrag>
 
 #include <QtDebug>
 
diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 20b2b82..ea6b62d 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -79,7 +79,7 @@ ImportController::ImportController(QWidget *parent) :
     m_ui->treeView->setCurrentIndex( m_filesModel->index( m_currentlyWatchedDir ) );
     m_ui->treeView->setExpanded( m_ui->treeView->currentIndex() , true );
     m_ui->treeView->header()->setStretchLastSection( false );
-    m_ui->treeView->header()->setResizeMode( QHeaderView::ResizeToContents );
+    m_ui->treeView->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
     m_ui->treeView->setColumnHidden( 1, true );
     m_ui->treeView->setColumnHidden( 2, true );
     m_ui->treeView->setColumnHidden( 3, true );
diff --git a/src/Gui/library/MediaCellView.cpp b/src/Gui/library/MediaCellView.cpp
index 8367f76..7a2f7a7 100644
--- a/src/Gui/library/MediaCellView.cpp
+++ b/src/Gui/library/MediaCellView.cpp
@@ -35,6 +35,8 @@
 #include <QMenu>
 #include <QMessageBox>
 #include <QTime>
+#include <QMimeData>
+#include <QDrag>
 
 MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
         QWidget( parent ),
@@ -213,7 +215,7 @@ MediaCellView::mouseMoveEvent( QMouseEvent* event )
         return;
 
     QMimeData* mimeData = new QMimeData;
-    mimeData->setData( "vlmc/uuid", m_clip->fullId().toAscii() );
+    mimeData->setData( "vlmc/uuid", m_clip->fullId().toLatin1() );
     QDrag* drag = new QDrag( this );
     drag->setMimeData( mimeData );
     const Media*  parent = m_clip->getMedia();
diff --git a/src/Gui/library/MediaLibrary.cpp b/src/Gui/library/MediaLibrary.cpp
index a327f75..32224a7 100644
--- a/src/Gui/library/MediaLibrary.cpp
+++ b/src/Gui/library/MediaLibrary.cpp
@@ -32,6 +32,7 @@
 
 #include <QDebug>
 #include <QUrl>
+#include <QMimeData>
 
 MediaLibrary::MediaLibrary(QWidget *parent) : QWidget(parent),
     m_ui( new Ui::MediaLibrary() )
diff --git a/src/Gui/preview/LCDTimecode.cpp b/src/Gui/preview/LCDTimecode.cpp
index 8c85add..3f9ba47 100644
--- a/src/Gui/preview/LCDTimecode.cpp
+++ b/src/Gui/preview/LCDTimecode.cpp
@@ -26,7 +26,7 @@
 LCDTimecode::LCDTimecode( QWidget* parent )
     : QLCDNumber( parent )
 {
-    setNumDigits( 11 );
+    setDigitCount( 11 );
     setTime( 0, 0, 0, 0 );
 }
 
diff --git a/src/Gui/timeline/Timeline.cpp b/src/Gui/timeline/Timeline.cpp
index 0edc5d4..8c262b3 100644
--- a/src/Gui/timeline/Timeline.cpp
+++ b/src/Gui/timeline/Timeline.cpp
@@ -178,7 +178,7 @@ Timeline::save( QXmlStreamWriter &project ) const
         {
             project.writeStartElement( "linkedTo" );
                 project.writeStartElement( "item" );
-                    project.writeAttribute( "uuid", item->groupItem()->uuid() );
+                    project.writeAttribute( "uuid", item->groupItem()->uuid().toString() );
                 project.writeEndElement();
             project.writeEndElement();
         }
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index dcec9f6..edf7d67 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -48,6 +48,7 @@
 #include <QMouseEvent>
 #include <QScrollBar>
 #include <QWheelEvent>
+#include <QMimeData>
 
 #include <QtDebug>
 
diff --git a/src/Gui/widgets/TrackControls.h b/src/Gui/widgets/TrackControls.h
index 8f78b4f..6f3bc36 100644
--- a/src/Gui/widgets/TrackControls.h
+++ b/src/Gui/widgets/TrackControls.h
@@ -23,7 +23,7 @@
 #ifndef TRACKCONTROLS_H
 #define TRACKCONTROLS_H
 
-#include <QtGui/QWidget>
+#include <QWidget>
 
 class GraphicsTrack;
 
diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 1c89efc..2cfb796 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -114,8 +114,7 @@ Library::mediaLoaded( const Media* media )
         disconnect( media, SIGNAL( metaDataComputed( const Media* ) ),
                  this, SLOT( mediaLoaded( const Media* ) ) );
     }
-    m_nbMediaToLoad.fetchAndAddAcquire( -1 );
-    if ( m_nbMediaToLoad == 0 )
+    if (m_nbMediaToLoad.fetchAndAddAcquire( -1 ) == 1)
         emit projectLoaded();
 }
 
diff --git a/src/Media/Clip.cpp b/src/Media/Clip.cpp
index 8904ca4..9ca24b0 100644
--- a/src/Media/Clip.cpp
+++ b/src/Media/Clip.cpp
@@ -238,7 +238,7 @@ Clip::save( QXmlStreamWriter &project )
     }
     else
     {
-        project.writeAttribute( "parent", m_parent->uuid() );
+        project.writeAttribute( "parent", m_parent->uuid().toString() );
         project.writeAttribute( "begin", QString::number( m_begin ) );
         project.writeAttribute( "end", QString::number( m_end ) );
     }
@@ -262,7 +262,7 @@ Clip::fullId() const
     while ( c->isRootClip() == false )
     {
         c = c->getParent();
-        id = c->uuid() + '/' + id;
+        id = c->uuid().toString() + '/' + id;
     }
     return id;
 }
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 62461b8..c27e49c 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -101,7 +101,7 @@ WorkflowRenderer::setupRenderer( quint32 width, quint32 height, double fps )
     //Clean any previous render.
 
     sprintf( videoString, "width=%i:height=%i:dar=%s:fps=%f/1:cookie=0:codec=%s:cat=2:caching=0",
-             width, height, m_aspectRatio.toAscii().constData(), fps, "RV32" );
+             width, height, m_aspectRatio.toLatin1().constData(), fps, "RV32" );
     sprintf( audioParameters, "cookie=1:cat=1:codec=f32l:samplerate=%u:channels=%u:caching=0",
                 m_rate, m_nbChannels );
     strcpy( inputSlave, ":input-slave=imem://" );
diff --git a/src/Services/YouTube/YouTubeUploader.cpp b/src/Services/YouTube/YouTubeUploader.cpp
index 22539d9..5881858 100644
--- a/src/Services/YouTube/YouTubeUploader.cpp
+++ b/src/Services/YouTube/YouTubeUploader.cpp
@@ -67,7 +67,7 @@ void
 YouTubeUploader::uploadInit()
 {
     /* Random 10 digit boundary string, as per protocol */
-    m_boundary = QString( QString::number( qrand(), 10 ).toAscii() );
+    m_boundary = QString( QString::number( qrand(), 10 ).toLatin1() );
 
     QString privateToken = "";
 
diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index 66d957e..50d0c4d 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -32,6 +32,7 @@
 #include <QObject>
 #include <QUuid>
 #include <QXmlStreamWriter>
+#include <QAtomicInt>
 
 class   Clip;
 class   Effect;



More information about the Vlmc-devel mailing list