Hi!

Small cosmetic patch: When no surname and lastname is set for a user (or
only one of two), Licq show "alias ()", "alias ( lastname)" or "alias
(surname )" as the window title. The patch cleans this up.
diff -ur licq-20030730/plugins/qt-gui/src/usereventdlg.cpp licq-20030730-jm/plugins/qt-gui/src/usereventdlg.cpp
--- licq-20030730/plugins/qt-gui/src/usereventdlg.cpp	2003-07-04 07:47:45.000000000 +0200
+++ licq-20030730-jm/plugins/qt-gui/src/usereventdlg.cpp	2003-08-01 22:37:54.000000000 +0200
@@ -532,9 +532,16 @@
   else
     btnSecure->setPixmap(mainwin->pmSecureOff);
 
-  m_sBaseTitle = codec->toUnicode(u->GetAlias()) + " (" +
-             codec->toUnicode(u->GetFirstName()) + " " +
-             codec->toUnicode(u->GetLastName())+ ")";
+  QString tmp = codec->toUnicode(u->GetFirstName());
+  QString lastname = codec->toUnicode(u->GetLastName());
+  if ((!tmp.isEmpty()) && (!lastname.isEmpty()))
+    tmp = tmp + " " + lastname;
+  else
+    tmp = tmp + lastname;
+  if (!tmp.isEmpty()) tmp = " (" + tmp + ")";
+
+  m_sBaseTitle = codec->toUnicode(u->GetAlias()) + tmp;
+
 #if QT_VERSION >= 300
   if (mainwin->userEventTabDlg &&
       mainwin->userEventTabDlg->tabIsSelected(this))
diff -ur licq-20030730/plugins/qt-gui/src/userinfodlg.cpp licq-20030730-jm/plugins/qt-gui/src/userinfodlg.cpp
--- licq-20030730/plugins/qt-gui/src/userinfodlg.cpp	2003-07-09 07:49:04.000000000 +0200
+++ licq-20030730-jm/plugins/qt-gui/src/userinfodlg.cpp	2003-08-01 22:39:47.000000000 +0200
@@ -149,7 +149,17 @@
   else
   {
     QTextCodec * codec = UserCodec::codecForICQUser(u);
-    m_sBasic = tr("Licq - Info ") + codec->toUnicode(u->GetAlias()) + " (" + codec->toUnicode(u->GetFirstName()) + " " + codec->toUnicode(u->GetLastName()) + ")";
+
+    QString tmp = codec->toUnicode(u->GetFirstName());
+    QString lastname = codec->toUnicode(u->GetLastName());
+    if ((!tmp.isEmpty()) && (!lastname.isEmpty()))
+      tmp = tmp + " " + lastname;
+    else
+      tmp = tmp + lastname;
+    if (!tmp.isEmpty()) tmp = " (" + tmp + ")";
+
+    m_sBasic = tr("Licq - Info ") + codec->toUnicode(u->GetAlias()) + tmp;
+
     resetCaption();
     setIconText(codec->toUnicode(u->GetAlias()));
     gUserManager.DropUser(u);
@@ -253,7 +263,17 @@
   else
   {
     QTextCodec * codec = UserCodec::codecForICQUser(u);
-    m_sBasic = tr("Licq - Info ") + codec->toUnicode(u->GetAlias()) + " (" + codec->toUnicode(u->GetFirstName()) + " " + codec->toUnicode(u->GetLastName()) + ")";
+
+    QString tmp = codec->toUnicode(u->GetFirstName());
+    QString lastname = codec->toUnicode(u->GetLastName());
+    if ((!tmp.isEmpty()) && (!lastname.isEmpty()))
+      tmp = tmp + " " + lastname;
+    else
+      tmp = tmp + lastname;
+    if (!tmp.isEmpty()) tmp = " (" + tmp + ")";
+
+    m_sBasic = tr("Licq - Info ") + codec->toUnicode(u->GetAlias()) + tmp;
+
     resetCaption();
     setIconText(codec->toUnicode(u->GetAlias()));
     gUserManager.DropUser(u);
ciao
  Jörg

Reply via email to