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

void ChatCore::slot_loadProfile ( const QString &  name  )  [slot]

setting the profile with name $name(if it exists) to be current profile

Parameters:
name name of profile to load

Definition at line 936 of file chatcore.cpp.

References UserProfile::info(), UserProfile::prefs(), UserInfo::setCompName(), and UserInfo::setNickname().

{
  UserProfile* profile = m_profiles[name];
  QByteArray   data;
  QImage       pix;

  if(profile)
  {
    qDebug("[ChatCore::loadProfile]: %s", name.toLocal8Bit().data());

    m_currentProfile = profile;

    m_myInfo = profile->info();
    m_prefs  = profile->prefs();

    m_myInfo->setCompName(QHostInfo::localHostName());

    Globals::setInfo (m_myInfo);
    Globals::setPrefs(m_prefs);
  }

  else
  {
    m_myInfo = new UserInfo;
    m_prefs  = new Preferences;
    profile  = new UserProfile(name, m_prefs, m_myInfo);

    m_currentProfile = profile;

    Globals::setPrefs(m_prefs);
    Globals::setInfo(m_myInfo);

    m_profiles.insert(name, profile);

    m_myInfo->setNickname(name);
  }

  Globals::setProfileName(name);

  emit profileLoaded(name);
}


Generated by  Doxygen 1.6.0   Back to index