diff options
Diffstat (limited to 'Swift/QtUI/QtChatWindowFactory.cpp')
-rw-r--r-- | Swift/QtUI/QtChatWindowFactory.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Swift/QtUI/QtChatWindowFactory.cpp b/Swift/QtUI/QtChatWindowFactory.cpp index 1774653..b9ba89d 100644 --- a/Swift/QtUI/QtChatWindowFactory.cpp +++ b/Swift/QtUI/QtChatWindowFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -10,6 +10,7 @@ #include <qdebug.h> #include <Swift/QtUI/QtChatTabs.h> +#include <Swift/QtUI/QtChatTabsBase.h> #include <Swift/QtUI/QtChatWindow.h> #include <Swift/QtUI/QtSwiftUtil.h> #include <Swift/QtUI/QtChatTheme.h> @@ -21,19 +22,21 @@ namespace Swift { static const QString SPLITTER_STATE = "mucSplitterState"; static const QString CHAT_TABS_GEOMETRY = "chatTabsGeometry"; -QtChatWindowFactory::QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabs* tabs, const QString& themePath, const std::map<std::string, std::string>& emoticons) : themePath_(themePath), emoticons_(emoticons) { +QtChatWindowFactory::QtChatWindowFactory(QtSingleWindow* splitter, SettingsProvider* settings, QtSettingsProvider* qtSettings, QtChatTabsBase* tabs, const QString& themePath, const std::map<std::string, std::string>& emoticons) : themePath_(themePath), emoticons_(emoticons) { qtOnlySettings_ = qtSettings; settings_ = settings; tabs_ = tabs; theme_ = NULL; + QtChatTabs* fullTabs = dynamic_cast<QtChatTabs*>(tabs_); if (splitter) { - splitter->addWidget(tabs_); - } else if (tabs_) { + assert(fullTabs && "Netbook mode and no-tabs interface is not supported!"); + splitter->addWidget(fullTabs); + } else if (fullTabs) { QVariant chatTabsGeometryVariant = qtOnlySettings_->getQSettings()->value(CHAT_TABS_GEOMETRY); if (chatTabsGeometryVariant.isValid()) { - tabs_->restoreGeometry(chatTabsGeometryVariant.toByteArray()); + fullTabs->restoreGeometry(chatTabsGeometryVariant.toByteArray()); } - connect(tabs_, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged())); + connect(fullTabs, SIGNAL(geometryChanged()), this, SLOT(handleWindowGeometryChanged())); } } |