当前位置: 首页>>代码示例>>C++>>正文


C++ getSetting函数代码示例

本文整理汇总了C++中getSetting函数的典型用法代码示例。如果您正苦于以下问题:C++ getSetting函数的具体用法?C++ getSetting怎么用?C++ getSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSetting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getSetting

/** Loads the saved Message Log settings */
void
MessageLog::loadSettings()
{
  /* Set Max Count widget */
  uint maxMsgCount = getSetting(SETTING_MAX_MSG_COUNT,
                                DEFAULT_MAX_MSG_COUNT).toUInt();
  ui.spnbxMaxCount->setValue(maxMsgCount);
  ui.listMessages->setMaximumMessageCount(maxMsgCount);
  ui.listNotifications->setMaximumItemCount(maxMsgCount);

  /* Set whether or not logging to file is enabled */
  _enableLogging = getSetting(SETTING_ENABLE_LOGFILE,
                              DEFAULT_ENABLE_LOGFILE).toBool();
  QString logfile = getSetting(SETTING_LOGFILE,
                               DEFAULT_LOGFILE).toString();
  ui.lineFile->setText(QDir::convertSeparators(logfile));
  rotateLogFile(logfile);
  ui.chkEnableLogFile->setChecked(_logFile.isOpen());

  /* Set the checkboxes accordingly */
  _filter = getSetting(SETTING_MSG_FILTER, DEFAULT_MSG_FILTER).toUInt();
  ui.chkTorErr->setChecked(_filter & tc::ErrorSeverity);
  ui.chkTorWarn->setChecked(_filter & tc::WarnSeverity);
  ui.chkTorNote->setChecked(_filter & tc::NoticeSeverity);
  ui.chkTorInfo->setChecked(_filter & tc::InfoSeverity);
  ui.chkTorDebug->setChecked(_filter & tc::DebugSeverity);
  registerLogEvents();

  /* Filter the message log */
  QApplication::setOverrideCursor(Qt::WaitCursor);
  ui.listMessages->filter(_filter);
  QApplication::restoreOverrideCursor();
}
开发者ID:Bodyfarm,项目名称:vidalia,代码行数:34,代码来源:MessageLog.cpp

示例2: Modifier

//------------------------------------------------------------------------------
ImpactObject::ImpactObject(const Setting &setting, Domain *domain):
    Modifier(domain)
{
    startTime = getSetting(setting, {"startTime"});
    endTime = getSetting(setting, {"endTime"});
    ks          = getSetting(setting, {"ks"});
    R           = getSetting(setting, {"R"});
    velocity    = getSetting(setting, {"velocity"});

    // Dimensionless scaling
    // f = F/V^2 = -ks(r' - R')^2 /L0^4
    // f' = f L0^4 / E0 = -ks/E0 (r' - R')^2
    //
    // OR
    //
    // F = -ks'(r' - R')^2 E0 L0^2
    // b = F/V = -ks(r - R)^2 / V
    // b = -ks'(r' - R')^2 / V' E0/L0
    // b' = -ks'(r' - R')^ 2 / V'
    const Scaling &scaling = domain->scaling();
    if(scaling.dimensionlessScaling)
    {
        ks /= scaling.E;
        R  /= scaling.L;
        velocity /= scaling.V;
    }

    // Setting the center of the sphere
    double spacing = domain->latticeSpacing();
    centerOfSphere[X] = domain->getDomain()[X][1] + R - 0.5*spacing;
    centerOfSphere[Y] = 0.5*( domain->getDomain()[Y][1] - domain->getDomain()[Y][0] );
    centerOfSphere[Z] = 0.5*( domain->getDomain()[Z][1] - domain->getDomain()[Z][0] );
    tPrev = 0; // TODO: should be initial time.
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:35,代码来源:impactobject.cpp

示例3: getVoiceList

void TTSFestival::updateVoiceList()
{
   QStringList voiceList = getVoiceList(getSetting(eSERVERPATH)->current().toString());
   getSetting(eVOICE)->setList(voiceList);
   if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0));
   else getSetting(eVOICE)->setCurrent("");
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:7,代码来源:ttsfestival.cpp

示例4: Q_UNUSED

bool 
Dropbox::writeFile(QByteArray &data, QString remotename, RideFile *ride)
{
    Q_UNUSED(ride);

    // this must be performed asyncronously and call made
    // to notifyWriteCompleted(QString remotename, QString message) when done

    // do we have a token ?
    QString token = getSetting(GC_DROPBOX_TOKEN, "").toString();
    if (token == "") return false;

    // is the path set ?
    QString path = getSetting(GC_DROPBOX_FOLDER, "").toString();
    if (path == "") return false;

    // lets connect and get basic info on the root directory
    QString url("https://content.dropboxapi.com/1/files_put/auto/" + path + "/" + remotename + "?overwrite=true&autorename=false");

    // request using the bearer token
    QNetworkRequest request(url);
    request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toLatin1());

    // put the file
    QNetworkReply *reply = nam->put(request, data);

    // catch finished signal
    connect(reply, SIGNAL(finished()), this, SLOT(writeFileCompleted()));

    // remember
    mapReply(reply,remotename);
    return true;
}
开发者ID:lumanz,项目名称:GoldenCheetah,代码行数:33,代码来源:Dropbox.cpp

示例5: InitialConfiguration

//------------------------------------------------------------------------------
InitialFromImage::InitialFromImage(const Setting& parameters):
    InitialConfiguration(parameters)
{
  const Setting & latticePoints = getSetting(parameters, {"initialConfiguration",
                                                    "latticePoints"});

  // Setting the intial grid size and dimension
  nParticles = 1;
  dim = latticePoints.getLength();
  nXYZ.zeros();

  for(int d=0; d<dim; d++)
  {
      nXYZ[d] = latticePoints[d];
      nParticles *= nXYZ[d];
  }

  // Setting the domain
  vector<VEC2> dom;
  for(int i=0; i<dim; i++)
  {
      VEC2 iDomain;
      iDomain = { 0 , spacing*nXYZ[i]};
      dom.push_back(iDomain);
  }
  domain.setDomain(dom);

  string pathXZ = getSetting(parameters, {"initialConfiguration",
                                          "pathXZ"});
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:31,代码来源:initialfromimage.cpp

示例6: init_ui

void init_ui(int *argcp, char ***argvp)
{
    QVariant v;

    application = new QApplication(*argcp, *argvp);

    // the Gtk theme makes things unbearably ugly
    // so switch to Oxygen in this case
    if (application->style()->objectName() == "gtk+")
        application->setStyle("Oxygen");

#if QT_VERSION < 0x050000
    // ask QString in Qt 4 to interpret all char* as UTF-8,
    // like Qt 5 does.
    // 106 is "UTF-8", this is faster than lookup by name
    // [http://www.iana.org/assignments/character-sets/character-sets.xml]
    QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106));
#endif
    QCoreApplication::setOrganizationName("Subsurface");
    QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
    QCoreApplication::setApplicationName("Subsurface");

    QSettings s;
    s.beginGroup("GeneralSettings");
    prefs.default_filename = getSetting(s, "default_filename");
    s.endGroup();
    s.beginGroup("DiveComputer");
    default_dive_computer_vendor = getSetting(s, "dive_computer_vendor");
    default_dive_computer_product = getSetting(s,"dive_computer_product");
    default_dive_computer_device = getSetting(s, "dive_computer_device");
    s.endGroup();
    return;
}
开发者ID:richardsonlima,项目名称:subsurface,代码行数:33,代码来源:qt-gui.cpp

示例7: persite

// Apply per-site settings when going to new sites
static void persite(webview * const view, const char * const url) {
    tab * const cur = findtab(view);
    if (!cur || cur->state != TS_WEB)
        return;

    char site[120];
    url2site(url, site, 120, true);

    setting *s = NULL;

    if (cur->js == TRI_AUTO) {
        s = getSetting("general.javascript", site);
        view->setBool(WK_SETTING_JS, s->val.u);
    }

    if (cur->css == TRI_AUTO) {
        s = getSetting("general.css", site);
        view->setBool(WK_SETTING_CSS, s->val.u);
    }

    if (cur->img == TRI_AUTO) {
        s = getSetting("general.images", site);
        view->setBool(WK_SETTING_IMG, s->val.u);
    }

    s = getSetting("general.localstorage", site);
    view->setBool(WK_SETTING_LOCALSTORAGE, s->val.u);

    s = getSetting("user.css", site);
    view->setChar(WK_SETTING_USER_CSS, s->val.c);
}
开发者ID:BertieJim,项目名称:fifth,代码行数:32,代码来源:tabs.cpp

示例8: printd

// open by connecting and getting a basic list of folders available
bool
PolarFlow::open(QStringList &errors)
{
    printd("PolarFlow::open\n");

    // do we have a token
    QString token = getSetting(GC_POLARFLOW_TOKEN, "").toString();
    if (token == "") {
        errors << "You must authorise with PolarFlow first";
        return false;
    }

    // use the configed URL
    QString url = QString("%1/rest/users/delegates/users")
          .arg(getSetting(GC_POLARFLOW_URL, "https://whats.todaysplan.com.au").toString());

    printd("URL used: %s\n", url.toStdString().c_str());

    // request using the bearer token
    QNetworkRequest request(url);
    request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toLatin1());

    QNetworkReply *reply = nam->get(request);

    // blocking request
    QEventLoop loop;
    connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
    loop.exec();

    if (reply->error() != QNetworkReply::NoError) {
        qDebug() << "error" << reply->errorString();
        errors << tr("Network Problem reading PolarFlow data");
        return false;
    }
    // did we get a good response ?
    QByteArray r = reply->readAll();
    printd("response: %s\n", r.toStdString().c_str());

    QJsonParseError parseError;
    QJsonDocument document = QJsonDocument::fromJson(r, &parseError);

    // if path was returned all is good, lets set root
    if (parseError.error == QJsonParseError::NoError) {
        printd("NoError");

        // we have a root
        root_ = newCloudServiceEntry();

        // path name
        root_->name = "/";
        root_->isDir = true;
        root_->size = 0;
    } else {
        errors << tr("problem parsing PolarFlow data");
    }

    // ok so far ?
    if (errors.count()) return false;
    return true;
}
开发者ID:GoldenCheetah,项目名称:GoldenCheetah,代码行数:61,代码来源:PolarFlow.cpp

示例9: getSetting

/** Restores the last size and location of the window. */
void
VidaliaWindow::restoreWindowState()
{
#if QT_VERSION >= 0x040200
  QByteArray geometry = getSetting("Geometry", QByteArray()).toByteArray();
  if (geometry.isEmpty())
    adjustSize();
  else
    restoreGeometry(geometry);
#else
  QRect screen = QDesktopWidget().availableGeometry();

  /* Restore the window size. */
  QSize size = getSetting("Size", QSize()).toSize();
  if (!size.isEmpty()) {
    size = size.boundedTo(screen.size());
    resize(size);
  }

  /* Restore the window position. */
  QPoint pos = getSetting("Position", QPoint()).toPoint();
  if (!pos.isNull() && screen.contains(pos)) {
    move(pos);
  }
#endif
}
开发者ID:IRET0x00,项目名称:vidalia,代码行数:27,代码来源:VidaliaWindow.cpp

示例10: FractureCriterion

//------------------------------------------------------------------------------
SimplePdFracture::SimplePdFracture(const Setting &parameters, Domain *domain):
    FractureCriterion(domain)
{
    (void) parameters;
    alpha = getSetting(parameters,  {"alpha"});
    compressiveScaleFactor = getSetting(parameters, {"compressiveScaleFactor"});
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:8,代码来源:simplepdfracture.cpp

示例11: QObject

LocationWatcher::LocationWatcher(QObject *parent)
    : QObject(parent)
{
   openDB();
   source = QGeoPositionInfoSource::createDefaultSource(this);
   setinterval(getSetting("time"));
   setgpsmode(getSetting("usegps"));
}
开发者ID:qwazix,项目名称:oobProfile,代码行数:8,代码来源:locationwatcher.cpp

示例12: qDebug

void TTSSapi::updateVoiceList()
{
    qDebug() << "update voiceList";
    QStringList voiceList = getVoiceList(getSetting(eLANGUAGE)->current().toString());
    getSetting(eVOICE)->setList(voiceList);
    if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0));
    else getSetting(eVOICE)->setCurrent("");
}
开发者ID:a-martinez,项目名称:rockbox,代码行数:8,代码来源:ttssapi.cpp

示例13: saveSettings

void TTSFestival::saveSettings()
{
    //save settings in user config
    RbSettings::setSubValue("festival-server",RbSettings::TtsPath,getSetting(eSERVERPATH)->current().toString());
    RbSettings::setSubValue("festival-client",RbSettings::TtsPath,getSetting(eCLIENTPATH)->current().toString());
    RbSettings::setSubValue("festival",RbSettings::TtsVoice,getSetting(eVOICE)->current().toString());

    RbSettings::sync();
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:9,代码来源:ttsfestival.cpp

示例14: getSetting

CameraSettings CameraIIDC::getCameraSettings(){

    // Get settings:
    CameraSettings settings;
    settings.gain = getSetting(cam, DC1394_FEATURE_GAIN);
    settings.shutter = getSetting(cam, DC1394_FEATURE_SHUTTER);

    return settings;
}
开发者ID:1125lbs,项目名称:slstudio,代码行数:9,代码来源:CameraIIDC.cpp

示例15: getSetting

void TTSFestival::updateVoiceDescription()
{
    // get voice Info with current voice and path
    currentPath = getSetting(eSERVERPATH)->current().toString();
    QString info = getVoiceInfo(getSetting(eVOICE)->current().toString());
    currentPath = "";
    
    getSetting(eVOICEDESC)->setCurrent(info);
}
开发者ID:a-martinez,项目名称:rockbox,代码行数:9,代码来源:ttsfestival.cpp


注:本文中的getSetting函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。