summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstreemodel.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-03-27 19:04:11 +0100
committerYoann Laissus <yoann.laissus@gmail.com>2010-03-27 19:04:11 +0100
commit632389517ca496031bb1cbe468d904884961bf57 (patch)
treef0be57644d5ceea2bd38c4f7aea8f1808ee9ba78 /src/bookmarks/bookmarkstreemodel.cpp
parentAdd tests for the bookmark before toGroup() (diff)
downloadrekonq-632389517ca496031bb1cbe468d904884961bf57.tar.xz
- Fix a crash when the cancel button of the add bookmark menu is clicked
- Use the same behaviour for delete bookmark as the toolbar - Some strings changed - Keep the selection of a folder when it's expanded/collapsed - Fix the name of some methods and properties - Code cleaned a bit
Diffstat (limited to 'src/bookmarks/bookmarkstreemodel.cpp')
-rw-r--r--src/bookmarks/bookmarkstreemodel.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp
index d63c92d3..836401a6 100644
--- a/src/bookmarks/bookmarkstreemodel.cpp
+++ b/src/bookmarks/bookmarkstreemodel.cpp
@@ -148,8 +148,9 @@ BookmarksTreeModel::BookmarksTreeModel(QObject *parent)
, m_root(0)
{
resetModel();
- connect( this, SIGNAL(bookmarkChangedFinished()), parent, SLOT(callAutoExpand()));
- connect( Application::bookmarkProvider()->bookmarkManager(), SIGNAL( changed(QString,QString) ), this, SLOT( bookmarksChanged(QString) ) );
+ connect( this, SIGNAL(bookmarksUpdated()), parent, SLOT(loadFoldedState()));
+ connect( Application::bookmarkProvider()->bookmarkManager(), SIGNAL( changed(QString,QString) ), this, SLOT( bookmarksChanged() ) );
+ connect( parent, SIGNAL(saveOnlyRequested()), this, SLOT(saveOnly()) );
}
@@ -283,11 +284,10 @@ QVariant BookmarksTreeModel::data(const QModelIndex &index, int role) const
}
-void BookmarksTreeModel::bookmarksChanged( const QString &groupAddress )
+void BookmarksTreeModel::bookmarksChanged()
{
- Q_UNUSED(groupAddress);
resetModel();
- emit bookmarkChangedFinished();
+ emit bookmarksUpdated();
}
@@ -336,6 +336,20 @@ KBookmark BookmarksTreeModel::bookmarkForIndex(const QModelIndex index) const
}
+void BookmarksTreeModel::saveOnly()
+{
+ disconnect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(QString,QString)), this, SLOT(bookmarksChanged()));
+ connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL(changed(QString,QString)), this, SLOT(reconnectManager()));
+ Application::bookmarkProvider()->bookmarkManager()->emitChanged();
+}
+
+
+void BookmarksTreeModel::reconnectManager()
+{
+ connect(Application::bookmarkProvider()->bookmarkManager(), SIGNAL( changed(QString,QString) ), this, SLOT(bookmarksChanged()));
+}
+
+
Qt::DropActions BookmarksTreeModel::supportedDropActions () const
{
return Qt::MoveAction;