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

svn at pcbsd.org svn at pcbsd.org
Tue Jul 24 11:18:41 PDT 2012


Author: kenmoore
Date: 2012-07-24 18:18:41 +0000 (Tue, 24 Jul 2012)
New Revision: 17914

Modified:
   pcbsd-projects/PCDM/fancySwitcher.cpp
   pcbsd-projects/PCDM/fancySwitcher.h
   pcbsd-projects/PCDM/pcdm-gui.cpp
Log:
Fix the FancySwitcher seg fault issue, now just need to get it displaying properly.



Modified: pcbsd-projects/PCDM/fancySwitcher.cpp
===================================================================
--- pcbsd-projects/PCDM/fancySwitcher.cpp	2012-07-24 18:10:19 UTC (rev 17913)
+++ pcbsd-projects/PCDM/fancySwitcher.cpp	2012-07-24 18:18:41 UTC (rev 17914)
@@ -16,11 +16,12 @@
   //Create the Grid layout
   QGridLayout* layout = new QGridLayout();
   //Add the buttons to the grid (back is always left/up)
-  QPushButton* pushForward = new QPushButton;
-  QPushButton* pushBack = new QPushButton;
-  QGraphicsView* iconViewer = new QGraphicsView();
+  pushForward = new QPushButton;
+  pushBack = new QPushButton;
+  iconViewer = new QGraphicsView();
   pushForward->setIconSize(QSize(iconSize,iconSize));
   pushBack->setIconSize(QSize(iconSize,iconSize));
+  qDebug() << "Set the orientation and images";
   if(isHorizontal){
     pushBack->setIcon(QIcon(":images/left.png"));
     pushForward->setIcon(QIcon(":images/right.png"));
@@ -141,9 +142,11 @@
 
 void FancySwitcher::checkButtons(){
   //Sanity check the current item value
+  qDebug() << "Check item limits";
   if(item > (idL.length()-1)){ item = idL.length()-1; }
   if(item < 0){ item = 0; }
   //Enable/Disable the pushbuttons as appropriate
+  qDebug() << "enable/disable the buttons";
   if(item == (idL.length()-1)){ pushForward->setEnabled(FALSE); }
   else{ pushForward->setEnabled(TRUE); }
   if(item == 0){ pushBack->setEnabled(FALSE); }

Modified: pcbsd-projects/PCDM/fancySwitcher.h
===================================================================
--- pcbsd-projects/PCDM/fancySwitcher.h	2012-07-24 18:10:19 UTC (rev 17913)
+++ pcbsd-projects/PCDM/fancySwitcher.h	2012-07-24 18:18:41 UTC (rev 17914)
@@ -37,7 +37,9 @@
 	QPushButton* pushForward;
 	QGraphicsView* iconViewer;
 	QGraphicsScene* scene;
-	QStringList idL,ttL,icL;
+	QStringList idL;
+	QStringList ttL;
+	QStringList icL;
 	int item, oldItem;
 	bool isHorizontal;
 	int iconSize;

Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2012-07-24 18:10:19 UTC (rev 17913)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2012-07-24 18:18:41 UTC (rev 17914)
@@ -5,6 +5,7 @@
 #include "pcdm-gui.h"
 #include "pcdm-backend.h"
 #include "pcdm-themes.h"
+#include "fancySwitcher.h"
 
 bool DEBUG_MODE=TRUE;
 
@@ -166,7 +167,7 @@
     //----Desktop Environment Switcher
       //NOTE: This will be changed to a "fancy" switcher later)
     QString deLayout = Theme::objectIconStyle("desktop");
-    FancySwitcher* deSwitcher = new FancySwitcher;
+    FancySwitcher* deSwitcher = new FancySwitcher(this);
    // QComboBox* deSwitcher = new QComboBox;
    QStringList deList = Backend::getAvailableDesktops();
     qDebug() << "At setup for deSwitcher";



More information about the Commits mailing list