From 00ff1e72e23eda1a6cad82effe904de0f0a89c3a Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 5 Jan 2017 16:54:34 +0100 Subject: [PATCH] use the m_ prefix on all variables stored in a class This is a flavour thing btw, but if you do it with some variables you should do it with all of them. This helps avoid variable name clashes too that often happens in constructors --- word.cpp | 6 +++--- word.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/word.cpp b/word.cpp index ec581e877..da10b7c14 100644 --- a/word.cpp +++ b/word.cpp @@ -2,7 +2,7 @@ Word::Word(LazyLoadedImage* image, Type type, const QString& copytext, const QString& tooltip) { - this->image = image; + this->m_image = image; m_isImage = true; m_type = type; m_copyText = copytext; @@ -11,8 +11,8 @@ Word::Word(LazyLoadedImage* image, Type type, const QString& copytext, const QSt Word::Word(const QString& text, Type type, const QString& copytext, const QString& tooltip) { - this->image = NULL; - this->text = text; + this->m_image = NULL; + this->m_text = text; m_isImage = false; m_type = type; m_copyText = copytext; diff --git a/word.h b/word.h index eed28fe9b..7ebe7aeaf 100644 --- a/word.h +++ b/word.h @@ -40,17 +40,17 @@ public: BadgeBits = 0x400000, }; - explicit Word(LazyLoadedImage* image, Type type, const QString& copytext, const QString& tooltip = ""); - explicit Word(const QString& text, Type type, const QString& copytext, const QString& tooltip = ""); + explicit Word(LazyLoadedImage* m_image, Type type, const QString& copytext, const QString& tooltip = ""); + explicit Word(const QString& m_text, Type type, const QString& copytext, const QString& tooltip = ""); ~Word(); LazyLoadedImage& getImage() { - return *image; + return *m_image; } const QString& getText() { - return text; + return m_text; } int width() { @@ -98,8 +98,8 @@ public: } private: - LazyLoadedImage* image; - QString text; + LazyLoadedImage* m_image; + QString m_text; bool m_isImage; Type m_type;