[PC-BSD Commits] r22062 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Thu Apr 4 08:54:05 PDT 2013


Author: kenmoore
Date: 2013-04-04 15:54:05 +0000 (Thu, 04 Apr 2013)
New Revision: 22062

Modified:
   pcbsd-projects/PCDM/pcdm-gui.cpp
   pcbsd-projects/PCDM/pcdm-gui.h
Log:
Try to fix the hostname detection



Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2013-04-04 15:15:29 UTC (rev 22061)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2013-04-04 15:54:05 UTC (rev 22062)
@@ -170,9 +170,6 @@
     tmpIcon = currentTheme->itemIcon("password");
     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/password.png"; }
     loginW->changeButtonIcon("pwview",tmpIcon, currentTheme->itemIconSize("password"));
-    //Display the Hostname
-    QString hostname = QProcessEnvironment::systemEnvironment().value("HOST");
-    loginW->displayHostName(hostname);
     //Enable/disable the password view functionality
     loginW->allowPasswordView( Config::allowPasswordView() );
     //Add item to the grid
@@ -418,6 +415,11 @@
     if(DEBUG_MODE){systemMenu->addAction( tr("Close PCDM"), this, SLOT(slotClosePCDM()) ); }
     systemButton->setMenu(systemMenu);
   //The main login widget
+  if(hostname.isEmpty()){
+    //Find the system hostname
+    hostname = Utils::runShellCommand("hostname").join(" ").simplified();
+    loginW->displayHostName(hostname);	  
+  }
   loginW->retranslateUi();
   //The desktop switcher
   deSwitcher->removeAllItems();

Modified: pcbsd-projects/PCDM/pcdm-gui.h
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.h	2013-04-04 15:15:29 UTC (rev 22061)
+++ pcbsd-projects/PCDM/pcdm-gui.h	2013-04-04 15:54:05 UTC (rev 22062)
@@ -20,7 +20,6 @@
 #include <QPushButton>
 #include <QLineEdit>
 #include <QGridLayout>
-#include <QX11EmbedContainer>
 #include <QSpacerItem>
 #include <QProcessEnvironment>
 
@@ -68,12 +67,13 @@
     QMenu* systemMenu;
     FancySwitcher* deSwitcher;
 
-    //QX11EmbedContainer* container;
     QProcess* vkbd;
     ThemeStruct* currentTheme;
 
     QTranslator* m_translator;
     QString translationDir, lastUser, lastDE;
+    
+    QString hostname;
     //Functions
     void createGUIfromTheme();
     void retranslateUi();



More information about the Commits mailing list