Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Akonadi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
Akonadi
Commits
b87e5f4d
Commit
b87e5f4d
authored
Jul 24, 2017
by
David Faure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups
parent
a62c5862
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
autotests/libs/entitytreemodeltest.cpp
autotests/libs/entitytreemodeltest.cpp
+2
-2
src/core/models/entitytreemodel.cpp
src/core/models/entitytreemodel.cpp
+2
-2
No files found.
autotests/libs/entitytreemodeltest.cpp
View file @
b87e5f4d
...
@@ -574,10 +574,10 @@ void EntityTreeModelTest::testItemRemoved()
...
@@ -574,10 +574,10 @@ void EntityTreeModelTest::testItemRemoved()
FakeServerData
*
serverData
=
testDrivers
.
first
;
FakeServerData
*
serverData
=
testDrivers
.
first
;
Akonadi
::
EntityTreeModel
*
model
=
testDrivers
.
second
;
Akonadi
::
EntityTreeModel
*
model
=
testDrivers
.
second
;
QModelIndexList
list
=
model
->
match
(
model
->
index
(
0
,
0
),
Qt
::
DisplayRole
,
removedItem
,
1
,
Qt
::
MatchRecursive
);
const
QModelIndexList
list
=
model
->
match
(
model
->
index
(
0
,
0
),
Qt
::
DisplayRole
,
removedItem
,
1
,
Qt
::
MatchRecursive
);
Q_ASSERT
(
!
list
.
isEmpty
());
Q_ASSERT
(
!
list
.
isEmpty
());
QModelIndex
removedIndex
=
list
.
first
();
QModelIndex
removedIndex
=
list
.
first
();
QString
sourceCollection
=
removedIndex
.
parent
().
data
().
toString
();
const
QString
sourceCollection
=
removedIndex
.
parent
().
data
().
toString
();
int
sourceRow
=
removedIndex
.
row
();
int
sourceRow
=
removedIndex
.
row
();
FakeItemRemovedCommand
*
removeCommand
=
new
FakeItemRemovedCommand
(
removedItem
,
sourceCollection
,
serverData
);
FakeItemRemovedCommand
*
removeCommand
=
new
FakeItemRemovedCommand
(
removedItem
,
sourceCollection
,
serverData
);
...
...
src/core/models/entitytreemodel.cpp
View file @
b87e5f4d
...
@@ -393,7 +393,7 @@ Qt::ItemFlags EntityTreeModel::flags(const QModelIndex &index) const
...
@@ -393,7 +393,7 @@ Qt::ItemFlags EntityTreeModel::flags(const QModelIndex &index) const
Q_D
(
const
EntityTreeModel
);
Q_D
(
const
EntityTreeModel
);
// Pass modeltest.
// Pass modeltest.
if
(
!
index
.
isValid
())
{
if
(
!
index
.
isValid
())
{
return
nullptr
;
return
{}
;
}
}
Qt
::
ItemFlags
flags
=
QAbstractItemModel
::
flags
(
index
);
Qt
::
ItemFlags
flags
=
QAbstractItemModel
::
flags
(
index
);
...
@@ -453,7 +453,7 @@ Qt::ItemFlags EntityTreeModel::flags(const QModelIndex &index) const
...
@@ -453,7 +453,7 @@ Qt::ItemFlags EntityTreeModel::flags(const QModelIndex &index) const
// Can't drop onto items.
// Can't drop onto items.
if
(
rights
&
Collection
::
CanChangeItem
&&
index
.
column
()
==
0
)
{
if
(
rights
&
Collection
::
CanChangeItem
&&
index
.
column
()
==
0
)
{
flags
=
flags
|
Qt
::
ItemIsEditable
;
flags
|=
Qt
::
ItemIsEditable
;
}
}
// dragging is always possible, even for read-only objects, but they can only be copied, not moved.
// dragging is always possible, even for read-only objects, but they can only be copied, not moved.
flags
|=
Qt
::
ItemIsDragEnabled
;
flags
|=
Qt
::
ItemIsDragEnabled
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment