Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
36e80394
Commit
36e80394
authored
10 years ago
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
[ #51339 ] Disable advanced security widgets (not ready for 1.4.0)
parent
a92dd7fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/itembackendmodel.cpp
+16
-11
16 additions, 11 deletions
src/itembackendmodel.cpp
with
16 additions
and
11 deletions
src/itembackendmodel.cpp
+
16
−
11
View file @
36e80394
...
...
@@ -102,30 +102,35 @@ Qt::ItemFlags CommonItemBackendModel::flags(const QModelIndex& idx) const
if
(
!
idx
.
isValid
())
return
0
;
ProxyItem
*
item
=
static_cast
<
ProxyItem
*>
(
idx
.
internalPointer
());
if
(
idx
.
column
()
>
0
)
return
m_lExtensions
[
idx
.
column
()
-
1
]
->
flags
(
item
->
backend
,
idx
);
if
(
idx
.
column
()
>
0
)
{
//Make sure the cell is disabled if the row is
Qt
::
ItemFlags
f
=
m_lExtensions
[
idx
.
column
()
-
1
]
->
flags
(
item
->
backend
,
idx
);
return
(((
f
&
Qt
::
ItemIsEnabled
)
&&
(
!
item
->
backend
->
isEnabled
()))
?
f
^
Qt
::
ItemIsEnabled
:
f
);
}
const
bool
checkable
=
item
->
backend
->
supportedFeatures
()
&
(
AbstractContactBackend
::
SupportedFeatures
::
ENABLEABLE
|
AbstractContactBackend
::
SupportedFeatures
::
DISABLEABLE
|
AbstractContactBackend
::
SupportedFeatures
::
MANAGEABLE
);
return
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
|
(
checkable
?
Qt
::
ItemIsUserCheckable
:
Qt
::
NoItemFlags
);
}
bool
CommonItemBackendModel
::
setData
(
const
QModelIndex
&
i
nde
x
,
const
QVariant
&
value
,
int
role
)
bool
CommonItemBackendModel
::
setData
(
const
QModelIndex
&
i
d
x
,
const
QVariant
&
value
,
int
role
)
{
Q_UNUSED
(
i
nde
x
)
Q_UNUSED
(
i
d
x
)
Q_UNUSED
(
value
)
Q_UNUSED
(
role
)
if
(
i
nde
x
.
isValid
()
&&
i
nde
x
.
column
()
>
0
)
{
ProxyItem
*
item
=
static_cast
<
ProxyItem
*>
(
i
nde
x
.
internalPointer
());
return
m_lExtensions
[
i
nde
x
.
column
()
-
1
]
->
setData
(
item
->
backend
,
i
nde
x
,
value
,
role
);
if
(
i
d
x
.
isValid
()
&&
i
d
x
.
column
()
>
0
)
{
ProxyItem
*
item
=
static_cast
<
ProxyItem
*>
(
i
d
x
.
internalPointer
());
return
m_lExtensions
[
i
d
x
.
column
()
-
1
]
->
setData
(
item
->
backend
,
i
d
x
,
value
,
role
);
}
if
(
role
==
Qt
::
CheckStateRole
)
{
ProxyItem
*
item
=
static_cast
<
ProxyItem
*>
(
i
nde
x
.
internalPointer
());
if
(
role
==
Qt
::
CheckStateRole
&&
idx
.
column
()
==
0
)
{
ProxyItem
*
item
=
static_cast
<
ProxyItem
*>
(
i
d
x
.
internalPointer
());
if
(
item
)
{
const
bool
old
=
item
->
backend
->
isEnabled
();
ItemModelStateSerializationVisitor
::
instance
()
->
setChecked
(
item
->
backend
,
value
==
Qt
::
Checked
);
if
(
old
!=
(
value
==
Qt
::
Checked
))
emit
dataChanged
(
index
(
idx
.
row
(),
0
),
index
(
idx
.
row
(),
columnCount
()
-
1
));
if
(
old
!=
(
value
==
Qt
::
Checked
))
{
emit
checkStateChanged
();
}
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment