/***************************************************************************
 *   Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl>                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#include "./configuration.h"

Configuration::Configuration(const QString& host) : HostSettings(host) {
    
}

QList<QByteArray> Configuration::arguments() const {
  QList<QByteArray> ret;
  if (compression()) ret+="-C";
  if (iPProtocol()==EnumIPProtocol::v4) ret+="-4";
  if (iPProtocol()==EnumIPProtocol::v6) ret+="-6";
  if (sSHProtocol()==EnumSSHProtocol::v2) ret+="-2";
  if (sSHProtocol()==EnumSSHProtocol::v1) ret+="-1";
  if (x11Forward()) 
    if (x11Trusted()) ret+="-Y"; else ret+="-X";

  // IDN form, always latin1
  Q_FOREACH (const QString& f, forwards()) 
    ret+=f.toLatin1();
  return ret;
}