Back to index

im-sdk  12.3.91
IMUser.cpp
Go to the documentation of this file.
00001 #include <config.h>
00002 #include <stdio.h>
00003 #include "IMUser.hh"
00004 #include "IMLog.hh"
00005 
00006 IMDesktop*
00007 IMUser::request_desktop(
00008     IMDesktop::IMDesktopAttr &attr
00009 )
00010 {
00011     IMDesktop *pd;
00012     IMDesktopList::iterator it;
00013 
00014     for (it = desklist.begin(); it != desklist.end(); it++) {
00015        pd = *it;
00016        if (pd->match(attr)) {
00017            LOG_DEBUG("Found the existing desktop:%s",
00018                     pd->get_desktop_display_name().c_str());
00019            return pd;
00020        }
00021     }
00022     pd = new IMDesktop(this, attr);
00023     LOG_DEBUG("Create new IMDesktop for %s",
00024              pd->get_desktop_display_name().c_str());
00025     if (!pd) return NULL;
00026     desklist.push_back(pd);
00027 
00028     return pd;
00029 }
00030 
00031 
00032 
00033 IMUser::IMUser(
00034     const u16string &x_username
00035 )
00036 {
00037     username = x_username;
00038 }
00039 
00040 IMUser::~IMUser()
00041 {
00042     delete_all(desklist);
00043 }
00044 
00045 /* Local Variables: */
00046 /* c-file-style: "iiim-project" */
00047 /* End: */