From b984992fc92b6dd607732d6dad1c533b36f1ba3a Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 7 Jan 2018 23:28:42 +0100 Subject: Added .clang-format --- lib/bookmarks/bookmarksmodel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/bookmarks/bookmarksmodel.cpp') diff --git a/lib/bookmarks/bookmarksmodel.cpp b/lib/bookmarks/bookmarksmodel.cpp index 757612e..7e0c35b 100644 --- a/lib/bookmarks/bookmarksmodel.cpp +++ b/lib/bookmarks/bookmarksmodel.cpp @@ -9,7 +9,8 @@ #include "bookmarksmodel.h" #include -BookmarksModel::BookmarksModel(QStyle *style, QObject *parent) : QAbstractItemModel(parent) +BookmarksModel::BookmarksModel(QStyle *style, QObject *parent) + : QAbstractItemModel(parent) { folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon), QIcon::Normal, QIcon::On); folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon), QIcon::Normal, QIcon::Off); @@ -62,14 +63,14 @@ QModelIndex BookmarksModel::index(BookmarkItem *node, int column) const QModelIndex BookmarksModel::index(int row, int column, const QModelIndex &parent) const { // invalid item requested - if (!hasIndex(row, column, parent)) { + if(!hasIndex(row, column, parent)) { return QModelIndex(); } // index exists BookmarkItem *parentItem; if(parent.isValid()) { - parentItem = static_cast(parent.internalPointer()); + parentItem = static_cast(parent.internalPointer()); } else { parentItem = m_rootItem; } @@ -87,7 +88,7 @@ QModelIndex BookmarksModel::parent(const QModelIndex &index) const return QModelIndex(); } - BookmarkItem *childItem = static_cast(index.internalPointer()); + BookmarkItem *childItem = static_cast(index.internalPointer()); BookmarkItem *parentItem = childItem->parentItem(); if(parentItem == m_rootItem) { @@ -107,7 +108,7 @@ int BookmarksModel::rowCount(const QModelIndex &parent) const if(!parent.isValid()) { parentItem = m_rootItem; } else { - parentItem = static_cast(parent.internalPointer()); + parentItem = static_cast(parent.internalPointer()); } return parentItem->childCount(); @@ -116,7 +117,7 @@ int BookmarksModel::rowCount(const QModelIndex &parent) const int BookmarksModel::columnCount(const QModelIndex &parent) const { if(parent.isValid()) { - return static_cast(parent.internalPointer())->columnCount(); + return static_cast(parent.internalPointer())->columnCount(); } else { return m_rootItem->columnCount(); } @@ -125,12 +126,12 @@ int BookmarksModel::columnCount(const QModelIndex &parent) const QVariant BookmarksModel::data(const QModelIndex &index, int role) const { // get data of invalid index? - if (!index.isValid()) { + if(!index.isValid()) { return QVariant(); } const BookmarkItem *item = static_cast(index.internalPointer()); - switch (role) { + switch(role) { case Qt::DisplayRole: case Qt::EditRole: if(index.column() == 0) { @@ -200,6 +201,5 @@ QModelIndexList BookmarksModel::match(const QModelIndex &start, int role, const } } - return list; } -- cgit v1.2.1