[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [libkpeople] src/widgets: Cosmetic changes
From: Aleix Pol <aleixpol () kde ! org>
Date: 2013-09-11 19:43:24
Message-ID: E1VJqJw-0005wW-94 () scm ! kde ! org
[Download RAW message or body]
Git commit 179ff16a81c0d60fb94134737e6c7ee54491991b by Aleix Pol.
Committed on 07/09/2013 at 23:05.
Pushed by apol into branch 'master'.
Cosmetic changes
M +11 -11 src/widgets/mergedialog.cpp
M +5 -7 src/widgets/mergedialog.h
http://commits.kde.org/libkpeople/179ff16a81c0d60fb94134737e6c7ee54491991b
diff --git a/src/widgets/mergedialog.cpp b/src/widgets/mergedialog.cpp
index 133761a..57a95ff 100644
--- a/src/widgets/mergedialog.cpp
+++ b/src/widgets/mergedialog.cpp
@@ -61,7 +61,7 @@ MergeDialog::MergeDialog(QWidget *parent)
setWindowTitle(i18n("Duplicates Manager"));
setLayout(new QVBoxLayout());
- setMinimumSize(450,350);
+ setMinimumSize(450, 350);
d->model = new QStandardItemModel(this);
d->view = new QListView(this);
@@ -116,7 +116,7 @@ void MergeDialog::mergeMatchingContactsFromIndex(const QStandardItem *parent)
int rows = parent->rowCount();
for (int i = 0; i<rows; i++) {
- QStandardItem *child = parent->child(i,0);
+ QStandardItem *child = parent->child(i, 0);
mergingList << child->data(MergeDialog::UriRole).toUrl();
}
mergingList << parent->data(MergeDialog::UriRole).toUrl();
@@ -126,7 +126,7 @@ void MergeDialog::mergeMatchingContactsFromIndex(const QStandardItem *parent)
void MergeDialog::onMergeButtonClicked()
{
QList<QStandardItem*> parents = checkedItems();
- Q_FOREACH (QStandardItem *parent , parents) {
+ Q_FOREACH (QStandardItem *parent, parents) {
mergeMatchingContactsFromIndex(parent);
}
emit accept();
@@ -142,8 +142,8 @@ void MergeDialog::searchForDuplicatesFinished(KJob*)
d->view->setItemDelegate(d->delegate);
// To extend the selected item
- connect(d->view->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
- d->delegate, SLOT(onSelectedContactsChanged(QItemSelection,QItemSelection)));
+ connect(d->view->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ d->delegate, SLOT(onSelectedContactsChanged(QItemSelection, QItemSelection)));
// To contract an already selected item
connect(d->view, SIGNAL(doubleClicked(QModelIndex)),
d->delegate, SLOT(onClickContactParent(QModelIndex)));
@@ -166,7 +166,7 @@ void MergeDialog::feedDuplicateModelFromMatches(const QList<Match> &matches)
compareTable[match.indexA]= currentValue;
}
}
- // now build the model : 1st dimension = parent , 2nd dimension = children
+ // now build the model : 1st dimension = parent, 2nd dimension = children
QStandardItem *rootItem = d->model->invisibleRootItem();
QMap<QPersistentModelIndex, QList< Match > >::const_iterator i;
@@ -175,7 +175,7 @@ void MergeDialog::feedDuplicateModelFromMatches(const QList<Match> &matches)
QStandardItem *parent = itemMergeContactFromMatch(i.key(), i->first());
rootItem->appendRow(parent);
- Q_FOREACH (const Match &matchChild, compareTable.value(QModelIndex() , *i)) {
+ Q_FOREACH (const Match &matchChild, compareTable.value(QModelIndex(), *i)) {
QStandardItem *oneChild = itemMergeContactFromMatch(QModelIndex(), matchChild);
parent->appendRow(oneChild);
}
@@ -189,7 +189,7 @@ QStandardItem* MergeDialog::itemMergeContactFromMatch(const QModelIndex &idx, co
item->setCheckable(true);
item->setCheckState(Qt::Checked);
- QUrl uri ;
+ QUrl uri;
if (!idx.isValid()) { // child
uri = match.indexB.data(PersonsModel::UriRole).toUrl();
@@ -205,7 +205,7 @@ QStandardItem* MergeDialog::itemMergeContactFromMatch(const QModelIndex &idx, co
item->setData(qVariantFromValue<QUrl>(uri), UriRole);
item->setText(match.indexA.data(Qt::DisplayRole).toString());
- item->setData(match.indexA.data(Qt::DecorationRole) , Qt::DecorationRole);
+ item->setData(match.indexA.data(Qt::DecorationRole), Qt::DecorationRole);
}
return item;
}
@@ -216,8 +216,8 @@ QList<QStandardItem*> MergeDialog::checkedItems()
QStandardItem *root = d->model->invisibleRootItem();
int rows = root->rowCount();
QList<QStandardItem*> results;
- for (int i = 0 ; i < rows ; i++) {
- QStandardItem *currentParent = root->child(i,0);
+ for (int i = 0; i < rows; i++) {
+ QStandardItem *currentParent = root->child(i, 0);
if (currentParent->checkState() == Qt::Checked) {
results.append(currentParent);
}
diff --git a/src/widgets/mergedialog.h b/src/widgets/mergedialog.h
index 2a17920..5ed8ab8 100644
--- a/src/widgets/mergedialog.h
+++ b/src/widgets/mergedialog.h
@@ -49,19 +49,17 @@ public:
~MergeDialog();
void setPersonsModel(PersonsModel *model);
-private:
- QList<QStandardItem*> checkedItems();
- void mergeMatchingContactsFromIndex(const QStandardItem *parent);
- QStandardItem* itemMergeContactFromMatch(const QModelIndex &idx, const Match &match);
-
- void feedDuplicateModelFromMatches(const QList<Match> &matches) ;
-
private Q_SLOTS:
void searchForDuplicates();
void searchForDuplicatesFinished(KJob *);
void onMergeButtonClicked();
private:
+ QList<QStandardItem*> checkedItems();
+ void mergeMatchingContactsFromIndex(const QStandardItem *parent);
+ QStandardItem* itemMergeContactFromMatch(const QModelIndex &idx, const Match &match);
+ void feedDuplicateModelFromMatches(const QList<Match> &matches);
+
MergeDialogPrivate * const d_ptr;
Q_DECLARE_PRIVATE(MergeDialog)
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic