qa: Remove dead code
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 19:51:01 +0000 (20:51 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 23:59:46 +0000 (00:59 +0100)
src/client/networkmodel.cpp
src/qtui/settingspages/shortcutsmodel.cpp
src/uisupport/bufferview.cpp
src/uisupport/bufferview.h

index 752eb1e..423be8b 100644 (file)
@@ -405,7 +405,6 @@ bool BufferItem::setData(int column, const QVariant& value, int role)
     default:
         return PropertyMapItem::setData(column, value, role);
     }
-    return true;
 }
 
 void BufferItem::setBufferName(const QString& name)
index 0cf3f5e..0f81564 100644 (file)
@@ -77,19 +77,9 @@ QModelIndex ShortcutsModel::index(int row, int column, const QModelIndex& parent
     return createIndex(row, column, _categoryItems.at(row));
 }
 
-int ShortcutsModel::columnCount(const QModelIndex& parent) const
+int ShortcutsModel::columnCount(const QModelIndex&) const
 {
     return 2;
-    if (!parent.isValid())
-        return 2;
-
-    auto* item = static_cast<Item*>(parent.internalPointer());
-    Q_ASSERT(item);
-
-    if (!item->parentItem)
-        return 2;
-
-    return 2;
 }
 
 int ShortcutsModel::rowCount(const QModelIndex& parent) const
index 9711755..645634b 100644 (file)
@@ -575,24 +575,6 @@ void BufferView::filterTextChanged(const QString& filterString)
     on_configChanged();  // make sure collapsation is correct
 }
 
-QSize BufferView::sizeHint() const
-{
-    return TreeViewTouch::sizeHint();
-
-    if (!model())
-        return TreeViewTouch::sizeHint();
-
-    if (model()->rowCount() == 0)
-        return {120, 50};
-
-    int columnSize = 0;
-    for (int i = 0; i < model()->columnCount(); i++) {
-        if (!isColumnHidden(i))
-            columnSize += sizeHintForColumn(i);
-    }
-    return {columnSize, 50};
-}
-
 void BufferView::changeHighlight(BufferView::Direction direction)
 {
     // If for some weird reason we get a new delegate
index a654aed..2b8f1bc 100644 (file)
@@ -83,7 +83,6 @@ protected:
     void dropEvent(QDropEvent* event) override;
     void rowsInserted(const QModelIndex& parent, int start, int end) override;
     void wheelEvent(QWheelEvent*) override;
-    QSize sizeHint() const override;
     void focusInEvent(QFocusEvent* event) override { QAbstractScrollArea::focusInEvent(event); }
     void contextMenuEvent(QContextMenuEvent* event) override;