[PC-BSD Commits] r19968 - in pcbsd/current/src-qt4: about-gui pc-controlpanel

svn at pcbsd.org svn at pcbsd.org
Fri Oct 26 05:29:21 PDT 2012


Author: yurkis
Date: 2012-10-26 12:29:21 +0000 (Fri, 26 Oct 2012)
New Revision: 19968

Modified:
   pcbsd/current/src-qt4/about-gui/mainwindow.cpp
   pcbsd/current/src-qt4/about-gui/mainwindow.h
   pcbsd/current/src-qt4/pc-controlpanel/pc-controlpanel.pro.user
Log:
Cosmetic code changes

Modified: pcbsd/current/src-qt4/about-gui/mainwindow.cpp
===================================================================
--- pcbsd/current/src-qt4/about-gui/mainwindow.cpp	2012-10-26 12:24:03 UTC (rev 19967)
+++ pcbsd/current/src-qt4/about-gui/mainwindow.cpp	2012-10-26 12:29:21 UTC (rev 19968)
@@ -139,6 +139,20 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////
+void MainWindow::addDEItem(QString name, QString version)
+{
+    QTreeWidgetItem* item = new QTreeWidgetItem(ui->DEList);
+    item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
+    QFont font = item->font(0);
+    font.setBold(true);
+    item->setFont(0, font);
+    item->setText(0, name);
+    item->setText(1, version);
+
+    ui->DEList->addTopLevelItem(item);
+}
+
+////////////////////////////////////////////////////////////////////////////
 void MainWindow::slotSingleInstance()
 {
     this->hide();
@@ -181,15 +195,7 @@
             QString ver;
             if (checkNGPackage(DEComponentsNG[i].Prefix, ver))
             {
-                QTreeWidgetItem* item = new QTreeWidgetItem(ui->DEList);
-                item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-                QFont font = item->font(0);
-                font.setBold(true);
-                item->setFont(0, font);
-                item->setText(0, DEComponentsNG[i].Name);
-                item->setText(1, ver);
-
-                ui->DEList->addTopLevelItem(item);
+                addDEItem(DEComponentsNG[i].Name, ver);
             }
         }//for all DEs
     }//if pkgng installed
@@ -215,17 +221,9 @@
         {
             if (0 == line.indexOf(DEComponents[i].Prefix, Qt::CaseInsensitive))
             {
-                QTreeWidgetItem* item = new QTreeWidgetItem(ui->DEList);
-                item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
-                QFont font = item->font(0);
-                font.setBold(true);
-                item->setFont(0, font);
-                item->setText(0, DEComponents[i].Name);
                 line = line.replace(DEComponents[i].Prefix, "");
                 line= line.left(line.indexOf(" "));
-                item->setText(1, line);
-
-                ui->DEList->addTopLevelItem(item);
+                addDEItem(DEComponents[i].Name, line);
             }//if got DE
         }//for all DEs
     }// while can read line

Modified: pcbsd/current/src-qt4/about-gui/mainwindow.h
===================================================================
--- pcbsd/current/src-qt4/about-gui/mainwindow.h	2012-10-26 12:24:03 UTC (rev 19967)
+++ pcbsd/current/src-qt4/about-gui/mainwindow.h	2012-10-26 12:29:21 UTC (rev 19968)
@@ -42,6 +42,7 @@
     
     bool checkNG();
     bool checkNGPackage(QString name, QString& outVer);
+    void addDEItem(QString name, QString version);
 
 public slots:
     void slotSingleInstance();

Modified: pcbsd/current/src-qt4/pc-controlpanel/pc-controlpanel.pro.user
===================================================================
--- pcbsd/current/src-qt4/pc-controlpanel/pc-controlpanel.pro.user	2012-10-26 12:24:03 UTC (rev 19967)
+++ pcbsd/current/src-qt4/pc-controlpanel/pc-controlpanel.pro.user	2012-10-26 12:29:21 UTC (rev 19968)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.5.0, 2012-10-02T15:28:16. -->
+<!-- Written by Qt Creator 2.5.0, 2012-10-12T18:41:10. -->
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>



More information about the Commits mailing list