KDE/kdebase/workspace/plasma/dataengines/tasks

Christian Mollekopf chrigi_1 at fastmail.fm
Wed Dec 17 21:42:29 CET 2008


Am 17.12.2008, 18:58 Uhr, schrieb Alain Boyer <alainboyer at gmail.com>:

> 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.

This makes sense to me, though i think making Task::refresh() a slot and  
connecting to the
desktopChanged signal would be nicer...

Regards,

Christian

>
> 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;



-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/


More information about the Plasma-devel mailing list