Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void AddContactDialog::interfaceChanged (  )  [protected, slot]

Controls the OK button by checking the dialog's widgets

It's called everytime that a change is made to one of the dialog's widgets, and checks if their contents are valid. Then enables or disables the OK button accordingly.

If you try to add a contact handle which doesn't pass basic mail validation (addresses like "" or "none" or "a@bc"), the MSN Servers disconnect you and send you a so called ".NET message" with the error details. This basic set of tests is more than enough to pass the server requirements.

Other than the usual address validation (see the Account::isValidEmail() method), MSN will kick you out if you try adding an address having ".co" as top level domain. So we ensure it has not. This is probably due to people keeping mistyping ".com" when adding people to their list - all random 2-character domains are allowed, except ".co".

Definition at line 119 of file addcontactdialog.cpp.

Referenced by AddContactDialog().

{
  const QString& emailAddress( emailAddressEdit_->text() );

  /**
   * If you try to add a contact handle which doesn't pass basic mail validation (addresses like "" or "none"
   * or "a@bc"), the MSN Servers disconnect you and send you a so called ".NET message" with the error details.
   * This basic set of tests is more than enough to pass the server requirements.
   *
   * Other than the usual address validation (see the Account::isValidEmail() method), MSN will kick you out if
   * you try adding an address having ".co" as top level domain. So we ensure it has not. This is probably due
   * to people keeping mistyping ".com" when adding people to their list - all random 2-character domains are
   * allowed, except ".co".
   */

  // If the mail address seems correct, accept it
  if( ! emailAddress.isEmpty()
  &&  Account::isValidEmail( emailAddress )
  &&  ! emailAddress.endsWith( ".co" ) )
  {
    enableButtonOk( true );
    return;
  }

  enableButtonOk( false );
}


Generated by  Doxygen 1.6.0   Back to index