From a34f7ad76fe02227cc59143d91dabb891c2e3605 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 13 Mar 2013 17:50:00 +0100 Subject: Support Activities Open links in new tab only if there is a window in the current activity/on the current desktop This code has been written by Jonathan Verner and reviewed (a bit) by me. Hope everyone will be happy now... BUG: 316322 REVIEWED-BY: adjam --- src/application.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/application.h') diff --git a/src/application.h b/src/application.h index 5db6b424..e1801345 100644 --- a/src/application.h +++ b/src/application.h @@ -45,9 +45,22 @@ class WebWindow; class WebTab; class WebPage; +#include + +#ifdef HAVE_KACTIVITIES +namespace KActivities { + class Consumer; +} +#endif + typedef QList< QWeakPointer > RekonqWindowList; typedef QList WebAppList; +#ifdef HAVE_KACTIVITIES +typedef QHash< QString, RekonqWindowList > ActivityTabsMap; +#endif + + // --------------------------------------------------------------------------------------------------------------- @@ -67,9 +80,23 @@ public: int newInstance(); static Application *instance(); - RekonqWindow *rekonqWindow(); + RekonqWindow *rekonqWindow(const QString & activityID = QString()); RekonqWindowList rekonqWindowList(); + /** + * @returns the list of windows associated with activity whose id is @param activityID + * @param activityID the ID of the activity (if empty, it is interpreted as the current activity) + * @note If activities are disabled, returns the function returns the list of all tabs. + */ + RekonqWindowList tabsForActivity(const QString & activityID = QString()); + + /** + * @returns the true if there are windows associated with activity whose id is @param activityID + * @param activityID the ID of the activity (if empty, it is interpreted as the current activity) + * @note If activities are disabled, returns true if there are any tabs. + */ + bool haveWindowsForActivity(const QString & activityID = QString()); + WebAppList webAppList(); void bookmarksToolbarToggled(bool); @@ -120,6 +147,12 @@ private Q_SLOTS: private: RekonqWindowList m_rekonqWindows; WebAppList m_webApps; + +#ifdef HAVE_KACTIVITIES + ActivityTabsMap m_activityRekonqWindowsMap; + KActivities::Consumer *m_activityConsumer; +#endif + }; #endif // APPLICATION_H -- cgit v1.2.1