KDE/kdebase/workspace/plasma/dataengines/tasks
Alain Boyer
alainboyer at gmail.com
Wed Dec 17 18:58:28 CET 2008
Hello,
I'm not sure that this is the best way to go about fixing the
onCurrentDesktop update. This fixes the tasks data engine but
libtaskmanager is still broken...
I have attached a patch that fixes the problem in libtaskmanager and
makes this commit (897412) no longer necessary. I'd like to ask those
more familiar with libtaskmanager if my changes make sense.
Also, there is still a minor problem with some of the calls to
Task::refresh() being munged by d->lastUpdate in libs/taskmanager/task.cpp.
Alain.
Thomas Schildknecht wrote:
> SVN commit 897412 by tschildknecht:
>
> Fix the onCurrentDesktop update
>
>
> M +16 -0 tasksengine.cpp
> M +1 -0 tasksengine.h
>
>
> --- trunk/KDE/kdebase/workspace/plasma/dataengines/tasks/tasksengine.cpp #897411:897412
> @@ -68,6 +68,7 @@
> connect(TaskManager::TaskManager::self(), SIGNAL(startupRemoved(StartupPtr)), this, SLOT(startupRemoved(StartupPtr)));
> connect(TaskManager::TaskManager::self(), SIGNAL(taskAdded(TaskPtr)), this, SLOT(taskAdded(TaskPtr)));
> connect(TaskManager::TaskManager::self(), SIGNAL(taskRemoved(TaskPtr)), this, SLOT(taskRemoved(TaskPtr)));
> + connect(TaskManager::TaskManager::self(), SIGNAL(desktopChanged(int)), this, SLOT(desktopChanged(int)));
> }
>
> void TasksEngine::startupAdded(StartupPtr startup)
> @@ -94,6 +95,21 @@
> removeSource(getTaskName(task));
> }
>
> +void TasksEngine::desktopChanged(int desktop)
> +{
> + Q_UNUSED(desktop);
> + QHashIterator <QString, Plasma::DataContainer*> it(containerDict());
> +
> + while (it.hasNext()) {
> + TaskSource *source = static_cast<TaskSource*>(it.next().value());
> + bool onCurrent = source->m_task->isOnCurrentDesktop();
> + if (source->data()["onCurrentDesktop"].toBool() != onCurrent) {
> + source->setData("onCurrentDesktop", onCurrent);
> + }
> + source->checkForUpdate();
> + }
> +}
> +
> void TasksEngine::addStartup(StartupPtr startup)
> {
> TaskSource *taskSource = new TaskSource(startup, this);
> --- trunk/KDE/kdebase/workspace/plasma/dataengines/tasks/tasksengine.h #897411:897412
> @@ -62,6 +62,7 @@
> void startupRemoved(StartupPtr startup);
> void taskAdded(TaskPtr task);
> void taskRemoved(TaskPtr task);
> + void desktopChanged(int desktop);
>
> private:
> friend class TaskSource;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tasks.diff
Type: text/x-diff
Size: 2456 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081217/6c179efe/attachment-0001.bin
More information about the Plasma-devel
mailing list