┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places/placespanel.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-06-02 15:02:34 +0200
committerPeter Penz <[email protected]>2012-06-02 15:03:22 +0200
commit12215d6f0f7768fc943347a349d9817844e0528a (patch)
tree76db3b0f6c32900b397246de3c8f731c703708f3 /src/panels/places/placespanel.cpp
parent665c44821e32ba4bdfcd94889eb17e08ac25a315 (diff)
Use PlacesItemModel instead of KFilePlacesModel
This allows inserting items to the corresponding group.
Diffstat (limited to 'src/panels/places/placespanel.cpp')
-rw-r--r--src/panels/places/placespanel.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp
index 613046025..7016b039d 100644
--- a/src/panels/places/placespanel.cpp
+++ b/src/panels/places/placespanel.cpp
@@ -309,25 +309,7 @@ void PlacesPanel::addEntry()
dialog->setUrl(url);
if (dialog->exec() == QDialog::Accepted) {
PlacesItem* item = m_model->createPlacesItem(dialog->text(), dialog->url(), dialog->icon());
-
- // Insert the item as last item of the corresponding group.
- int i = 0;
- while (i < m_model->count() && m_model->placesItem(i)->group() != item->group()) {
- ++i;
- }
-
- bool inserted = false;
- while (!inserted && i < m_model->count()) {
- if (m_model->placesItem(i)->group() != item->group()) {
- m_model->insertItem(i, item);
- inserted = true;
- }
- ++i;
- }
-
- if (!inserted) {
- m_model->appendItem(item);
- }
+ m_model->appendItemToGroup(item);
}
delete dialog;