/** * @brief Event method that is fired when connection type is changed * * Event method that fires when connection type checkbox is changed. It updates the model data with the setConnectionType method. * @return void **/ static void connectionTypeChanged (GtkCheckButton* checkButton, gpointer user_data) { gboolean isChecked = gtk_toggle_button_get_active (checkButton); if(isChecked == TRUE){ printDebugText("Checked"); setConnectionType('P'); } else { setConnectionType('S'); } }
KMSmtpClient::KMSmtpClient(const QString &host, quint16 port, KMSmtpClient::ConnectionType ct, QObject *parent) : KMAbstractSenderClient(parent) { //Set the host url. setHost(host); //Set the port to be user configuration. setPort(port); //Set the connection type to rebuild the socket. setConnectionType(ct); }
SmtpClient::SmtpClient(const QString & host, int port, ConnectionType connectionType) : name("localhost"), authMethod(AuthPlain), connectionTimeout(5000), responseTimeout(5000) { setConnectionType(connectionType); this->host = host; this->port = port; connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState))); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead())); }
void NetworkManager::ConnectionSettings::fromMap(const NMVariantMapMap &map) { QVariantMap connectionSettings = map.value(QLatin1String(NM_SETTING_CONNECTION_SETTING_NAME)); setId(connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_ID)).toString()); setUuid(connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_UUID)).toString()); setConnectionType(typeFromString(connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_TYPE)).toString())); if (connectionSettings.contains(QLatin1String(NM_SETTING_CONNECTION_INTERFACE_NAME))) { setInterfaceName(connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_INTERFACE_NAME)).toString()); } if (connectionSettings.contains(QLatin1String(NM_SETTING_CONNECTION_PERMISSIONS))) { QStringList permissions = connectionSettings.value(QLatin1String(NM_SETTING_CONNECTION_PERMISSIONS)).toStringList(); Q_FOREACH (const QString & permission, permissions) { const QStringList split = permission.split(QLatin1String(":"), QString::KeepEmptyParts); addToPermissions(split.at(1), split.at(2)); } }
NetworkManager::ConnectionSettings::ConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &other) : d_ptr(new ConnectionSettingsPrivate(this)) { Q_D(ConnectionSettings); setId(other->id()); setUuid(other->uuid()); setInterfaceName(other->interfaceName()); setConnectionType(other->connectionType()); setPermissions(other->permissions()); setAutoconnect(other->autoconnect()); setAutoconnectPriority(other->autoconnectPriority()); setTimestamp(other->timestamp()); setReadOnly(other->readOnly()); setZone(other->zone()); setMaster(other->master()); setSlaveType(other->slaveType()); setGatewayPingTimeout(other->gatewayPingTimeout()); d->initSettings(other); }
NetworkManager::ConnectionSettings::ConnectionSettings(NetworkManager::ConnectionSettings::ConnectionType type, NMBluetoothCapabilities bt_cap) : d_ptr(new ConnectionSettingsPrivate(this)) { setConnectionType(type, bt_cap); }