Changing the Web browsers cache setting through dcop

Michael Stucki michael at typo3.org
Fri Nov 24 17:13:47 GMT 2006


Hi Kevin,

>> I have written a small script that checks for a network connection during
>> suspend/resume.
>>
>> If there is no network, kmail will be configured to be offline, for
>> example.
>>
>> Now I would like to configure the konqueror cache in a same way. I can
>> change this setting through
>>
>> kcontrol -> Internet & Network -> Web Browser -> Cache
>>
>> However, I didn't find a way to control this via dcop. Does anybody know
>> if it is possible?
> 
> Cache settings could be part of a configuration file, possibly one for the
> IO slaves.
> 
> One can use kwriteconfig to change values in those files, however having
> application reload them might be difficult (possible though, there is a
> script on kde-apps.org which does this to re-read proxy settings)

Yeah, that was very helpful. The problem is solved.

For the records, here is my little script to change a config setting and
reparse all konquerors afterwards:

=== cut ===
#!/bin/sh

case $1 in
        offline) ACTION="offline" && VALUE="CacheOnly" ;;
        *)       ACTION="online" && VALUE="Refresh" ;;
esac

echo "Going $ACTION..."

# Changing configuration
sed -i s/^cache=.*/cache=$VALUE/ ~/.kde/share/config/kio_httprc

# Fetch a list of all running kde applications
APPS=$(dcop)

# Define which apps you would like to apply the setting to
# (other applications will not notice the change before the next restart)
APPLYTO="konqueror kcontrol"

for i in ${APPS}; do
 echo "$APPLYTO" | grep -vq "$(echo $i | sed -e 's/-[0-9]*$//')" && continue
 # echo "Using $i ..."
 dcop $i KIO::Scheduler reparseSlaveConfiguration http # 2>/dev/null
done

=== cut ===

Regards, michael

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list