Skip to content

Commit 1ed4eef

Browse files
committed
chore: clang-format code related to refactor branch
This is simply for making `diff` between master and refactor branch more readable. Log:
1 parent 244d872 commit 1ed4eef

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

panels/dock/taskmanager/abstractwindowmonitor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,33 @@ void AbstractWindowMonitor::trackWindow(AbstractWindow* window)
6262
m_trackedWindows.append(window);
6363
endInsertRows();
6464

65-
connect(window, &AbstractWindow::pidChanged, this, [this, window](){
65+
connect(window, &AbstractWindow::pidChanged, this, [this, window]() {
6666
auto pos = m_trackedWindows.indexOf(window);
6767
auto modelIndex = index(pos);
6868
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::PidRole});
6969
});
70-
connect(window, &AbstractWindow::identityChanged, this, [this, window](){
70+
connect(window, &AbstractWindow::identityChanged, this, [this, window]() {
7171
auto pos = m_trackedWindows.indexOf(window);
7272
auto modelIndex = index(pos);
7373
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::IdentityRole});
7474
});
75-
connect(window, &AbstractWindow::iconChanged, this, [this, window](){
75+
connect(window, &AbstractWindow::iconChanged, this, [this, window]() {
7676
auto pos = m_trackedWindows.indexOf(window);
7777
auto modelIndex = index(pos);
7878
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::WinIconRole});
7979
});
80-
connect(window, &AbstractWindow::titleChanged, this, [this, window](){
80+
connect(window, &AbstractWindow::titleChanged, this, [this, window]() {
8181
auto pos = m_trackedWindows.indexOf(window);
8282
auto modelIndex = index(pos);
8383
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::WinTitleRole});
8484
});
8585

86-
connect(window, &AbstractWindow::isActiveChanged, this, [this, window](){
86+
connect(window, &AbstractWindow::isActiveChanged, this, [this, window]() {
8787
auto pos = m_trackedWindows.indexOf(window);
8888
auto modelIndex = index(pos);
8989
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::ActiveRole});
9090
});
91-
connect(window, &AbstractWindow::shouldSkipChanged, this, [this, window](){
91+
connect(window, &AbstractWindow::shouldSkipChanged, this, [this, window]() {
9292
auto pos = m_trackedWindows.indexOf(window);
9393
auto modelIndex = index(pos);
9494
Q_EMIT dataChanged(modelIndex, modelIndex, {TaskManager::ShouldSkipRole});

panels/dock/taskmanager/treelandwindowmonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void TreeLandWindowMonitor::showItemPreview(const QPointer<AppItem> &item, QObje
142142
std::transform(windows.begin(), windows.end(), std::back_inserter(array), [](const QPointer<AbstractWindow>& window){
143143
return window->id();
144144
});
145-
145+
146146
QByteArray byteArray;
147147
int size = array.size() * sizeof(uint32_t);
148148
byteArray.resize(size);

tests/panels/dock/taskmanager/rolecombinemodeltests.cpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ TEST(RoleCombineModel, RowCountTest) {
3737
modelB.addData(new DataB(0, &modelB));
3838
modelB.addData(new DataB(1, &modelB));
3939
modelB.addData(new DataB(2, &modelB));
40-
RoleCombineModel model(&modelA, &modelB, TestModelA::idRole, [](QVariant data, QAbstractItemModel* model) -> QModelIndex
41-
{
42-
return QModelIndex();
43-
}
44-
);
40+
RoleCombineModel model(&modelA, &modelB, TestModelA::idRole, [](QVariant data, QAbstractItemModel *model) -> QModelIndex {
41+
return QModelIndex();
42+
});
4543

4644
// modelA is major dataModel
4745
EXPECT_EQ(model.rowCount(), modelA.rowCount());
@@ -68,16 +66,14 @@ TEST(RoleGroupModel, ModelTest)
6866
TEST(RoleCombineModel, dataTest) {
6967
TestModelA modelA;
7068
TestModelB modelB;
71-
RoleCombineModel model(&modelA, &modelB, TestModelA::idRole, [](QVariant data, QAbstractItemModel* model) -> QModelIndex
72-
{
73-
auto c = model->match(model->index(0, 0), TestModelB::idRole, data);
74-
if (c.size() > 0) {
75-
return c.first();
76-
}
77-
78-
return QModelIndex();
69+
RoleCombineModel model(&modelA, &modelB, TestModelA::idRole, [](QVariant data, QAbstractItemModel *model) -> QModelIndex {
70+
auto c = model->match(model->index(0, 0), TestModelB::idRole, data);
71+
if (c.size() > 0) {
72+
return c.first();
7973
}
80-
);
74+
75+
return QModelIndex();
76+
});
8177

8278
QSignalSpy spyA(&modelA, &QAbstractItemModel::dataChanged);
8379
QSignalSpy spyB(&modelB, &QAbstractItemModel::dataChanged);

0 commit comments

Comments
 (0)