summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2016-06-21 15:04:02 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2016-06-21 16:18:10 +0000
commitf146c3ff9e0adb0a1b3c646a0bb1ea10a825756f (patch)
tree2312ca34ead6c62c6380ff221def4d39e315fad1
parent13b6604c9bd65f734f8ab4312001bc0a0a47fe02 (diff)
downloadqbs-f146c3ff9e0adb0a1b3c646a0bb1ea10a825756f.tar.gz
Move m_content out of FileContextBase to FileContext
The file's content is only used by one subclass of FileContextBase, namely FileContext. This implicitly corrects the copy c'tor of FileContextBase that was missing m_content. Change-Id: I5eabe86baddd04a60e2a1db23c8f7d6a122d3e7d Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r--src/lib/corelib/language/filecontext.h6
-rw-r--r--src/lib/corelib/language/filecontextbase.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/corelib/language/filecontext.h b/src/lib/corelib/language/filecontext.h
index 263b4774f..5f944794e 100644
--- a/src/lib/corelib/language/filecontext.h
+++ b/src/lib/corelib/language/filecontext.h
@@ -34,6 +34,8 @@
#include "filecontextbase.h"
#include "forward_decls.h"
+#include <QString>
+
namespace qbs {
namespace Internal {
class Item;
@@ -44,12 +46,16 @@ class FileContext : public FileContextBase
public:
static FileContextPtr create();
+ void setContent(const QString &content) { m_content = content; }
+ const QString &content() const { return m_content; }
+
Item *idScope() const { return m_idScope; }
void ensureIdScope(ItemPool *itemPool);
private:
FileContext();
+ QString m_content;
Item *m_idScope;
};
diff --git a/src/lib/corelib/language/filecontextbase.h b/src/lib/corelib/language/filecontextbase.h
index 9322b181f..bb1c407f5 100644
--- a/src/lib/corelib/language/filecontextbase.h
+++ b/src/lib/corelib/language/filecontextbase.h
@@ -42,9 +42,6 @@ public:
void setFilePath(const QString &filePath) { m_filePath = filePath; }
QString filePath() const { return m_filePath; }
- void setContent(const QString &content) { m_content = content; }
- const QString &content() const { return m_content; }
-
void addJsImport(const JsImport &jsImport) { m_jsImports << jsImport; }
JsImports jsImports() const { return m_jsImports; }
@@ -61,7 +58,6 @@ protected:
FileContextBase(const FileContextBase &other);
QString m_filePath;
- QString m_content;
JsImports m_jsImports;
QStringList m_jsExtensions;
QStringList m_searchPaths;