improve value source tracking

- use the current file if a value is generated "out of nowhere"
- preserve source through function calls

Task-number: QTCREATORBUG-4897
This commit is contained in:
Oswald Buddenhagen
2011-05-13 20:20:41 +02:00
parent f5a37db6c4
commit 014571b602
3 changed files with 43 additions and 18 deletions

View File

@@ -71,7 +71,10 @@ public:
ProString(const QString &str, int offset, int length);
ProString(const QString &str, int offset, int length, uint hash);
ProString(const QString &str, int offset, int length, ProStringConstants::OmitPreHashing);
void setSource(const ProFile *pro) { m_file = pro; }
void setValue(const QString &str);
void setValue(const QString &str, ProStringConstants::OmitPreHashing);
ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; }
ProString &setSource(const ProFile *pro) { m_file = pro; return *this; }
const ProFile *sourceFile() const { return m_file; }
QString toQString() const;
QString &toQString(QString &tmp) const;