~ubuntu-sdk-team/qtcreator-plugin-remotelinux/trunk

« back to all changes in this revision

Viewing changes to src/qnx/bardescriptoreditorpermissionswidget.cpp

  • Committer: CI bot
  • Author(s): Benjamin Zeller
  • Date: 2014-06-16 10:28:43 UTC
  • mfrom: (4.2.4 remotelinux)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616102843-8juvmjvzwlzsboyw
Migrating to Qt5.3 and QtC 3.1 

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
    connect(m_ui->selectAllPermissions, SIGNAL(clicked()), m_permissionsModel, SLOT(checkAll()));
50
50
    connect(m_ui->deselectAllPermissions, SIGNAL(clicked()), m_permissionsModel, SLOT(uncheckAll()));
51
 
    connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
 
51
 
 
52
    addSignalMapping(BarDescriptorDocument::action, m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
52
53
}
53
54
 
54
55
BarDescriptorEditorPermissionsWidget::~BarDescriptorEditorPermissionsWidget()
56
57
    delete m_ui;
57
58
}
58
59
 
59
 
void BarDescriptorEditorPermissionsWidget::clear()
60
 
{
61
 
    disconnect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
62
 
    m_permissionsModel->uncheckAll();
63
 
    connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
64
 
}
65
 
 
66
60
QStringList BarDescriptorEditorPermissionsWidget::checkedPermissions() const
67
61
{
68
62
    return m_permissionsModel->checkedIdentifiers();
70
64
 
71
65
void BarDescriptorEditorPermissionsWidget::checkPermission(const QString &identifier)
72
66
{
73
 
    disconnect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
 
67
    blockSignalMapping(BarDescriptorDocument::action);
74
68
    m_permissionsModel->checkPermission(identifier);
75
 
    connect(m_permissionsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
 
69
    unblockSignalMapping(BarDescriptorDocument::action);
 
70
}
 
71
 
 
72
void BarDescriptorEditorPermissionsWidget::updateWidgetValue(BarDescriptorDocument::Tag tag, const QVariant &value)
 
73
{
 
74
    if (tag != BarDescriptorDocument::action) {
 
75
        BarDescriptorEditorAbstractPanelWidget::updateWidgetValue(tag, value);
 
76
        return;
 
77
    }
 
78
 
 
79
    QStringList permissions = value.toStringList();
 
80
    Q_FOREACH (const QString &permission, permissions)
 
81
        checkPermission(permission);
 
82
}
 
83
 
 
84
void BarDescriptorEditorPermissionsWidget::emitChanged(BarDescriptorDocument::Tag tag)
 
85
{
 
86
    if (tag != BarDescriptorDocument::action) {
 
87
        BarDescriptorEditorAbstractPanelWidget::emitChanged(tag);
 
88
        return;
 
89
    }
 
90
 
 
91
    emit changed(tag, checkedPermissions());
76
92
}