diff options
Diffstat (limited to 'lib/bookmarks/bookmarkswidget.cpp')
-rw-r--r-- | lib/bookmarks/bookmarkswidget.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bookmarks/bookmarkswidget.cpp b/lib/bookmarks/bookmarkswidget.cpp index 09f8c22..5e0e391 100644 --- a/lib/bookmarks/bookmarkswidget.cpp +++ b/lib/bookmarks/bookmarkswidget.cpp @@ -30,8 +30,14 @@ BookmarksWidget::BookmarksWidget(const QString &path, QWidget *parent) m_model = new BookmarksModel(style(), this); ui->treeView->setModel(m_model); - - xbel = new Xbel(path); + ui->treeView->viewport()->setAcceptDrops(true); + ui->treeView->setDragEnabled(true); + ui->treeView->setDragDropMode(QAbstractItemView::InternalMove); + ui->treeView->setDropIndicatorShown(true); + + m_bookmarksFile.setFileName(path); + m_bookmarksFile.open(QIODevice::ReadWrite | QIODevice::Text); + xbel = new Xbel(&m_bookmarksFile); qDebug("Reading bookmarks [%s] %s", qUtf8Printable(path), m_model->read(xbel) ? "ok" : "failed"); m_model->expandItems(ui->treeView); @@ -102,6 +108,7 @@ BookmarksWidget::BookmarksWidget(const QString &path, QWidget *parent) BookmarksWidget::~BookmarksWidget() { + m_bookmarksFile.close(); delete xbel; delete ui; } |