Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/plugin/backend.cpp
Show All 39 Lines | |||||
40 | #include <QVersionNumber> | 40 | #include <QVersionNumber> | ||
41 | #include <QTimer> | 41 | #include <QTimer> | ||
42 | 42 | | |||
43 | #include <KActivities/Consumer> | 43 | #include <KActivities/Consumer> | ||
44 | #include <KActivities/Stats/Cleaning> | 44 | #include <KActivities/Stats/Cleaning> | ||
45 | #include <KActivities/Stats/ResultSet> | 45 | #include <KActivities/Stats/ResultSet> | ||
46 | #include <KActivities/Stats/Terms> | 46 | #include <KActivities/Stats/Terms> | ||
47 | 47 | | |||
48 | #include <processcore/process.h> | ||||
49 | #include <processcore/processes.h> | ||||
50 | | ||||
48 | namespace KAStats = KActivities::Stats; | 51 | namespace KAStats = KActivities::Stats; | ||
49 | 52 | | |||
50 | using namespace KAStats; | 53 | using namespace KAStats; | ||
51 | using namespace KAStats::Terms; | 54 | using namespace KAStats::Terms; | ||
52 | 55 | | |||
53 | Backend::Backend(QObject* parent) : QObject(parent) | 56 | Backend::Backend(QObject* parent) : QObject(parent) | ||
54 | , m_panelWinId(0) | 57 | , m_panelWinId(0) | ||
55 | , m_highlightWindows(false) | 58 | , m_highlightWindows(false) | ||
▲ Show 20 Lines • Show All 475 Lines • ▼ Show 20 Line(s) | |||||
531 | } | 534 | } | ||
532 | 535 | | |||
533 | void Backend::cancelHighlightWindows() | 536 | void Backend::cancelHighlightWindows() | ||
534 | { | 537 | { | ||
535 | m_windowsToHighlight.clear(); | 538 | m_windowsToHighlight.clear(); | ||
536 | updateWindowHighlight(); | 539 | updateWindowHighlight(); | ||
537 | } | 540 | } | ||
538 | 541 | | |||
542 | qint64 Backend::parentPid(qint64 pid) const | ||||
543 | { | ||||
544 | KSysGuard::Processes procs; | ||||
545 | procs.updateOrAddProcess(pid); | ||||
546 | | ||||
547 | KSysGuard::Process *proc = procs.getProcess(pid); | ||||
548 | if (!proc) { | ||||
549 | return -1; | ||||
550 | } | ||||
551 | | ||||
552 | return proc->parentPid(); | ||||
553 | } | ||||
554 | | ||||
539 | void Backend::windowsHovered(const QVariant &_winIds, bool hovered) | 555 | void Backend::windowsHovered(const QVariant &_winIds, bool hovered) | ||
540 | { | 556 | { | ||
541 | m_windowsToHighlight.clear(); | 557 | m_windowsToHighlight.clear(); | ||
542 | 558 | | |||
543 | if (hovered) { | 559 | if (hovered) { | ||
544 | const QVariantList &winIds = _winIds.toList(); | 560 | const QVariantList &winIds = _winIds.toList(); | ||
545 | 561 | | |||
546 | foreach(const QVariant &_winId, winIds) { | 562 | foreach(const QVariant &_winId, winIds) { | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |