Changeset View
Changeset View
Standalone View
Standalone View
examples/contactlistwidgets.cpp
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 112 | { | |||
---|---|---|---|---|---|
130 | 130 | | |||
131 | QPushButton *unmergeButton = new QPushButton(QStringLiteral("Unmerge"), this); | 131 | QPushButton *unmergeButton = new QPushButton(QStringLiteral("Unmerge"), this); | ||
132 | connect(unmergeButton, SIGNAL(released()), SLOT(onUnmergeClicked())); | 132 | connect(unmergeButton, SIGNAL(released()), SLOT(onUnmergeClicked())); | ||
133 | layout->addWidget(unmergeButton); | 133 | layout->addWidget(unmergeButton); | ||
134 | } | 134 | } | ||
135 | 135 | | |||
136 | void ContactListApp::onMergeClicked() | 136 | void ContactListApp::onMergeClicked() | ||
137 | { | 137 | { | ||
138 | QModelIndexList indexes = m_view->selectionModel()->selectedIndexes(); | 138 | const QModelIndexList indexes = m_view->selectionModel()->selectedIndexes(); | ||
139 | QStringList ids; | 139 | QStringList ids; | ||
140 | Q_FOREACH (const QModelIndex &index, indexes) { | 140 | for (const QModelIndex &index : indexes) { | ||
141 | ids << index.data(PersonsModel::PersonUriRole).toString(); | 141 | ids << index.data(PersonsModel::PersonUriRole).toString(); | ||
142 | } | 142 | } | ||
143 | 143 | | |||
144 | if (!ids.isEmpty()) { | 144 | if (!ids.isEmpty()) { | ||
145 | KPeople::mergeContacts(ids); | 145 | KPeople::mergeContacts(ids); | ||
146 | } | 146 | } | ||
147 | } | 147 | } | ||
148 | 148 | | |||
Show All 19 Lines |