GUI: Show ideal thread count next to current thread count.

Ideal thread count is determined by Qt as number of available cores.
Ticket: #2194 (Automatically match thread count to available cores)
This commit is contained in:
Kimmo Varis 2010-12-27 18:00:44 +02:00
parent e8b81f909d
commit 46c03973ee
2 changed files with 21 additions and 0 deletions

View File

@ -103,6 +103,20 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Ideal count:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mLblIdealThreads">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">

View File

@ -26,6 +26,7 @@
#include <QTabWidget>
#include <QSettings>
#include <QFileDialog>
#include <QThread>
#include "settingsdialog.h"
#include "applicationdialog.h"
#include "applicationlist.h"
@ -70,6 +71,12 @@ SettingsDialog::SettingsDialog(QSettings *programSettings,
mUI.mListWidget->setSortingEnabled(false);
PopulateListWidget();
const int count = QThread::idealThreadCount();
if (count != -1)
mUI.mLblIdealThreads->setText(QString::number(count));
else
mUI.mLblIdealThreads->setText(tr("N/A"));
LoadSettings();
}