[PC-BSD Commits] r17203 - pcbsd/current/src-qt4/pc-firstbootgui

svn at pcbsd.org svn at pcbsd.org
Tue Jun 5 09:21:31 PDT 2012


Author: kris
Date: 2012-06-05 16:21:29 +0000 (Tue, 05 Jun 2012)
New Revision: 17203

Modified:
   pcbsd/current/src-qt4/pc-firstbootgui/firstboot.cpp
Log:

Fix how we auto-gen names, if only given single name, don't add extra single char to font



Modified: pcbsd/current/src-qt4/pc-firstbootgui/firstboot.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-firstbootgui/firstboot.cpp	2012-06-05 13:56:53 UTC (rev 17202)
+++ pcbsd/current/src-qt4/pc-firstbootgui/firstboot.cpp	2012-06-05 16:21:29 UTC (rev 17203)
@@ -66,8 +66,10 @@
   if ( ! lineUsername->text().isEmpty() || lineName->text().isEmpty() )
     return;
   QString name;
-  name = lineName->text().section(' ', 0, 0).toLower();
-  name.truncate(1);
+  if ( lineName->text().indexOf(" ") != -1 ) {
+    name = lineName->text().section(' ', 0, 0).toLower();
+    name.truncate(1);
+  }
   name = name + lineName->text().section(' ', -1, -1).toLower();
   lineUsername->setText(name);
 }



More information about the Commits mailing list