9#include "alkonlinequotesprofilemanager.h"
10#include "alkonlinequotesprofile.h"
11#include "alkwebpage.h"
12#include "alkwebview.h"
16#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
18#define initLocale() QLocale()
21#define initLocale() KGlobal::locale()
24class AlkOnlineQuotesProfileManager::Private
27 AlkOnlineQuotesProfileList m_profiles;
28 QPointer<AlkWebView> m_view;
29 QPointer<AlkWebPage> m_page;
39 m_view.data()->deleteLater();
44AlkOnlineQuotesProfileManager::AlkOnlineQuotesProfileManager()
49AlkOnlineQuotesProfileManager::~AlkOnlineQuotesProfileManager()
54bool AlkOnlineQuotesProfileManager::webViewEnabled()
59void AlkOnlineQuotesProfileManager::setWebViewEnabled(
bool enable)
61 d->m_withView = enable;
64void AlkOnlineQuotesProfileManager::addProfile(AlkOnlineQuotesProfile *profile)
66 if (!d->m_profiles.contains(profile)) {
67 d->m_profiles.append(profile);
68 profile->setManager(
this);
69 connect(profile, SIGNAL(updateAvailable(
const QString &,
const QString &)),
this, SIGNAL(updateAvailable(
const QString &,
const QString &)));
73AlkOnlineQuotesProfileList AlkOnlineQuotesProfileManager::profiles()
78AlkOnlineQuotesProfile *AlkOnlineQuotesProfileManager::profile(
const QString &name)
80 for (AlkOnlineQuotesProfile *profile : profiles()) {
81 if (name == profile->name()) {
88QStringList AlkOnlineQuotesProfileManager::profileNames()
91 for (AlkOnlineQuotesProfile *profile : d->m_profiles) {
92 profiles.append(profile->name());
97void AlkOnlineQuotesProfileManager::setWebPage(
AlkWebPage *webPage)
102AlkWebPage *AlkOnlineQuotesProfileManager::webPage()
107void AlkOnlineQuotesProfileManager::setWebView(
AlkWebView *webView)
112AlkWebView *AlkOnlineQuotesProfileManager::webView()
117AlkOnlineQuotesProfileManager &AlkOnlineQuotesProfileManager::instance()
119 static AlkOnlineQuotesProfileManager manager;
123AlkOnlineQuotesProfileManager *AlkOnlineQuotesProfileManager::instancePointer()
The AlkWebPage class provides an object to load and view web documents to provide functionality like ...
The AlkWebView class provides a widget that is used to load and display web documents.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)