forked from qt-creator/qt-creator
Debugger: Don't fetch more data for console after engine shutdown
The engine might not exist anymore. Change-Id: I7a542de7fb8b160d71a1650d37263e4433f97003 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -249,6 +249,7 @@ void Console::writeSettings() const
|
|||||||
void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
|
void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
|
||||||
{
|
{
|
||||||
m_scriptEvaluator = evaluator;
|
m_scriptEvaluator = evaluator;
|
||||||
|
m_consoleItemModel->setCanFetchMore(bool(m_scriptEvaluator));
|
||||||
if (!m_scriptEvaluator)
|
if (!m_scriptEvaluator)
|
||||||
setContext(QString());
|
setContext(QString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Internal {
|
|||||||
|
|
||||||
ConsoleItemModel::ConsoleItemModel(QObject *parent) :
|
ConsoleItemModel::ConsoleItemModel(QObject *parent) :
|
||||||
Utils::TreeModel<>(new ConsoleItem, parent),
|
Utils::TreeModel<>(new ConsoleItem, parent),
|
||||||
m_maxSizeOfFileName(0)
|
m_maxSizeOfFileName(0), m_canFetchMore(false)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
@@ -51,6 +51,16 @@ void ConsoleItemModel::clear()
|
|||||||
emit selectEditableRow(index(0, 0, QModelIndex()), QItemSelectionModel::ClearAndSelect);
|
emit selectEditableRow(index(0, 0, QModelIndex()), QItemSelectionModel::ClearAndSelect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConsoleItemModel::setCanFetchMore(bool canFetchMore)
|
||||||
|
{
|
||||||
|
m_canFetchMore = canFetchMore;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ConsoleItemModel::canFetchMore(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
return m_canFetchMore && TreeModel::canFetchMore(parent);
|
||||||
|
}
|
||||||
|
|
||||||
void ConsoleItemModel::appendItem(ConsoleItem *item, int position)
|
void ConsoleItemModel::appendItem(ConsoleItem *item, int position)
|
||||||
{
|
{
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
|
|||||||
@@ -53,11 +53,15 @@ public:
|
|||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
void setCanFetchMore(bool canFetchMore);
|
||||||
|
bool canFetchMore(const QModelIndex &parent) const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void selectEditableRow(const QModelIndex &index, QItemSelectionModel::SelectionFlags flags);
|
void selectEditableRow(const QModelIndex &index, QItemSelectionModel::SelectionFlags flags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_maxSizeOfFileName;
|
int m_maxSizeOfFileName;
|
||||||
|
bool m_canFetchMore;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user