From c5421dcf7d68ba61c3a5bed580e8fd65395643e1 Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Wed, 12 Mar 2014 21:02:46 -0400 Subject: [PATCH 17/23] Fix segfaults in history manual test --- manualtests/history/main_history.cpp | 2 +- src/history/history.cpp | 5 +++++ src/history/history.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git manualtests/history/main_history.cpp manualtests/history/main_history.cpp index dadaa2e..6b8669c 100644 --- manualtests/history/main_history.cpp +++ manualtests/history/main_history.cpp @@ -67,7 +67,7 @@ int main(int argc, char **argv) historyCompletionModelView->setModel(completionModel); tabWidget.addTab(historyCompletionModelView, "HistoryCompletionModel"); - HistoryDialog dialog; + HistoryDialog dialog(0, &history); tabWidget.addTab(dialog.tree, "DialogModel"); tabWidget.setCurrentIndex(3); diff --git src/history/history.cpp src/history/history.cpp index 77fc0e9..7419cf0 100644 --- src/history/history.cpp +++ src/history/history.cpp @@ -243,6 +243,11 @@ int HistoryMenuModel::rowCount(const QModelIndex &parent) const return defaultCount; } +QModelIndex HistoryMenuModel::buddy(const QModelIndex &index) const +{ + return index; +} + QModelIndex HistoryMenuModel::mapFromSource(const QModelIndex &sourceIndex) const { // currently not used or autotested diff --git src/history/history.h src/history/history.h index 5c980ff..84e596f 100644 --- src/history/history.h +++ src/history/history.h @@ -201,6 +201,7 @@ public: QModelIndex index(int, int, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index = QModelIndex()) const; QMimeData *mimeData(const QModelIndexList &indexes) const; + QModelIndex buddy(const QModelIndex &index) const; int bumpedRows() const; -- 2.44.0