29 #include <QThreadPool> 44 void Preference::Load(
const QString &file) {
54 QString(
"The preference file %1 was not found or does not exist").arg(file),
60 for(
int i = 0; i < pvl.
groups(); i++) {
64 for(
int k = 0; k < inGroup.
keywords(); k++) {
80 PvlGroup &performance =
findGroup(
"Performance");
81 if (performance.hasKeyword(
"GlobalThreads")) {
82 IString threadsPreference = performance[
"GlobalThreads"][0];
84 if (threadsPreference.DownCase() !=
"optimized") {
86 int threads = threadsPreference.ToQt().toInt();
89 QThreadPool::globalInstance()->setMaxThreadCount(threads);
102 Preference &Preference::Preferences(
bool unitTest) {
110 if(!setup.fileExists()) {
112 QString dirName(IString(setup.expanded()).ToQt());
125 if(userPref.fileExists()) {
143 void Preference::Shutdown() {
int keywords() const
Returns the number of keywords contained in the PvlContainer.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
void clear()
Remove everything from the current PvlObject.
File name manipulation and expansion.
static Preference * p_preference
Pointer to a Preference object.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Namespace for the standard library.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
QString name() const
Returns the container name.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
A single keyword-value pair.
Container for cube-like labels.
PvlGroup & group(const int index)
Return the group at the specified index.
QString name() const
Returns the keyword name.
Namespace for ISIS/Bullet specific routines.
int groups() const
Returns the number of groups contained.
Preference()
Constructs a Preference object.
void read(const QString &file)
Loads PVL information from a stream.
static bool p_unitTest
Flag indicating whether the file is a unitTest or not.
void deleteKeyword(const QString &name)
Remove a specified keyword.