Loading [MathJax]/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
13 #include <QThreadPool>
15 #include "Preference.h"
17 #include "IException.h"
28 void Preference::Load(
const QString &file) {
38 QString(
"The preference file %1 was not found or does not exist").arg(file),
44 for(
int i = 0; i < pvl.
groups(); i++) {
48 for(
int k = 0; k < inGroup.
keywords(); k++) {
64 PvlGroup &performance =
findGroup(
"Performance");
65 if (performance.hasKeyword(
"GlobalThreads")) {
66 IString threadsPreference = performance[
"GlobalThreads"][0];
68 if (threadsPreference.DownCase() !=
"optimized") {
70 int threads = threadsPreference.ToQt().toInt();
73 QThreadPool::globalInstance()->setMaxThreadCount(threads);
86 Preference &Preference::Preferences(
bool unitTest) {
94 if(!setup.fileExists()) {
96 QString dirName(IString(setup.expanded()).ToQt());
109 if(userPref.fileExists()) {
127 void Preference::Shutdown() {
void clear()
Remove everything from the current PvlObject.
QString name() const
Returns the keyword name.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
PvlGroup & group(const int index)
Return the group at the specified index.
A single keyword-value pair.
File name manipulation and expansion.
int groups() const
Returns the number of groups contained.
static Preference * p_preference
Pointer to a Preference object.
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Container for cube-like labels.
Preference()
Constructs a Preference object.
Contains multiple PvlContainers.
static bool p_unitTest
Flag indicating whether the file is a unitTest or not.
void read(const QString &file)
Loads PVL information from a stream.
QString name() const
Returns the container name.
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
void deleteKeyword(const QString &name)
Remove a specified keyword.
Namespace for the standard library.
int keywords() const
Returns the number of keywords contained in the PvlContainer.
This is free and unencumbered software released into the public domain.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....