Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
395445be
Commit
395445be
authored
May 04, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix transcoding crashes caused by old code
parent
87d9a5a2
Pipeline
#3080
passed with stage
in 16 minutes and 16 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
395445be
...
...
@@ -899,32 +899,6 @@ Monitor *Bin::monitor()
return
m_monitor
;
}
const
QStringList
Bin
::
getFolderInfo
(
const
QModelIndex
&
selectedIx
)
{
QModelIndexList
indexes
;
if
(
selectedIx
.
isValid
())
{
indexes
<<
selectedIx
;
}
else
{
indexes
=
m_proxyModel
->
selectionModel
()
->
selectedIndexes
();
}
if
(
indexes
.
isEmpty
())
{
// return root folder info
QStringList
folderInfo
;
folderInfo
<<
QString
::
number
(
-
1
);
folderInfo
<<
QString
();
return
folderInfo
;
}
QModelIndex
ix
=
indexes
.
constFirst
();
if
(
ix
.
isValid
()
&&
(
m_proxyModel
->
selectionModel
()
->
isSelected
(
ix
)
||
selectedIx
.
isValid
()))
{
return
m_itemModel
->
getEnclosingFolderInfo
(
m_proxyModel
->
mapToSource
(
ix
));
}
// return root folder info
QStringList
folderInfo
;
folderInfo
<<
QString
::
number
(
-
1
);
folderInfo
<<
QString
();
return
folderInfo
;
}
void
Bin
::
slotAddClip
()
{
// Check if we are in a folder
...
...
@@ -2055,7 +2029,6 @@ void Bin::slotCreateProjectClip()
return
;
}
ClipType
::
ProducerType
type
=
(
ClipType
::
ProducerType
)
act
->
data
().
toInt
();
QStringList
folderInfo
=
getFolderInfo
();
QString
parentFolder
=
getCurrentFolder
();
switch
(
type
)
{
case
ClipType
::
Color
:
...
...
@@ -2231,14 +2204,18 @@ void Bin::doMoveFolder(const QString &id, const QString &newParentId)
currentItem
->
changeParent
(
newParent
);
}
void
Bin
::
droppedUrls
(
const
QList
<
QUrl
>
&
urls
,
const
QString
List
&
folderInfo
)
void
Bin
::
droppedUrls
(
const
QList
<
QUrl
>
&
urls
,
const
QString
&
folderInfo
)
{
QModelIndex
current
;
if
(
folderInfo
.
isEmpty
())
{
current
=
m_proxyModel
->
mapToSource
(
m_proxyModel
->
selectionModel
()
->
currentIndex
());
}
else
{
// get index for folder
current
=
getIndexForId
(
folderInfo
.
constFirst
(),
true
);
std
::
shared_ptr
<
ProjectFolder
>
folder
=
m_itemModel
->
getFolderByBinId
(
folderInfo
);
if
(
!
folder
)
{
folder
=
m_itemModel
->
getRootFolder
();
}
current
=
m_itemModel
->
getIndexFromItem
(
folder
);
}
slotItemDropped
(
urls
,
current
);
}
...
...
src/bin/bin.h
View file @
395445be
...
...
@@ -258,8 +258,6 @@ public:
void
rebuildProxies
();
/** @brief Return a list of all clips hashes used in this project */
QStringList
getProxyHashList
();
/** @brief Get info (id, name) of a folder (or the currently selected one) */
const
QStringList
getFolderInfo
(
const
QModelIndex
&
selectedIx
=
QModelIndex
());
/** @brief Get binId of the current selected folder */
QString
getCurrentFolder
();
/** @brief Save a clip zone as MLT playlist */
...
...
@@ -356,7 +354,7 @@ public slots:
/** @brief Select a clip in the Bin from its id. */
void
selectClipById
(
const
QString
&
id
,
int
frame
=
-
1
,
const
QPoint
&
zone
=
QPoint
());
void
slotAddClipToProject
(
const
QUrl
&
url
);
void
droppedUrls
(
const
QList
<
QUrl
>
&
urls
,
const
QString
List
&
folderInfo
=
QString
List
());
void
droppedUrls
(
const
QList
<
QUrl
>
&
urls
,
const
QString
&
folderInfo
=
QString
());
/** @brief Returns the effectstack of a given clip. */
std
::
shared_ptr
<
EffectStackModel
>
getClipEffectStack
(
int
itemId
);
/** @brief Returns the duration of a given clip. */
...
...
src/mainwindow.cpp
View file @
395445be
...
...
@@ -2543,7 +2543,7 @@ void MainWindow::slotEditItemDuration()
*/
}
void
MainWindow
::
slotAddProjectClip
(
const
QUrl
&
url
,
const
QString
List
&
folderInfo
)
void
MainWindow
::
slotAddProjectClip
(
const
QUrl
&
url
,
const
QString
&
folderInfo
)
{
pCore
->
bin
()
->
droppedUrls
(
QList
<
QUrl
>
()
<<
url
,
folderInfo
);
}
...
...
@@ -3180,8 +3180,7 @@ void MainWindow::slotTranscode(const QStringList &urls)
Q_ASSERT
(
!
urls
.
isEmpty
());
QString
params
;
QString
desc
;
qCDebug
(
KDENLIVE_LOG
)
<<
"// TRANSODING FOLDER: "
<<
pCore
->
bin
()
->
getFolderInfo
();
ClipTranscode
*
d
=
new
ClipTranscode
(
urls
,
params
,
QStringList
(),
desc
,
pCore
->
bin
()
->
getFolderInfo
());
ClipTranscode
*
d
=
new
ClipTranscode
(
urls
,
params
,
QStringList
(),
desc
,
pCore
->
bin
()
->
getCurrentFolder
());
connect
(
d
,
&
ClipTranscode
::
addClip
,
this
,
&
MainWindow
::
slotAddProjectClip
);
d
->
show
();
}
...
...
src/mainwindow.h
View file @
395445be
...
...
@@ -346,7 +346,7 @@ private slots:
void
slotSelectAddTimelineTransition
();
void
slotAddEffect
(
QAction
*
result
);
void
slotAddTransition
(
QAction
*
result
);
void
slotAddProjectClip
(
const
QUrl
&
url
,
const
QString
List
&
folderInfo
);
void
slotAddProjectClip
(
const
QUrl
&
url
,
const
QString
&
folderInfo
);
void
slotAddProjectClipList
(
const
QList
<
QUrl
>
&
urls
);
void
slotChangeTool
(
QAction
*
action
);
void
slotChangeEdit
(
QAction
*
action
);
...
...
src/monitor/monitor.cpp
View file @
395445be
...
...
@@ -1076,7 +1076,7 @@ void Monitor::slotExtractCurrentFrame(QString frameName, bool addToProject)
KRecentDirs
::
add
(
QStringLiteral
(
":KdenliveFramesFolder"
),
QUrl
::
fromLocalFile
(
selectedFile
).
adjusted
(
QUrl
::
RemoveFilename
).
toLocalFile
());
if
(
addToProject
)
{
QString
List
folderInfo
=
pCore
->
bin
()
->
getFolder
Info
();
QString
folderInfo
=
pCore
->
bin
()
->
get
Current
Folder
();
pCore
->
bin
()
->
droppedUrls
(
QList
<
QUrl
>
()
<<
QUrl
::
fromLocalFile
(
selectedFile
),
folderInfo
);
}
}
...
...
src/project/cliptranscode.cpp
View file @
395445be
...
...
@@ -27,7 +27,7 @@
#include <KMessageBox>
#include <klocalizedstring.h>
ClipTranscode
::
ClipTranscode
(
QStringList
urls
,
const
QString
&
params
,
QStringList
postParams
,
const
QString
&
description
,
QString
List
folderInfo
,
ClipTranscode
::
ClipTranscode
(
QStringList
urls
,
const
QString
&
params
,
QStringList
postParams
,
const
QString
&
description
,
QString
folderInfo
,
bool
automaticMode
,
QWidget
*
parent
)
:
QDialog
(
parent
)
,
m_urls
(
std
::
move
(
urls
))
...
...
src/project/cliptranscode.h
View file @
395445be
...
...
@@ -32,7 +32,7 @@ class ClipTranscode : public QDialog, public Ui::ClipTranscode_UI
Q_OBJECT
public:
ClipTranscode
(
QStringList
urls
,
const
QString
&
params
,
QStringList
postParams
,
const
QString
&
description
,
QString
List
folderInfo
=
QString
List
(),
ClipTranscode
(
QStringList
urls
,
const
QString
&
params
,
QStringList
postParams
,
const
QString
&
description
,
QString
folderInfo
=
QString
(),
bool
automaticMode
=
false
,
QWidget
*
parent
=
nullptr
);
~
ClipTranscode
()
override
;
...
...
@@ -47,7 +47,7 @@ private slots:
private:
QProcess
m_transcodeProcess
;
QStringList
m_urls
;
QString
List
m_folderInfo
;
QString
m_folderInfo
;
int
m_duration
;
bool
m_automaticMode
;
/** @brief The path for destination transcoded file. */
...
...
@@ -56,7 +56,7 @@ private:
KMessageWidget
*
m_infoMessage
;
signals:
void
addClip
(
const
QUrl
&
url
,
const
QString
List
&
folderInfo
=
QString
List
());
void
addClip
(
const
QUrl
&
url
,
const
QString
&
folderInfo
=
QString
());
void
transcodedClip
(
const
QUrl
&
source
,
const
QUrl
&
result
);
};
...
...
src/utils/resourcewidget.cpp
View file @
395445be
...
...
@@ -498,7 +498,7 @@ void ResourceWidget::slotGotFile(KJob *job)
const
QUrl
filePath
=
copyJob
->
destUrl
();
KMessageBox
::
information
(
this
,
i18n
(
"Resource saved to %1"
,
filePath
.
toLocalFile
()),
i18n
(
"Data Imported"
));
emit
addClip
(
filePath
,
QString
List
());
emit
addClip
(
filePath
,
QString
());
}
/**
...
...
@@ -835,7 +835,7 @@ void ResourceWidget::DownloadRequestFinished(QNetworkReply *reply)
file
.
close
();
KMessageBox
::
information
(
this
,
i18n
(
"Resource saved to %1"
,
m_saveLocation
),
i18n
(
"Data Imported"
));
emit
addClip
(
QUrl
(
m_saveLocation
),
QString
List
());
// MainWindow::slotDownloadResources() links this signal to MainWindow::slotAddProjectClip
emit
addClip
(
QUrl
(
m_saveLocation
),
QString
());
// MainWindow::slotDownloadResources() links this signal to MainWindow::slotAddProjectClip
m_desc
.
append
(
QStringLiteral
(
"<br>"
)
+
i18n
(
"Saved file to"
)
+
QStringLiteral
(
"<br>"
));
m_desc
.
append
(
m_saveLocation
);
...
...
src/utils/resourcewidget.h
View file @
395445be
...
...
@@ -110,7 +110,7 @@ private:
void
DoFileDownload
(
const
QUrl
&
srcUrl
,
const
QUrl
&
saveUrl
);
signals:
void
addClip
(
const
QUrl
&
,
const
QString
List
&
);
void
addClip
(
const
QUrl
&
,
const
QString
&
);
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment