Skip to content

Commit

Permalink
GUI: Show ideal thread count next to current thread count.
Browse files Browse the repository at this point in the history
Ideal thread count is determined by Qt as number of available cores.
Ticket: #2194 (Automatically match thread count to available cores)
  • Loading branch information
kimmov committed Dec 27, 2010
1 parent e8b81f9 commit 46c0397
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gui/settings.ui
Expand Up @@ -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">
Expand Down
7 changes: 7 additions & 0 deletions gui/settingsdialog.cpp
Expand Up @@ -26,6 +26,7 @@
#include <QTabWidget>
#include <QSettings>
#include <QFileDialog>
#include <QThread>
#include "settingsdialog.h"
#include "applicationdialog.h"
#include "applicationlist.h"
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 46c0397

Please sign in to comment.