summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstreemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarkstreemodel.cpp')
-rw-r--r--src/bookmarks/bookmarkstreemodel.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp
index 8086ff64..a4f322b8 100644
--- a/src/bookmarks/bookmarkstreemodel.cpp
+++ b/src/bookmarks/bookmarkstreemodel.cpp
@@ -193,7 +193,8 @@ QMimeData *BookmarkModel::mimeData(const QModelIndexList &indexes) const
for (const QModelIndex &index : indexes) {
if (index.isValid() && index.column() == 0) items.append(item(index));
}
- xbel::write(&buffer, items);
+ const auto write_result = xbel::write(&buffer, items);
+ Q_ASSERT(write_result == false);
auto *mimeData = new QMimeData;
mimeData->setData(mimeType, data);
@@ -212,7 +213,8 @@ bool BookmarkModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction actio
buffer.open(QIODevice::ReadOnly | QIODevice::Text);
auto *fake_root = new BookmarksTreeItem(BookmarksTreeItem::Root, {}, nullptr);
- xbel::read(&buffer, fake_root);
+ const auto read_result = xbel::read(&buffer, fake_root);
+ Q_ASSERT(read_result.isEmpty());
const auto childCount = static_cast<int>(fake_root->childCount());
auto *parentItem = item(parent);
@@ -232,5 +234,5 @@ QList<QString> BookmarkModel::load(QIODevice *buffer) { return readFns[Formats::
void BookmarkModel::save(QIODevice *buffer)
{
if (!buffer->isOpen() || !buffer->isWritable()) return;
- if (m_isModified) m_isModified = !writeFns[Formats::FormatXbel](buffer, {rootItem});
+ m_isModified = !writeFns[Formats::FormatXbel](buffer, {rootItem});
}