mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Dolphin reporting opened locations to activity manager
This commit is contained in:
parent
ddba0bcc3b
commit
8268c0813a
|
@ -233,6 +233,13 @@ if (Nepomuk_FOUND)
|
|||
)
|
||||
endif (Nepomuk_FOUND)
|
||||
|
||||
if (KActivities_FOUND)
|
||||
target_link_libraries(
|
||||
kdeinit_dolphin
|
||||
${KACTIVITIES_LIBRARY}
|
||||
)
|
||||
endif (KActivities_FOUND)
|
||||
|
||||
install(TARGETS kdeinit_dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(TARGETS dolphin ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@
|
|||
#include <KUrlNavigator>
|
||||
#include <KRun>
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
#include <KActivities/ResourceInstance>
|
||||
#endif
|
||||
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "filterbar/filterbar.h"
|
||||
#include "search/dolphinsearchbox.h"
|
||||
|
@ -64,6 +68,9 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
|
|||
m_statusBarTimer(0),
|
||||
m_statusBarTimestamp(),
|
||||
m_autoGrabFocus(true)
|
||||
#ifdef KActivities_FOUND
|
||||
, m_activityResourceInstance(0)
|
||||
#endif
|
||||
{
|
||||
hide();
|
||||
|
||||
|
@ -157,6 +164,14 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
|
|||
m_topLayout->addWidget(m_statusBar);
|
||||
|
||||
setSearchModeEnabled(isSearchUrl(url));
|
||||
|
||||
// Initialize kactivities resource instance
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
m_activityResourceInstance = new KActivities::ResourceInstance(
|
||||
window()->winId(), url);
|
||||
m_activityResourceInstance->setParent(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
DolphinViewContainer::~DolphinViewContainer()
|
||||
|
@ -172,6 +187,14 @@ void DolphinViewContainer::setActive(bool active)
|
|||
{
|
||||
m_urlNavigator->setActive(active);
|
||||
m_view->setActive(active);
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
if (active) {
|
||||
m_activityResourceInstance->notifyFocusedIn();
|
||||
} else {
|
||||
m_activityResourceInstance->notifyFocusedOut();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool DolphinViewContainer::isActive() const
|
||||
|
@ -338,6 +361,10 @@ void DolphinViewContainer::setUrl(const KUrl& newUrl)
|
|||
if (newUrl != m_urlNavigator->locationUrl()) {
|
||||
m_urlNavigator->setLocationUrl(newUrl);
|
||||
}
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
m_activityResourceInstance->setUri(newUrl);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DolphinViewContainer::setFilterBarVisible(bool visible)
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
#include <QWidget>
|
||||
|
||||
#include <views/dolphinview.h>
|
||||
#include <config-apps.h>
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
namespace KActivities {
|
||||
class ResourceInstance;
|
||||
}
|
||||
#endif
|
||||
|
||||
class FilterBar;
|
||||
class KMessageWidget;
|
||||
|
@ -308,6 +315,11 @@ private:
|
|||
QTimer* m_statusBarTimer; // Triggers a delayed update
|
||||
QElapsedTimer m_statusBarTimestamp; // Time in ms since last update
|
||||
bool m_autoGrabFocus;
|
||||
|
||||
#ifdef KActivities_FOUND
|
||||
private:
|
||||
KActivities::ResourceInstance * m_activityResourceInstance;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // DOLPHINVIEWCONTAINER_H
|
||||
|
|
Loading…
Reference in a new issue