[PC-BSD Commits] r13766 - pcbsd/current/src-qt4/pc-controlpanel

svn at pcbsd.org svn at pcbsd.org
Thu Nov 10 03:01:21 PST 2011


Author: yurkis
Date: 2011-11-10 03:01:21 -0800 (Thu, 10 Nov 2011)
New Revision: 13766

Modified:
   pcbsd/current/src-qt4/pc-controlpanel/mainwnd.cpp
   pcbsd/current/src-qt4/pc-controlpanel/mainwnd.h
Log:
Seems like it will fix controlpanel freeze on refresh

Modified: pcbsd/current/src-qt4/pc-controlpanel/mainwnd.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-controlpanel/mainwnd.cpp	2011-11-10 10:45:06 UTC (rev 13765)
+++ pcbsd/current/src-qt4/pc-controlpanel/mainwnd.cpp	2011-11-10 11:01:21 UTC (rev 13766)
@@ -28,6 +28,7 @@
 #include "../config.h"
 
 #include <QFile>
+#include <iostream>
 
 
 #define ITEMS_PREFIX   PREFIX + "/share/pcbsd/pc-controlpanel/items/"
@@ -124,8 +125,10 @@
 ///////////////////////////////////////////////////////////////////////////////
 void MainWnd::fillGroups()
 {
-	bool isVisible;
+        mRefreshMutex.lock();
 
+        bool isVisible;
+
         ui->centralWidget->setEnabled(false);
         ui->statusBar->showMessage(tr("Reading items..."));
         QApplication::processEvents();
@@ -161,6 +164,8 @@
 
         ui->statusBar->clearMessage();
         ui->centralWidget->setEnabled(true);
+
+        mRefreshMutex.unlock();
 }
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: pcbsd/current/src-qt4/pc-controlpanel/mainwnd.h
===================================================================
--- pcbsd/current/src-qt4/pc-controlpanel/mainwnd.h	2011-11-10 10:45:06 UTC (rev 13765)
+++ pcbsd/current/src-qt4/pc-controlpanel/mainwnd.h	2011-11-10 11:01:21 UTC (rev 13766)
@@ -27,6 +27,7 @@
 
 #include <QMainWindow>
 #include <QFileSystemWatcher>
+#include <QMutex>
 
 #include "grouplist.h"
 
@@ -77,6 +78,8 @@
         bool             misWheelGroup;
         bool             misOperatorGroup;
 
+        QMutex          mRefreshMutex;
+
 private slots:
         void on_actionUnsupported_triggered();
         void on_actionXFCE_triggered();



More information about the Commits mailing list