bool
PlatformUdisks2::isMounted(QString path)
{
    bool mounted = false;
    QStringList partitions = getPartitionList(path);
    foreach(QString partition, partitions)
    {
        if (isPartitionMounted(partition))
        {
            mounted = true;
            break;
        }
    }
    if (!mounted) {
	mounted = isPartitionMounted(QString("/org/freedesktop/UDisks2/block_devices/") + path);
    }

    return mounted;
}
bool
PlatformUdisks::isMounted(QString path)
{
    bool ret = false;
    QStringList partitionList = getPartitionList(path);

    for (int i = 0; i < partitionList.size(); ++i)
    {
        ret = isPartitionMounted(partitionList.at(i));
        if (ret)
            break;
    }

    return(ret);
}
bool
PlatformUdisks2::isMounted(QString path)
{
    bool mounted = false;
    QStringList partitions = getPartitionList(path);
    foreach(QString partition, partitions)
    {
        if (isPartitionMounted(partition))
        {
            mounted = true;
            break;
        }
    }

    return mounted;
}
bool
PlatformUdisks::unmountDevice (QString path)
{
    bool ret = true;
    QStringList partitionList = getPartitionList(path);

    for (int i = 0; i < partitionList.size(); ++i)
    {
        if (isPartitionMounted(partitionList.at(i)))
        {
            ret = performUnmount(partitionList.at(i));
            if (!ret)
                break;
        }
    }

    return(ret);
}
bool
PlatformUdisks2::unmountDevice(QString path)
{
    bool res = true;
    QStringList partitions = getPartitionList(path);
    if (partitions.empty())
    {
        res = doUnmount(QString("/org/freedesktop/UDisks2/block_devices/") + path);
    }
    else
    {
        foreach(QString partition, partitions)
        {
            if (isPartitionMounted(partition) && !doUnmount(partition))
            {
                res = false;
                break;
            }
        }
    }

    return(res);
}