• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ prefs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: prefs

void setup::saveProfile(const QString &user, const QString &profile){
	if(user.isEmpty() || user == QString("<new user>"))
		return;

  QString settingsFileXml = KINKATTA_DIR;
  settingsFileXml += user.lower();
  settingsFileXml += ".xml";

	Preferences prefs(settingsFileXml, QString("kinkatta user prefs"), QString("1.0"));

	prefs.setGroup("profile");
	prefs.setCDATA("profile", profile);

	prefs.flush();

}
开发者ID:icefox,项目名称:kinkatta,代码行数:16,代码来源:setup.cpp


示例2: enableMenuItem

void UserInterface::loginResult(bool success, std::string const & info)
{
    enableMenuItem(UserInterface::menuLogin, !success);
    enableMenuItem(UserInterface::menuJoinChannel, success);
    enableMenuItem(UserInterface::menuChannels, success);

    if (success)
    {
        char * val;
        prefs().get(PrefAutoJoinChannels, val, "");
        autoJoinChannels(val);
        ::free(val);

        checkAway(this);
    }
}
开发者ID:nodenstuff,项目名称:flobby,代码行数:16,代码来源:UserInterface.cpp


示例3: prefChanged

int prefChanged(const char *aPref, void *aClosure)
{
  nsDeviceContextOS2 *context = (nsDeviceContextOS2*)aClosure;
  nsresult rv;
  
  if (nsCRT::strcmp(aPref, "layout.css.dpi")==0) {
    PRInt32 dpi;
    nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
    rv = prefs->GetIntPref(aPref, &dpi);
    if (NS_SUCCEEDED(rv))
      context->SetDPI(dpi);

  }
  
  return 0;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:16,代码来源:nsDeviceContextOS2.cpp


示例4: NS_ENSURE_FALSE

nsresult
nsMsgAccount::getPrefService()
{
  if (m_prefs)
    return NS_OK;

  nsresult rv;
  NS_ENSURE_FALSE(m_accountKey.IsEmpty(), NS_ERROR_NOT_INITIALIZED);
  nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
  NS_ENSURE_SUCCESS(rv, rv);

  nsAutoCString accountRoot("mail.account.");
  accountRoot.Append(m_accountKey);
  accountRoot.Append('.');
  return prefs->GetBranch(accountRoot.get(), getter_AddRefs(m_prefs));
}
开发者ID:mozilla,项目名称:releases-comm-central,代码行数:16,代码来源:nsMsgAccount.cpp


示例5: Dialog

Magnify_Dialog::Magnify_Dialog() :
    Dialog("Magnify"),
    _view        (0),
    _zoom        (ZOOM_200),
    _widget      (0),
    _zoom_widget (0),
    _close_widget(0)
{
    // Create widgets.

    _widget = new Magnify_Widget;

    _zoom_widget = new Choice_Widget(label_zoom());

    _close_widget = new Push_Button(label_close);

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);

    layout->add(_widget);
    layout->stretch(_widget);

    Horizontal_Layout * layout_h = new Horizontal_Layout(layout);
    layout_h->margin(0);
    layout_h->add(_zoom_widget);
    layout_h->add_spacer(-1, true);
    layout_h->add(_close_widget);
    layout_h->add_spacer(Layout::window_handle_size());

    // Preferences.

    Prefs prefs(Prefs::prefs(), "magnify_dialog");
    Prefs::get_(&prefs, "zoom", &_zoom);

    // Initialize.

    widget_update();

    size(Vector_Util::max(size_hint(), V2i(300, 300)));

    // Callbacks.

    _zoom_widget->signal.set(this, zoom_callback);

    _close_widget->signal.set(this, close_callback);
}
开发者ID:UIKit0,项目名称:djv,代码行数:47,代码来源:djv_view_magnify_dialog.cpp


示例6: AppendGenericFontFromPref

static void
AppendGenericFontFromPref(nsString& aFonts, nsIAtom *aLangGroup, const char *aGenericName)
{
    nsresult rv;

    nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
    if (!prefs)
        return;

    nsCAutoString prefName, langGroupString;
    nsXPIDLCString nameValue, nameListValue;

    aLangGroup->ToUTF8String(langGroupString);

    nsCAutoString genericDotLang;
    if (aGenericName) {
        genericDotLang.Assign(aGenericName);
    } else {
        prefName.AssignLiteral("font.default.");
        prefName.Append(langGroupString);
        prefs->GetCharPref(prefName.get(), getter_Copies(genericDotLang));
    }

    genericDotLang.AppendLiteral(".");
    genericDotLang.Append(langGroupString);

    // fetch font.name.xxx value                   
    prefName.AssignLiteral("font.name.");
    prefName.Append(genericDotLang);
    rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameValue));
    if (NS_SUCCEEDED(rv)) {
        if (!aFonts.IsEmpty())
            aFonts.AppendLiteral(", ");
        aFonts.Append(NS_ConvertUTF8toUTF16(nameValue));
    }

    // fetch font.name-list.xxx value                   
    prefName.AssignLiteral("font.name-list.");
    prefName.Append(genericDotLang);
    rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameListValue));
    if (NS_SUCCEEDED(rv) && !nameListValue.Equals(nameValue)) {
        if (!aFonts.IsEmpty())
            aFonts.AppendLiteral(", ");
        aFonts.Append(NS_ConvertUTF8toUTF16(nameListValue));
    }
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:46,代码来源:gfxPlatform.cpp


示例7: prefs

nsresult nsIDNService::Init()
{
  nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
  if (prefs)
    prefs->GetBranch(NS_NET_PREF_IDNWHITELIST, getter_AddRefs(mIDNWhitelistPrefBranch));

  nsCOMPtr<nsIPrefBranch2> prefInternal(do_QueryInterface(prefs));
  if (prefInternal) {
    prefInternal->AddObserver(NS_NET_PREF_IDNTESTBED, this, PR_TRUE); 
    prefInternal->AddObserver(NS_NET_PREF_IDNPREFIX, this, PR_TRUE); 
    prefInternal->AddObserver(NS_NET_PREF_IDNBLACKLIST, this, PR_TRUE);
    prefInternal->AddObserver(NS_NET_PREF_SHOWPUNYCODE, this, PR_TRUE);
    prefsChanged(prefInternal, nsnull);
  }

  return NS_OK;
}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:17,代码来源:nsIDNService.cpp


示例8: cryptPassword

void setup::savePassword(const QString &user, const QString &password){
	if(user.isEmpty() || (user == QString("<new user>")) || password.isEmpty())
		return;

	QString crypted = cryptPassword(password);

  QString settingsFileXml = KINKATTA_DIR;
  settingsFileXml += user.lower();
  settingsFileXml += ".xml";

	Preferences prefs(settingsFileXml, QString("kinkatta user prefs"), QString("1.0"));

	prefs.setGroup("password");
	prefs.setCDATA("password", crypted);

	prefs.flush();
}
开发者ID:icefox,项目名称:kinkatta,代码行数:17,代码来源:setup.cpp


示例9: main

int main(int argc, char* argv[])
{
    QApplication qapp(argc, argv);
    Composite::Main::MainWidget mainwin(argc, argv);

    QPalette pal = Composite::Looks::create_default_palette();
    qapp.setPalette(pal);

    // Set up audio engine
    Tritium::Logger::create_instance();
    Tritium::Logger::get_instance()->set_logging_level( "Debug" );
    Tritium::T<Tritium::Preferences>::shared_ptr prefs( new Tritium::Preferences() );
    Tritium::Engine engine(prefs);

    /////////////////////////////////////////////
    // Temporary code to get GMkit loaded
    /////////////////////////////////////////////
    {
	Tritium::LocalFileMng loc( &engine );
	QString gmkit;
	std::vector<QString>::iterator it;
	std::vector<QString> list;
	list = loc.getSystemDrumkitList();
	for( it = list.begin() ; it < list.end() ; ++it ) {
	    if( (*it).endsWith("GMkit") ) {
		gmkit = *it;
	    }
	    break;
	}
	assert( ! gmkit.isNull() );
	Tritium::T<Tritium::Drumkit>::shared_ptr dk = loc.loadDrumkit( gmkit );
	assert( dk );
	engine.loadDrumkit( dk );
    }

    /////////////////////////////////////////////
    // End of temporary code
    /////////////////////////////////////////////

    mainwin.set_audio_engine( &engine );

    mainwin.show();

    return qapp.exec();
}
开发者ID:lxlxlo,项目名称:composite-devel,代码行数:45,代码来源:main.cpp


示例10: ini

void
QtShanoirSettings::update()
{
    QFile ini(d->iniFile);
    ini.remove();
    QSettings prefs(d->iniFile, QSettings::IniFormat);
    prefs.beginGroup("User");
    prefs.setValue("login", d->login);
    prefs.setValue("password", d->password);
    prefs.endGroup();
    prefs.beginGroup("Server");
    prefs.setValue("host", d->host);
    prefs.setValue("port", d->port);
    prefs.endGroup();
    prefs.beginGroup("Security");
    prefs.setValue("truststore", d->truststore);
    prefs.endGroup();
}
开发者ID:Inria-Visages,项目名称:QtShanoir,代码行数:18,代码来源:QtShanoirSettings.cpp


示例11: runConflictRefinerPartition

void runConflictRefinerPartition(IloCP cp, IloConstraintArray cts) {     
  IloEnv env = cp.getEnv();
  IloInt n = cts.getSize();
  IloNumArray prefs(env, n);   
  IloInt i;  
  for (i=0; i<n; ++i) {
    prefs[i]=1.0; // Normal preference
  }
  while (cp.refineConflict(cts, prefs)) {
    cp.writeConflict(cp.out());
    for (i=0; i<n; ++i) {
      if (cp.getConflict(cts[i])==IloCP::ConflictMember) {
        prefs[i]=-1.0; // Next run will ignore constraints of the current conflict
      }
    }
  }
  prefs.end();
}
开发者ID:andreasmattas,项目名称:testcode,代码行数:18,代码来源:sched_conflict.cpp


示例12: prefs

NS_IMETHODIMP
nsMacShellService::GetShouldCheckDefaultBrowser(bool* aResult)
{
  // If we've already checked, the browser has been started and this is a 
  // new window open, and we don't want to check again.
  if (mCheckedThisSession) {
    *aResult = false;
    return NS_OK;
  }

  nsresult rv;
  nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
  if (NS_FAILED(rv)) {
    return rv;
  }

  return prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:18,代码来源:nsMacShellService.cpp


示例13: prefs

void UserInterface::autoJoinChannels(std::string const & text)
{
    std::vector<std::string> channels;

    namespace ba = boost::algorithm;
    ba::split( channels, text, ba::is_any_of("\n "), ba::token_compress_on );

    std::ostringstream oss;
    for (auto & v : channels)
    {
        if (!v.empty())
        {
            oss << v << " ";
            model_.joinChannel(v);
        }
    }
    prefs().set(PrefAutoJoinChannels, oss.str().c_str());
}
开发者ID:nodenstuff,项目名称:flobby,代码行数:18,代码来源:UserInterface.cpp


示例14: dialog

void wxStEditApp::CreateShell()
{
    wxDialog dialog(m_frame, wxID_ANY, wxT("wxSTEditorShell"),
                    wxDefaultPosition, wxDefaultSize,
                    wxDEFAULT_DIALOG_STYLE_RESIZE);
    wxSTEditorShell* shell = new wxSTEditorShell(&dialog, wxID_ANY);
    // Set the styles and langs to those of the frame (not necessary, but nice)
    // The prefs aren't shared since we want to control the look and feel.
    wxSTEditorPrefs prefs(true);
    prefs.SetPrefInt(STE_PREF_INDENT_GUIDES, 0);
    prefs.SetPrefInt(STE_PREF_EDGE_MODE, wxSTC_EDGE_NONE);
    prefs.SetPrefInt(STE_PREF_VIEW_LINEMARGIN, 0);
    prefs.SetPrefInt(STE_PREF_VIEW_MARKERMARGIN, 1);
    prefs.SetPrefInt(STE_PREF_VIEW_FOLDMARGIN, 0);
    shell->RegisterPrefs(prefs);
    shell->RegisterStyles(m_frame->GetOptions().GetEditorStyles());
    shell->RegisterLangs(m_frame->GetOptions().GetEditorLangs());
    shell->SetLanguage(STE_LANG_PYTHON); // arbitrarily set to python

    shell->BeginWriteable();
    shell->AppendText(_("Welcome to a test of the wxSTEditorShell.\n\n"));
    shell->AppendText(_("This simple test merely responds to the wxEVT_STESHELL_ENTER\n"));
    shell->AppendText(_("events and prints the contents of the line when you press enter.\n\n"));
    shell->AppendText(_("For demo purposes, the shell understands these simple commands.\n"));
    shell->AppendText(_(" SetMaxHistoryLines num : set the number of lines in history buffer\n"));
    shell->AppendText(_(" SetMaxLines num [overflow=2000] : set the number of lines displayed\n"));
    shell->AppendText(_("   and optionally the number of lines to overflow before deleting\n"));
    shell->AppendText(_(" Quit : quit the wxSTEditorShell demo\n"));
    shell->CheckPrompt(true); // add prompt
    shell->EndWriteable();

    shell->Connect(wxID_ANY, wxEVT_STESHELL_ENTER,
                   wxSTEditorEventHandler(wxStEditApp::OnSTEShellEvent), NULL, this);

    int width = shell->TextWidth(wxSTC_STYLE_DEFAULT,
                                 wxT(" SetMaxHistoryLines num : set the number of lines in history buffer  "));
    dialog.SetSize(width + 30, wxDefaultCoord);

    wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
    topSizer->Add(shell, 1, wxEXPAND);
    dialog.SetSizer(topSizer);
    dialog.ShowModal();
}
开发者ID:brkpt,项目名称:luaplus51-all,代码行数:43,代码来源:wxstedit.cpp


示例15: prefs

void
QtShanoirSettings::loadSettings()
{
    if (!QFile(d->iniFile).exists())
        this->initializeSettings();
    else {
        QSettings prefs(d->iniFile, QSettings::IniFormat);
        prefs.beginGroup("User");
        d->login = prefs.value("login").toString();
        d->password = prefs.value("password").toString();
        prefs.endGroup();
        prefs.beginGroup("Server");
        d->host = prefs.value("host").toString();
        d->port = prefs.value("port").toString();
        prefs.endGroup();
        prefs.beginGroup("Security");
        d->truststore = prefs.value("truststore").toString();
        prefs.endGroup();
    }
}
开发者ID:Inria-Visages,项目名称:QtShanoir,代码行数:20,代码来源:QtShanoirSettings.cpp


示例16: QString

QString setup::readPassword(const QString &user){
	//qDebug("::readPassword %s\n", user.latin1());

	QString pw;
  QString settingsFileXml = KINKATTA_DIR;
  settingsFileXml += user.lower();
  settingsFileXml += ".xml";

	if(user.isEmpty() || (user == QString("<new user>")) || !QFile::exists(settingsFileXml)){
		//must be a new user
		return QString("");
	}
	Preferences prefs(settingsFileXml, QString("kinkatta user prefs"), QString("1.0"));

	//qDebug("::readPassword settingsFileXml %s\n", settingsFileXml.latin1());

	prefs.setGroup("password");
	pw = prefs.getCDATA("password", QString(""));
	return decryptPassword(pw);
}
开发者ID:icefox,项目名称:kinkatta,代码行数:20,代码来源:setup.cpp


示例17: main

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int main (int argc, char const *argv[])
{
   // This code is NOT READY to run AT ALL. IT was just a PLACE TO START
  BOOST_ASSERT(false);
  QString configFile;

  try
  {

   // Handle program options passed on command line.
    TCLAP::CmdLine cmd("PipelineRunner", ' ', DREAM3DLib::Version::Complete());

    TCLAP::ValueArg<std::string> inputFileArg( "c", "config", "The text file containing the pipeline information.", true, "", "Pipeline Config File");
    cmd.add(inputFileArg);


    // Parse the argv array.
    cmd.parse(argc, argv);
    if (argc == 1)
    {
      std::cout << "PipelineRunner program was not provided any arguments. Use the --help argument to show the help listing." << std::endl;
      return EXIT_FAILURE;
    }

    configFile = QString::fromStdString(inputFileArg.getValue());


  }
  catch (TCLAP::ArgException &e) // catch any exceptions
  {
    std::cerr << logTime() << " error: " << e.error() << " for arg " << e.argId() << std::endl;
    return EXIT_FAILURE;
  }


  // Create the QSettings Object
  QSettings prefs(configFile, QSettings::IniFormat, NULL);
  readSettings(prefs);

  return EXIT_SUCCESS;
}
开发者ID:chongbingbao,项目名称:DREAM3D,代码行数:44,代码来源:PipelineRunner.cpp


示例18: runConflictRefinerWithPreferences

void runConflictRefinerWithPreferences(IloCP cp, 
                                       IloConstraintArray preferredCts, 
                                       IloConstraintArray otherCts) {
  IloEnv env = cp.getEnv();
  IloConstraintArray cts(env);  
  IloNumArray prefs(env);
  IloInt i;
  for (i=0; i<otherCts.getSize(); ++i) {
    cts.add(otherCts[i]);
    prefs.add(1.0); // Normal preference
  }
  for (i=0; i<preferredCts.getSize(); ++i) {
    cts.add(preferredCts[i]);
    prefs.add(2.0); // Higher preference
  }
  if (cp.refineConflict(cts, prefs)) {
    cp.writeConflict(cp.out());
  } 
  cts.end();
  prefs.end();
}
开发者ID:andreasmattas,项目名称:testcode,代码行数:21,代码来源:sched_conflict.cpp


示例19: manage_config_mode

static int manage_config_mode(const std::string &configvar, const CmdArgs &args)
{
    int ret = EXIT_SUCCESS;

    try {
        vle::utils::Preferences prefs("vle.conf");

        std::string concat = std::accumulate(args.begin(), args.end(),
                std::string(), Comma());

        if (not prefs.set(configvar, concat))
            throw vle::utils::ArgError(vle::fmt(_("Unknown variable `%1%'")) %
                    configvar);

    } catch (const std::exception &e) {
        std::cerr << vle::fmt(_("Config error: %1%\n")) % e.what();
        ret = EXIT_FAILURE;
    }

    return ret;
}
开发者ID:rousse,项目名称:vle,代码行数:21,代码来源:main.cpp


示例20: prefs

/**
 * Reads in the settings. Starts the clock.
 */
void AwaySchedule::initPlugin() {
    // Read Settings.
    QString DirStr = QDir::homeDirPath() + "/.kinkatta/plugins/awaySchedule.settings" ;
    Preferences prefs(DirStr, info.Name, info.Version);

    prefs.setGroup("messages");
    int messageCount = prefs.getNumber("message_count");

    for(int i = 0; i < messageCount; i++) {
        appointment *a = new appointment();
        a->startHour = prefs.getNumber((QString("message_%1_").arg(i) + "startHour"), 0 );
        a->startMinute = prefs.getNumber((QString("message_%1_").arg(i) + "startMinute"), 0 );
        a->endHour = prefs.getNumber((QString("message_%1_").arg(i) + "endHour"), 0 );
        a->endMinute = prefs.getNumber((QString("message_%1_").arg(i) + "endMinute"), 0 );
        a->message = prefs.getString((QString("message_%1_").arg(i) + "message"), "" );
        appointments.append(a);
    }

    // StartClock
    QTimer::singleShot(  TIME_TO_CHECK_IN_SECONDS*1000, this, SLOT(checkToSeeIfWeShouldGoAway()));
}
开发者ID:icefox,项目名称:kinkatta,代码行数:24,代码来源:awayschedule.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ prefs_get_boolean函数代码示例发布时间:2022-05-30
下一篇:
C++ prefixcmp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap