Changeset 5968 for branches/newosd

Show
Ignore:
Timestamp:
12/21/07 05:02:43 (11 months ago)
Author:
eugene
Message:

It's way more sane to use std::string here...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newosd/src/iface.cpp

    r5966 r5968  
    11#include "iface.h" 
     2 
     3#include <string> 
    24 
    35#include <licq_icqd.h> 
     
    6264    return false; 
    6365 
    64   char* alias = strdup(u->GetAlias()); 
     66  string str = u->GetAlias(); 
    6567  gUserManager.DropUser(u); 
    66   alias = static_cast<char*>(realloc(alias, strlen(alias) + 3)); 
    67   strcat(alias, ": "); 
     68  str += ": "; 
    6869 
    69   pango_layout_set_text(trd.lay, alias, -1); 
     70  pango_layout_set_text(trd.lay, str.c_str(), -1); 
    7071  pango_layout_get_size(trd.lay, &tag_width, NULL); 
    7172  pango_layout_set_indent(trd.lay, -tag_width); 
    7273 
    73   char* x = "received\nthe\nsignal"; 
    74   alias = static_cast<char*>(realloc(alias, strlen(alias) + strlen(x) + 1)); 
    75   strcat(alias, x); 
     74  str += "received\nthe\nsignal"; 
    7675 
    77   pango_layout_set_text_aosd(trd.lay, alias); 
    78   free(alias); 
     76  pango_layout_set_text_aosd(trd.lay, const_cast<char*>(str.c_str())); 
    7977  pango_layout_get_size_aosd(trd.lay, &width, &height, &trd.lbearing); 
    8078