Skip to content

Commit 9fcc452

Browse files
committed
make refresh Not In Timeline smart bin more efficient
1 parent f822512 commit 9fcc452

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/docks/filesdock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ FilesDock::FilesDock(QWidget *parent)
570570
ui->treeView->setExpanded(homeIndex, true);
571571
ui->treeView->scrollTo(homeIndex);
572572
ui->treeView->setCurrentIndex(homeIndex);
573-
QTimer::singleShot(0, this, [=](){
573+
QTimer::singleShot(0, this, [ = ]() {
574574
ui->treeView->setVisible(Settings.filesFoldersOpen());
575575
});
576576
connect(ui->treeView, &QWidget::customContextMenuRequested, this, [ = ](const QPoint & pos) {

src/docks/playlistdock.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,8 +1755,7 @@ void PlaylistDock::onPlaylistCleared()
17551755
void PlaylistDock::refreshTimelineSmartBins()
17561756
{
17571757
auto items = ui->treeWidget->selectedItems();
1758-
if (!items.isEmpty() && SmartBinNotInTimeline == items.first()->data(0, Qt::UserRole).toInt()
1759-
&& m_proxyModel->rowCount() > 0) {
1758+
if (!items.isEmpty() && SmartBinNotInTimeline == items.first()->data(0, Qt::UserRole).toInt()) {
17601759
m_proxyModel->setSmartBin(SmartBinNotInTimeline);
17611760
}
17621761
}

src/mainwindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,9 @@ void MainWindow::setupAndConnectDocks()
485485
connect(m_timelineDock->model(), SIGNAL(created()), SLOT(onMultitrackCreated()));
486486
connect(m_timelineDock->model(), SIGNAL(closed()), SLOT(onMultitrackClosed()));
487487
connect(m_timelineDock->model(), SIGNAL(modified()), SLOT(onMultitrackModified()));
488-
connect(m_timelineDock->model(), &MultitrackModel::modified, m_playlistDock,
488+
connect(m_timelineDock->model(), &QAbstractItemModel::rowsInserted, m_playlistDock,
489+
&PlaylistDock::refreshTimelineSmartBins);
490+
connect(m_timelineDock->model(), &QAbstractItemModel::rowsRemoved, m_playlistDock,
489491
&PlaylistDock::refreshTimelineSmartBins);
490492
connect(m_timelineDock->model(), SIGNAL(durationChanged()), SLOT(onMultitrackDurationChanged()));
491493
connect(m_timelineDock, SIGNAL(clipOpened(Mlt::Producer *)), SLOT(openCut(Mlt::Producer *)));

0 commit comments

Comments
 (0)