void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout)
{

    m_mountDetailsContainer = new Utils::DetailsWidget(this);
    QWidget *mountViewWidget = new QWidget;
    m_mountDetailsContainer->setWidget(mountViewWidget);
    mainLayout->addWidget(m_mountDetailsContainer);
    QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
    m_mountWarningLabel = new QLabel;
    mountViewLayout->addWidget(m_mountWarningLabel);
    QHBoxLayout *tableLayout = new QHBoxLayout;
    mountViewLayout->addLayout(tableLayout);
    m_mountView = new QTableView;
    m_mountView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
    m_mountView->setSelectionBehavior(QTableView::SelectRows);
    m_mountView->setModel(m_runConfiguration->remoteMounts());
    tableLayout->addWidget(m_mountView);
    QVBoxLayout *mountViewButtonsLayout = new QVBoxLayout;
    tableLayout->addLayout(mountViewButtonsLayout);
    QToolButton *addMountButton = new QToolButton;
    QIcon plusIcon;
    plusIcon.addFile(QLatin1String(Core::Constants::ICON_PLUS));
    addMountButton->setIcon(plusIcon);
    mountViewButtonsLayout->addWidget(addMountButton);
    m_removeMountButton = new QToolButton;
    QIcon minusIcon;
    minusIcon.addFile(QLatin1String(Core::Constants::ICON_MINUS));
    m_removeMountButton->setIcon(minusIcon);
    mountViewButtonsLayout->addWidget(m_removeMountButton);
    mountViewButtonsLayout->addStretch(1);

    connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount()));
    connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount()));
    connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this,
        SLOT(changeLocalMountDir(QModelIndex)));
    connect(m_mountView->selectionModel(),
        SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
        SLOT(enableOrDisableRemoveMountSpecButton()));
    connect(m_runConfiguration->remoteMounts(),
        SIGNAL(rowsInserted(QModelIndex, int, int)), this,
        SLOT(handleRemoteMountsChanged()));
    connect(m_runConfiguration->remoteMounts(),
        SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
        SLOT(handleRemoteMountsChanged()));
    connect(m_runConfiguration->remoteMounts(),
        SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
        SLOT(handleRemoteMountsChanged()));
    connect(m_runConfiguration->remoteMounts(), SIGNAL(modelReset()), this,
        SLOT(handleRemoteMountsChanged()));
    enableOrDisableRemoveMountSpecButton();
    handleRemoteMountsChanged();
}
//nparams: user_ip
return_type sMount(const int nparams, arg_type* a) {	
 //    if (nparams != 2) {
	// 	r.return_val = NULL;
	// 	r.return_size = 0;
	// 	return r;
	// }

    char *user_ip = (char *)a->arg_val;
    char *alias  = (char *)a->next->arg_val;

    MountedUser *mounted = findMount(user_ip, alias);
    if(debug)printf("Mounted address: %p\n", mounted);

    if(debug)printMount();
    if (mounted != NULL) {
        if(debug) printf("Mounted is not NULL\n");
        return createReturn(13, -1);
    }

    addMount(user_ip, alias);

    return createReturn(0, 0);
}