#! /bin/sh

set -e

LASTVER="11.04.10"

if dpkg-maintscript-helper supports rm_conffile; then
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/applications/defaults.list "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/Thunar/volmanrc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/mount.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/actions-6.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/clock-5.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/launcher-2.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/launcher-3.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/pager-3.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/panels.xml "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/places-2.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/separator-3.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/systray-4.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/tasklist-2.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/xfce4-menu-1.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/xfce4-mixer-plugin-5.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/xfce4-orageclock-plugin-7.rc "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/exaile/settings.ini "$LASTVER" -- "$@"
  dpkg-maintscript-helper rm_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/panel/cpugraph-3.rc "$LASTVER" -- "$@"
fi

# Special care for the default panel config (lp: #747137)
if dpkg-maintscript-helper supports mv_conffile; then
  dpkg-maintscript-helper mv_conffile \
    /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml \
    /etc/xdg/xdg-xubuntu/xfce4/panel/default.xml 11.04.16 -- "$@"
fi

case "$1" in
  upgrade)
    if [ -x /usr/lib/gdm/gdm-set-default-session ] ; then
        /usr/lib/gdm/gdm-set-default-session --keep-old xubuntu || true
    fi
    ;;
  configure)
    if [ -x /usr/lib/gdm/gdm-set-default-session ] ; then
        /usr/lib/gdm/gdm-set-default-session --keep-old xubuntu || true
    fi
    ;;
esac

#DEBHELPER#
