Commit 14e6a30e authored by Eike Ziller's avatar Eike Ziller

Debugger: Work around linguist issues

It gets confused by templates that use "class" (QTBUG-55478), and by
certain complicated namespace usages (QTBUG-64007).

Change-Id: I6029922344f6718b5893dd07daee0953366c442e
Reviewed-by: Oswald Buddenhagen's avatarOswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: default avatarhjk <hjk@qt.io>
parent a6461960
......@@ -202,7 +202,7 @@ public:
QPersistentModelIndex m_currentIndex;
};
template <class Predicate>
template <typename Predicate>
void forAllDebuggers(const Predicate &pred)
{
d->m_model->forItemsAtLevel<2>([pred](DebuggerTreeItem *titem) {
......@@ -210,7 +210,7 @@ void forAllDebuggers(const Predicate &pred)
});
}
template <class Predicate>
template <typename Predicate>
const DebuggerItem *findDebugger(const Predicate &pred)
{
DebuggerTreeItem *titem = d->m_model->findItemAtLevel<2>([pred](DebuggerTreeItem *titem) {
......@@ -624,31 +624,6 @@ void DebuggerOptionsPage::finish()
d->m_model->cancel();
}
} // namespace Internal
// --------------------------------------------------------------------------
// DebuggerItemManager
// --------------------------------------------------------------------------
DebuggerItemManager::DebuggerItemManager()
{
new DebuggerItemManagerPrivate;
connect(ICore::instance(), &ICore::saveSettingsRequested,
this, [] { d->saveDebuggers(); });
}
DebuggerItemManager::~DebuggerItemManager()
{
delete d;
}
QList<DebuggerItem> DebuggerItemManager::debuggers()
{
QList<DebuggerItem> result;
forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); });
return result;
}
void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
{
FileNameList cdbs;
......@@ -826,42 +801,6 @@ void DebuggerItemManagerPrivate::readLegacyDebuggers(const FileName &file)
}
}
const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
{
return findDebugger([command](const DebuggerItem &item) {
return item.command() == command;
});
}
const DebuggerItem *DebuggerItemManager::findById(const QVariant &id)
{
return findDebugger([id](const DebuggerItem &item) {
return item.id() == id;
});
}
const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType)
{
return findDebugger([engineType](const DebuggerItem &item) {
return item.engineType() == engineType;
});
}
QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item)
{
return d->registerDebugger(item);
}
void DebuggerItemManager::deregisterDebugger(const QVariant &id)
{
d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) {
if (titem->m_item.id() == id)
d->m_model->destroyItem(titem);
});
}
namespace Internal {
static FileName userSettingsFileName()
{
QFileInfo settingsLocation(ICore::settings()->fileName());
......@@ -1000,4 +939,62 @@ void DebuggerItemManagerPrivate::saveDebuggers()
}
} // namespace Internal
// --------------------------------------------------------------------------
// DebuggerItemManager
// --------------------------------------------------------------------------
DebuggerItemManager::DebuggerItemManager()
{
new DebuggerItemManagerPrivate;
connect(ICore::instance(), &ICore::saveSettingsRequested,
this, [] { d->saveDebuggers(); });
}
DebuggerItemManager::~DebuggerItemManager()
{
delete d;
}
QList<DebuggerItem> DebuggerItemManager::debuggers()
{
QList<DebuggerItem> result;
forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); });
return result;
}
const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
{
return findDebugger([command](const DebuggerItem &item) {
return item.command() == command;
});
}
const DebuggerItem *DebuggerItemManager::findById(const QVariant &id)
{
return findDebugger([id](const DebuggerItem &item) {
return item.id() == id;
});
}
const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType)
{
return findDebugger([engineType](const DebuggerItem &item) {
return item.engineType() == engineType;
});
}
QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item)
{
return d->registerDebugger(item);
}
void DebuggerItemManager::deregisterDebugger(const QVariant &id)
{
d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) {
if (titem->m_item.id() == id)
d->m_model->destroyItem(titem);
});
}
} // namespace Debugger
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment