• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ossia / score / 41569965004

03 Nov 2026 03:04AM UTC coverage: 53.588% (+1.9%) from 51.66%
41569965004

push

github

jcelerier
ci: build the documentation on Ubuntu 24.04, which its deps script targets

ubuntu-latest is now 26.04, where ubuntu.noble.deps.sh's Qt package names
(libqt6websockets6-dev and the like) no longer exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KdPguhTJiZUHjuouE7tkj5

197270 of 368126 relevant lines covered (53.59%)

304198.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.79
/src/plugins/score-plugin-library/Library/ProcessTreeView.cpp
1
#include "ProcessTreeView.hpp"
2

3

4
#include <score/widgets/Pixmap.hpp>
5
#if defined(__EMSCRIPTEN__)
6
#include <score/widgets/ItemViewDrag.hpp>
7

8
#include <QStyleOptionViewItem>
9
#endif
10

11
#include <QDrag>
12
#include <QGuiApplication>
13
#include <QMimeData>
14
#include <QMouseEvent>
15
#include <QSortFilterProxyModel>
16

17
#include <wobjectimpl.h>
18

19
W_OBJECT_IMPL(Library::ProcessTreeView)
127,191 ✔
20
namespace Library
21
{
22
Library::ProcessData* ProcessTreeView::dataFromViewIndex(QModelIndex idx)
12 ✔
23
{
24
  SCORE_ASSERT(idx.isValid());
12 ✔
25
  auto proxy = (QSortFilterProxyModel*)this->model();
12 ✔
26
  auto model_idx = proxy->mapToSource(idx);
12 ✔
27
  auto data = reinterpret_cast<TreeNode<ProcessData>*>(model_idx.internalPointer());
12 ✔
28
  return data;
12 ✔
29
}
30

31
void ProcessTreeView::reselect()
×
32
{
33
  if(auto* sm = selectionModel(); sm && !sm->selectedIndexes().isEmpty())
×
34
  {
35
    if(auto* data = dataFromViewIndex(sm->selectedIndexes().front()))
×
36
    {
37
      selected(*data);
×
38
      return;
×
39
    }
40
  }
×
41
  selected({});
×
42
}
×
43

44
void ProcessTreeView::selectionChanged(
2,995 ✔
45
    const QItemSelection& sel, const QItemSelection& desel)
46
{
47
  setDropIndicatorShown(true);
2,995 ✔
48

49
  if(!sel.isEmpty())
2,995 ✔
50
  {
51
    // guard against transient null internalPointer from async scan rebuild
52
    if(auto* data = dataFromViewIndex(sel.indexes().front()))
12 ✔
53
      selected(*data);
12 ✔
54
  }
12 ✔
55
  else if(desel.size() > 0)
2,983 ✔
56
  {
57
    selected({});
×
58
  }
×
59
}
2,995 ✔
60

61
QModelIndexList ProcessTreeView::selectedDraggableIndexes() const
×
62
{
63
  QModelIndexList indexes = selectedIndexes();
×
64
  auto m = QTreeView::model();
×
65
  auto isNotDragEnabled = [m](const QModelIndex& index) {
×
66
    return !(m->flags(index) & Qt::ItemIsDragEnabled);
×
67
  };
68
  indexes.erase(
×
69
      std::remove_if(indexes.begin(), indexes.end(), isNotDragEnabled), indexes.end());
×
70
  return indexes;
×
71
}
×
72

73
void ProcessTreeView::startDrag(Qt::DropActions)
×
74
{
75
  QModelIndexList indexes = selectedDraggableIndexes();
×
76
  if(indexes.count() == 1)
×
77
  {
78
    // auto proxy = (QSortFilterProxyModel*)this->model();
79
    // auto model_idx = proxy->mapFromSource(indexes.first());
80

81
    // QMimeData* data = proxy->mimeData(QModelIndexList{model_idx});
82
    QMimeData* data = QTreeView::model()->mimeData(indexes);
×
83
    if(!data)
×
84
      return;
×
85

86
    QDrag* drag = new QDrag(this);
×
87
    drag->setMimeData(data);
×
88
    /*
89
    auto p =
90
    score::get_pixmap(QStringLiteral(":/icons/cursor_process_audio.png"));
91
    drag->setDragCursor(p, Qt::CopyAction);
92
    drag->setDragCursor(p, Qt::MoveAction);
93
    */
94
#if defined(__EMSCRIPTEN__)
95
    QStyleOptionViewItem opt;
96
    initViewItemOption(&opt);
97
    score::setItemViewDragPixmap(*drag, *this, opt, indexes);
98
#endif
99
    drag->exec();
×
100
  }
×
101
}
×
102

103
void ProcessTreeView::mouseDoubleClickEvent(QMouseEvent* event)
×
104
{
105
  auto index = indexAt(event->pos());
×
106
  if(index.isValid())
×
107
  {
108
    // guard against transient null internalPointer from async scan rebuild
109
    auto data = dataFromViewIndex(index);
×
110
    if(data && data->key != UuidKey<Process::ProcessModel>{})
×
111
    {
112
      doubleClicked(*data);
×
113
      event->accept();
×
114
      return;
×
115
    }
116
  }
×
117
  QTreeView::mouseDoubleClickEvent(event);
×
118
}
×
119

120
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc