[Nepomuk] Disabling the automatic watching of resources

David Faure faure at kde.org
Tue Jan 22 09:30:56 UTC 2013


kmail/tagactionmanager.cpp has this code, in 
TagActionManager::updateActionStates(), which is called every time the 
selected message changes:

[...]
  {
       Nepomuk2::Tag tag( it.key() );
       it.value()->setChecked( false );   
       it.value()->setEnabled( true );
       it.value()->setText( i18n("Toggle Message Tag %1", tag.label() ) );
  }
[...]

The call to label() calls Nepomuk2::ResourceData::property() -> 
Nepomuk2::ResourceData::load() -> Nepomuk2::ResourceData::addToWatcher() -> 
DBus call to "start".

All this for a resource that is going to be deleted immediately afterwards.
Am I right that this is kind of pointless?

Could we either:

1) not watch resources by default, and let apps toggle it on when wanted?
This wouldn't be "behavior compatible" though, so I suppose it's arguable if 
this should be done in 4.x. However I don't really know in which cases 
resources change, so I don't know if most users of a resource care, or don't 
care. What's a resource anyway? Clearly tags are, I suppose emails are, what 
else?

2) add a setWatchEnabled(false) method, and sprinkle that over every use of 
nepomuk resources that are temporary like the above.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Nepomuk mailing list