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


C++ prefs函数代码示例

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


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


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