Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
261
Issues
261
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
059750ad
Commit
059750ad
authored
Jun 01, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure newly created folder is active so that added clips go in it.
parent
431e7174
Pipeline
#22030
passed with stage
in 13 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
src/bin/bin.cpp
src/bin/bin.cpp
+19
-2
src/bin/bin.h
src/bin/bin.h
+3
-0
src/bin/clipcreator.cpp
src/bin/clipcreator.cpp
+1
-1
No files found.
src/bin/bin.cpp
View file @
059750ad
...
...
@@ -613,6 +613,10 @@ bool MyTreeView::isEditing() const
void
MyTreeView
::
setEditing
(
bool
edit
)
{
setState
(
edit
?
QAbstractItemView
::
EditingState
:
QAbstractItemView
::
NoState
);
if
(
!
edit
)
{
// Ensure edited item is selected
emit
selectCurrent
();
}
}
bool
MyTreeView
::
performDrag
()
...
...
@@ -1742,15 +1746,16 @@ void Bin::slotAddFolder()
if
(
m_listType
==
BinTreeView
)
{
// Make sure parent folder is expanded
if
(
parentFolder
->
clipId
().
toInt
()
>
-
1
)
{
auto
i
x
=
m_itemModel
->
getIndexFromItem
(
parentFolder
);
auto
parentI
x
=
m_itemModel
->
getIndexFromItem
(
parentFolder
);
auto
*
view
=
static_cast
<
QTreeView
*>
(
m_itemView
);
view
->
expand
(
m_proxyModel
->
mapFromSource
(
i
x
));
view
->
expand
(
m_proxyModel
->
mapFromSource
(
parentI
x
));
}
}
// Edit folder name
auto
folder
=
m_itemModel
->
getFolderByBinId
(
newId
);
auto
ix
=
m_itemModel
->
getIndexFromItem
(
folder
);
// Scroll to ensure folder is visible
m_itemView
->
scrollTo
(
m_proxyModel
->
mapFromSource
(
ix
),
QAbstractItemView
::
PositionAtCenter
);
qDebug
()
<<
"selecting"
<<
ix
;
...
...
@@ -1768,6 +1773,17 @@ void Bin::slotAddFolder()
}
}
void
Bin
::
ensureCurrent
()
{
const
QModelIndexList
indexes
=
m_proxyModel
->
selectionModel
()
->
selectedRows
(
0
);
for
(
const
QModelIndex
&
ix
:
indexes
)
{
if
(
!
ix
.
isValid
())
{
continue
;
}
m_itemView
->
setCurrentIndex
(
ix
);
}
}
QModelIndex
Bin
::
getIndexForId
(
const
QString
&
id
,
bool
folderWanted
)
const
{
QModelIndexList
items
=
m_itemModel
->
match
(
m_itemModel
->
index
(
0
,
0
),
AbstractProjectItem
::
DataId
,
QVariant
::
fromValue
(
id
),
1
,
Qt
::
MatchRecursive
);
...
...
@@ -2027,6 +2043,7 @@ void Bin::slotInitView(QAction *action)
view
->
setWordWrap
(
true
);
connect
(
view
,
&
MyTreeView
::
updateDragMode
,
m_itemModel
.
get
(),
&
ProjectItemModel
::
setDragType
,
Qt
::
DirectConnection
);
connect
(
view
,
&
MyTreeView
::
processDragEnd
,
this
,
&
Bin
::
processDragEnd
);
connect
(
view
,
&
MyTreeView
::
selectCurrent
,
this
,
&
Bin
::
ensureCurrent
);
connect
(
view
,
&
MyTreeView
::
displayBinFrame
,
this
,
&
Bin
::
showBinFrame
);
if
(
!
m_headerInfo
.
isEmpty
())
{
view
->
header
()
->
restoreState
(
m_headerInfo
);
...
...
src/bin/bin.h
View file @
059750ad
...
...
@@ -117,6 +117,7 @@ signals:
void
updateDragMode
(
PlaylistState
::
ClipState
type
);
void
displayBinFrame
(
QModelIndex
ix
,
int
frame
);
void
processDragEnd
();
void
selectCurrent
();
};
class
SmallJobLabel
:
public
QPushButton
...
...
@@ -292,6 +293,8 @@ private slots:
void
slotSetSorting
();
/** @brief Show/hide date column */
void
slotShowColumn
(
bool
show
);
/** @brief Ensure current item is selected */
void
ensureCurrent
();
/** @brief Go to parent folder */
void
slotBack
();
/** @brief Setup the bin view type (icon view, tree view, ...).
...
...
src/bin/clipcreator.cpp
View file @
059750ad
...
...
@@ -138,7 +138,7 @@ QDomDocument ClipCreator::getXmlFromUrl(const QString &path)
QString
ClipCreator
::
createClipFromFile
(
const
QString
&
path
,
const
QString
&
parentFolder
,
const
std
::
shared_ptr
<
ProjectItemModel
>
&
model
,
Fun
&
undo
,
Fun
&
redo
,
const
std
::
function
<
void
(
const
QString
&
)
>
&
readyCallBack
)
{
qDebug
()
<<
"/////////// createClipFromFile"
<<
path
<<
parentFolder
<<
path
;
qDebug
()
<<
"/////////// createClipFromFile"
<<
path
<<
parentFolder
;
QDomDocument
xml
=
getXmlFromUrl
(
path
);
if
(
xml
.
isNull
())
{
return
QStringLiteral
(
"-1"
);
...
...
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