[PC-BSD Commits] r12227 - pcbsd/current/src-qt4/pc-sysinstaller
svn at pcbsd.org
svn at pcbsd.org
Mon Aug 22 07:49:02 PDT 2011
Author: kris
Date: 2011-08-22 07:49:02 -0700 (Mon, 22 Aug 2011)
New Revision: 12227
Modified:
pcbsd/current/src-qt4/pc-sysinstaller/sys-pkgmgmt.cpp
Log:
Make the installer "smarter" to automatically select the nvidia drivers to install when
we are using nvidia as the installer video driver
Modified: pcbsd/current/src-qt4/pc-sysinstaller/sys-pkgmgmt.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/sys-pkgmgmt.cpp 2011-08-22 14:28:51 UTC (rev 12226)
+++ pcbsd/current/src-qt4/pc-sysinstaller/sys-pkgmgmt.cpp 2011-08-22 14:49:02 UTC (rev 12227)
@@ -4,7 +4,25 @@
// Connect all the disk-related slots
void SysInstaller::initDesktopPkgs()
{
+ bool usingNVIDIA = false;
+ // Check if we are using NVIDIA driver and include it automatically
+ QFile file("/etc/X11/xorg.conf");
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+ return;
+
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+ if ( line.indexOf("nvidia") != -1 ) {
+ usingNVIDIA=true;
+ break;
+ }
+ }
+ file.close();
+ // Done with NVIDIA check
+
+
// Start by reading our list of desktop pkgs, and populate the GUI
// First look for "parent" apps
@@ -23,9 +41,12 @@
if ( listDeskPkgs.at(z).at(0) == "KDE" )
deskItem->setCheckState(0, Qt::Checked);
+
+ if ( listDeskPkgs.at(z).at(0) == "NVIDIA" && usingNVIDIA )
+ deskItem->setCheckState(0, Qt::Checked);
}
- // First look for "parent" apps
+ // Now look for child apps
for (int z=0; z < listDeskPkgs.count(); ++z)
if ( ! listDeskPkgs.at(z).at(3).isEmpty() ) {
QTreeWidgetItem *deskItem = new QTreeWidgetItem(QStringList() << listDeskPkgs.at(z).at(0) );
@@ -37,6 +58,9 @@
else
deskItem->setCheckState(0, Qt::Unchecked);
+ if ( listDeskPkgs.at(z).at(0) == "NVIDIA" && usingNVIDIA )
+ deskItem->setCheckState(0, Qt::Checked);
+
// Now locate the parent app
QTreeWidgetItemIterator it(treeWidgetDesktopPackages);
while (*it) {
More information about the Commits
mailing list