diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-05-22 15:15:00 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-05-23 16:41:22 +0200 |
commit | 8917e0cecd80a5d673ac4a6d6586b472aa019d1b (patch) | |
tree | 62308ccda4de90a3aed9f8eb882cfa4344f4d604 /src/lib/corelib/tools/profile.h | |
parent | 427f5e07fd05a2f4ca855054fae640646b63c800 (diff) |
Do not let the autotests pollute the profiles namespace.
Introduce and use the new class TemporaryProfile whenever profiles need
to be created as part of a test.
Change-Id: I3d91f112342b1cb2861cbe9d2c96deac7f762cd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/corelib/tools/profile.h')
-rw-r--r-- | src/lib/corelib/tools/profile.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/corelib/tools/profile.h b/src/lib/corelib/tools/profile.h index 740f23931..468a72f2b 100644 --- a/src/lib/corelib/tools/profile.h +++ b/src/lib/corelib/tools/profile.h @@ -78,6 +78,16 @@ private: Settings *m_settings; }; +namespace Internal { +class TemporaryProfile { +public: + TemporaryProfile(const QString &name, Settings *settings) : p(name, settings) {} + ~TemporaryProfile() { p.removeProfile(); } + + Profile p; +}; +} // namespace Internal + } // namespace qbs #endif // Header guard |