Fix crash on Show Description with Bin tree in IconView

BUG: 351710
parent b250dc04
......@@ -1023,6 +1023,8 @@ void Bin::slotInitView(QAction *action)
// save current treeview state (column width)
QTreeView *view = static_cast<QTreeView*>(m_itemView);
m_headerInfo = view->header()->saveState();
m_showDate->setEnabled(true);
m_showDesc->setEnabled(true);
}
else {
// remove the current folderUp item if any
......@@ -1039,13 +1041,17 @@ void Bin::slotInitView(QAction *action)
}
switch (m_listType) {
case BinIconView:
m_itemView = new QListView(m_splitter);
m_folderUp = new ProjectFolderUp(NULL);
break;
default:
m_itemView = new QTreeView(m_splitter);
break;
case BinIconView:
m_itemView = new QListView(m_splitter);
m_folderUp = new ProjectFolderUp(NULL);
m_showDate->setEnabled(false);
m_showDesc->setEnabled(false);
break;
default:
m_itemView = new MyTreeView(m_splitter);
m_showDate->setEnabled(true);
m_showDesc->setEnabled(true);
break;
}
m_itemView->setMouseTracking(true);
m_itemView->viewport()->installEventFilter(m_eventEater);
......@@ -1415,8 +1421,9 @@ void Bin::slotProducerReady(requestClipInfo info, ClipController *controller)
if (!ix.isValid() || ix.column() != 0) {
continue;
}
ProjectClip *currentItem = static_cast<ProjectClip *>(m_proxyModel->mapToSource(ix).internalPointer());
if (currentItem->clipId() == info.clipId) {
AbstractProjectItem *item = static_cast<AbstractProjectItem*>(m_proxyModel->mapToSource(ix).internalPointer());
ProjectClip *currentItem = qobject_cast<ProjectClip*>(item);
if (currentItem && currentItem->clipId() == info.clipId) {
// Item was selected, show it in monitor
currentItem->setCurrent(true);
break;
......@@ -2395,7 +2402,7 @@ void Bin::slotAbortAudioThumb(const QString &id)
void Bin::slotSetSorting()
{
QTreeView *view = static_cast<QTreeView*>(m_itemView);
QTreeView *view = qobject_cast<QTreeView*>(m_itemView);
if (view) {
int ix = view->header()->sortIndicatorSection();
m_proxyModel->setFilterKeyColumn(ix);
......@@ -2404,7 +2411,7 @@ void Bin::slotSetSorting()
void Bin::slotShowDateColumn(bool show)
{
QTreeView *view = static_cast<QTreeView*>(m_itemView);
QTreeView *view = qobject_cast<QTreeView*>(m_itemView);
if (view) {
view->setColumnHidden(1, !show);
}
......@@ -2412,7 +2419,7 @@ void Bin::slotShowDateColumn(bool show)
void Bin::slotShowDescColumn(bool show)
{
QTreeView *view = static_cast<QTreeView*>(m_itemView);
QTreeView *view = qobject_cast<QTreeView*>(m_itemView);
if (view) {
view->setColumnHidden(2, !show);
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>317</width>
<height>483</height>
<width>362</width>
<height>633</height>
</rect>
</property>
<property name="windowTitle">
......@@ -35,7 +35,7 @@
<widget class="KUrlRequester" name="dest_url"/>
</item>
<item row="5" column="0" colspan="3">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="ffmpeg_label">
<property name="text">
<string>FFmpeg parameters</string>
</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment