var sal = new Activity("sal")
sal.screen = 0
sal.wallpaperPlugin = 'image'
sal.wallpaperMode = 'SingleImage'
sal.name = templateName

// -- Kubuntu Diff Starts Here -- //

// -------------------------------- FUNCTIONS ------------------------------- //

function writeFavorties(sal, favorites) {
    for (var i = 0; i < favorites.length; ++i) {
        sal.currentConfigGroup = new Array('stripwidget', 'favourite-' + i)
        sal.writeConfig("url", favorites[i])
    }
}

// ---------------------------------- SETUP --------------------------------- //

// This is used when using the bottom left toolbox of plasma-netbook. The editing
// bar will contain an entry to add applications which will launch the PackageManager.
sal.writeConfig("PackageManager", "muon-discover")

// Add the default favorites.
var favorites = new Array()
if (applicationExists("oem-config-prepare-kde.desktop")) {
    favorites.push(applicationPath("oem-config-prepare-kde.desktop"))
} else {
    if (applicationExists("ubiquity-kdeui.desktop")) {
        favorites.push(applicationPath("ubiquity-kdeui.desktop"))
    }
    var generalFavorites = new Array(
        applicationPath("firefox.desktop"),
        applicationPath("KMail2.desktop"),
        applicationPath("systemsettings.desktop"),
        applicationPath("dolphin.desktop")
    )
    favorites = favorites.concat(generalFavorites)
}

writeFavorties(sal, favorites)

sal.reloadConfig()
