From: Steinar H. Gunderson Date: Wed, 26 Sep 2018 17:01:23 +0000 (+0200) Subject: Fix some instances of unneeded dataChanged() signals, making it impossible to edit... X-Git-Tag: 1.8.0~76^2~91 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c4b876d817b340482df70a6e691173bbd7ff1657;p=nageru Fix some instances of unneeded dataChanged() signals, making it impossible to edit camera angles when playing. --- diff --git a/clip_list.h b/clip_list.h index 126d1d5..db3a479 100644 --- a/clip_list.h +++ b/clip_list.h @@ -68,10 +68,10 @@ public: size_t size() const { return clips.size(); } bool empty() const { return clips.empty(); } - ClipProxy clip(size_t index) { return ClipProxy(clips[index], this, index); } + ClipProxy mutable_clip(size_t index) { return ClipProxy(clips[index], this, index); } const Clip *clip(size_t index) const { return &clips[index]; } - ClipProxy back() { return clip(size() - 1); } + ClipProxy mutable_back() { return mutable_clip(size() - 1); } const Clip *back() const { return clip(size() - 1); } void emit_data_changed(size_t row) override; @@ -114,10 +114,10 @@ public: size_t size() const { return clips.size(); } bool empty() const { return clips.empty(); } - ClipProxy clip(size_t index) { return ClipProxy(clips[index], this, index); } + ClipProxy mutable_clip(size_t index) { return ClipProxy(clips[index], this, index); } const Clip *clip(size_t index) const { return &clips[index]; } - ClipProxy back() { return clip(size() - 1); } + ClipProxy mutable_back() { return mutable_clip(size() - 1); } const Clip *back() const { return clip(size() - 1); } void set_currently_playing(int index); // -1 = none. diff --git a/mainwindow.cpp b/mainwindow.cpp index 8377c74..d635384 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -118,7 +118,7 @@ MainWindow::MainWindow() void MainWindow::cue_in_clicked() { if (!cliplist_clips->empty() && cliplist_clips->back()->pts_out < 0) { - cliplist_clips->back()->pts_in = current_pts; + cliplist_clips->mutable_back()->pts_in = current_pts; return; } Clip clip; @@ -130,7 +130,7 @@ void MainWindow::cue_in_clicked() void MainWindow::cue_out_clicked() { if (!cliplist_clips->empty()) { - cliplist_clips->back()->pts_out = current_pts; + cliplist_clips->mutable_back()->pts_out = current_pts; // TODO: select the row in the clip list? } } @@ -388,7 +388,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) int64_t pts = scrub_pts_origin + adjusted_offset * scrub_sensitivity; if (scrub_type == SCRUBBING_CLIP_LIST) { - ClipProxy clip = cliplist_clips->clip(scrub_row); + ClipProxy clip = cliplist_clips->mutable_clip(scrub_row); if (scrub_column == int(ClipList::Column::IN)) { pts = std::max(pts, 0); pts = std::min(pts, clip->pts_out); @@ -401,7 +401,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) preview_single_frame(pts, stream_idx, LAST_BEFORE); } } else { - ClipProxy clip = playlist_clips->clip(scrub_row); + ClipProxy clip = playlist_clips->mutable_clip(scrub_row); if (scrub_column == int(PlayList::Column::IN)) { pts = std::max(pts, 0); pts = std::min(pts, clip->pts_out); @@ -442,7 +442,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) if (column == -1 || row == -1) return false; ClipProxy clip = (watched == ui->clip_list->viewport()) ? - cliplist_clips->clip(row) : playlist_clips->clip(row); + cliplist_clips->mutable_clip(row) : playlist_clips->mutable_clip(row); if (watched == ui->playlist->viewport()) { stream_idx = clip->stream_idx; }