diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-11-08 19:26:36 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-11-08 19:26:36 (GMT) |
commit | e77d80d9258699295ad793a8a94e369be5e31a36 (patch) | |
tree | b75f1a644740e9d216701e0095c1bd14573dbcdd /Swift/Controllers/UnitTest/MockMainWindowFactory.h | |
parent | b6003bea740e8898127ec135e230eed421924370 (diff) | |
download | swift-contrib-e77d80d9258699295ad793a8a94e369be5e31a36.zip swift-contrib-e77d80d9258699295ad793a8a94e369be5e31a36.tar.bz2 |
Fix for crash on login failure. Scaffoling for testing roster stuff.
Diffstat (limited to 'Swift/Controllers/UnitTest/MockMainWindowFactory.h')
-rw-r--r-- | Swift/Controllers/UnitTest/MockMainWindowFactory.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Swift/Controllers/UnitTest/MockMainWindowFactory.h b/Swift/Controllers/UnitTest/MockMainWindowFactory.h new file mode 100644 index 0000000..c67df72 --- /dev/null +++ b/Swift/Controllers/UnitTest/MockMainWindowFactory.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Swift/Controllers/MainWindowFactory.h" +#include "Swiften/Roster/TreeWidgetFactory.h" +#include "Swift/Controllers/UnitTest/MockMainWindow.h" + +namespace Swift { + + class MockMainWindowFactory : public MainWindowFactory { + public: + MockMainWindowFactory(TreeWidgetFactory* treeWidgetFactory) {factory_ = treeWidgetFactory;}; + virtual ~MockMainWindowFactory() {}; + /** + * Transfers ownership of result. + */ + virtual MainWindow* createMainWindow() {return new MockMainWindow(factory_->createTreeWidget());}; + private: + TreeWidgetFactory* factory_; + }; +} + + |