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

void KNateon::saveUserDB (  ) 

초기화

Definition at line 3739 of file knateon.cpp.

References SQLiteDB::execOne(), CurrentAccount::getBuddyList(), CurrentAccount::getMyCyworldID(), CurrentAccount::getMyName(), CurrentAccount::getMyNateID(), CurrentAccount::getMyNickName(), BuddyBase::getName(), BuddyBase::getNick(), BuddyBase::getUID(), nmconfig::logintype, and pSQLiteDB.

Referenced by connected().

{
      /*! 초기화 */
      pSQLiteDB->execOne( sDataPath + "local_user.db", "delete from tb_user;" );

      m_pBuddyList = const_cast<BuddyList*>(m_pCurrentAccount->getBuddyList());

      QPtrListIterator<Buddy> iterator( *m_pBuddyList );
      Buddy *pBuddy;
      QString sQuery;

      sQuery = "INSERT INTO tb_user (ID, NAME, NICK, EMAIL) VALUES ('";
      if ( stConfig.logintype == 'C' )
            sQuery += m_pCurrentAccount->getMyCyworldID().utf8();
      else
            sQuery += m_pCurrentAccount->getMyNateID().utf8();
      sQuery += "', '";
      sQuery += m_pCurrentAccount->getMyName().utf8();
      sQuery += "', '";
      QString sNick( m_pCurrentAccount->getMyNickName() );
      sNick.replace("'", "''");
      sQuery += sNick.utf8();
      sQuery += "', '";
      sQuery += m_pCurrentAccount->getMyName().utf8();
      sQuery += " <";
      if ( stConfig.logintype == 'C' )
            sQuery += m_pCurrentAccount->getMyCyworldID().utf8();
      else
            sQuery += m_pCurrentAccount->getMyNateID().utf8();
      sQuery += ">');";
      pSQLiteDB->execOne( sDataPath + "local_user.db", sQuery );

      while(iterator.current() != 0)
      {
            pBuddy = iterator.current();
            sQuery = "INSERT INTO tb_user (ID, NAME, NICK, EMAIL) VALUES ('";
            sQuery += pBuddy->getUID().utf8();
            sQuery += "', '";
            sQuery += pBuddy->getName().utf8();
            sQuery += "', '";
            sNick = pBuddy->getNick();
            sNick.replace("'", "''");
            sQuery += sNick.utf8();
            sQuery += "', '";
            sQuery += pBuddy->getName().utf8();
            sQuery += " <";
            sQuery += pBuddy->getUID().utf8();
            sQuery += ">');";
            pSQLiteDB->execOne( sDataPath + "local_user.db", sQuery );

            ++iterator;
      }
}


Generated by  Doxygen 1.6.0   Back to index