From 8e6951a745b4e81201102d480d1b69f24aed2efa Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 17 May 2009 14:51:25 +0200 Subject: [PATCH] Use QString parameters instead of const char* in some more places. Except for one case of topLevelExprByName(), all callers of these functions already have a QString. This avoids unnecessary conversions. --- kdbg/exprwnd.cpp | 2 +- kdbg/exprwnd.h | 2 +- kdbg/sourcewnd.cpp | 2 +- kdbg/sourcewnd.h | 2 +- kdbg/typetable.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kdbg/exprwnd.cpp b/kdbg/exprwnd.cpp index d670938..367e2cc 100644 --- a/kdbg/exprwnd.cpp +++ b/kdbg/exprwnd.cpp @@ -584,7 +584,7 @@ QString ExprWnd::formatWCharPointer(QString value) } -VarTree* ExprWnd::topLevelExprByName(const char* name) +VarTree* ExprWnd::topLevelExprByName(const QString& name) const { VarTree* item = firstChild(); while (item != 0 && item->getText() != name) diff --git a/kdbg/exprwnd.h b/kdbg/exprwnd.h index dddf189..6281296 100644 --- a/kdbg/exprwnd.h +++ b/kdbg/exprwnd.h @@ -133,7 +133,7 @@ public: /** updates only the value of the node */ void updateStructValue(VarTree* display); /** get a top-level expression by name */ - VarTree* topLevelExprByName(const char* name); + VarTree* topLevelExprByName(const QString& name) const; /** return a member of the struct that pointer \a v refers to */ static VarTree* ptrMemberByName(VarTree* v, const QString& name); /** return a member of the struct \a v */ diff --git a/kdbg/sourcewnd.cpp b/kdbg/sourcewnd.cpp index 1095c2c..53cbe0b 100644 --- a/kdbg/sourcewnd.cpp +++ b/kdbg/sourcewnd.cpp @@ -23,7 +23,7 @@ #include "mydebug.h" -SourceWindow::SourceWindow(const char* fileName, QWidget* parent, const char* name) : +SourceWindow::SourceWindow(const QString& fileName, QWidget* parent, const char* name) : QTextEdit(parent, name), m_fileName(fileName), m_curRow(-1), diff --git a/kdbg/sourcewnd.h b/kdbg/sourcewnd.h index fc8f632..bab0b5a 100644 --- a/kdbg/sourcewnd.h +++ b/kdbg/sourcewnd.h @@ -21,7 +21,7 @@ class SourceWindow : public QTextEdit { Q_OBJECT public: - SourceWindow(const char* fileName, QWidget* parent, const char* name); + SourceWindow(const QString& fileName, QWidget* parent, const char* name); ~SourceWindow(); bool loadFile(); diff --git a/kdbg/typetable.h b/kdbg/typetable.h index 1f1d77d..5cef561 100644 --- a/kdbg/typetable.h +++ b/kdbg/typetable.h @@ -97,7 +97,7 @@ public: /** * Does the file name match this library? */ - bool matchFileName(const char* fileName) { + bool matchFileName(const QString& fileName) const { return m_shlibNameRE.match(fileName) >= 0; } -- 2.11.4.GIT