#!/bin/sh


# workaround for bug #7306

URI_ACTION='toshl=toshldaemon.desktop'
DEFAULTS_FILE=/usr/share/applications/uri-action-defaults.list
SED_LINE="/${URI_ACTION}/ d"

echo "Checking uri-action-defaults.list"
IS_THERE=`grep -m 1 -c $URI_ACTION $DEFAULTS_FILE`
if [ $IS_THERE -gt 0 ]; then
    echo "Modifying file"
    sed -i '/toshl=toshldaemon.desktop/ d' $DEFAULTS_FILE
fi

# this is what usability department insists upon
ASSUMED_DBFILE='/home/user/.toshl/toshl.db'
if [ $1 == 'remove' ]; then
    if [ -f $ASSUMED_DBFILE ]; then
        rm $ASSUMED_DBFILE
    fi
fi

exit 0