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


C++ setting函数代码示例

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


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

示例1: setting

static char *wallet_filename(void)
{
	char *filename = setting("wallet");
	if (!filename)
		filename = setting("w");
	return filename;
}
开发者ID:Artogn,项目名称:picocoin,代码行数:7,代码来源:wallet.c

示例2: init_peers

static void init_peers(struct net_child_info *nci)
{
	/*
	 * read network peers
	 */
	struct peer_manager *peers;

	peers = peerman_read();
	if (!peers) {
		fprintf(plog, "net: initializing empty peer list\n");

		peers = peerman_seed(setting("no_dns") == NULL ? true : false);
		if (!peerman_write(peers)) {
			fprintf(plog, "net: failed to write peer list\n");
			exit(1);
		}
	}

	char *addnode = setting("addnode");
	if (addnode)
		peerman_addstr(peers, addnode);

	peerman_sort(peers);

	if (debugging)
		fprintf(plog, "net: have %u/%zu peers\n",
			bp_hashtab_size(peers->map_addr),
			clist_length(peers->addrlist));

	nci->peers = peers;
}
开发者ID:gitter-badger,项目名称:picocoin,代码行数:31,代码来源:brd.c

示例3: loadSamples

void loadSamples(const char* sndDir, const char* musicFile)
{
  loadSample( packGetFile(sndDir,"click.ogg"), SND_CLICK );
  loadSample( packGetFile(sndDir,"brickmove.ogg"), SND_BRICKMOVE );
  loadSample( packGetFile(sndDir,"brickgrab.ogg"), SND_BRICKGRAB );
  loadSample( packGetFile(sndDir,"brickbreak.ogg"), SND_BRICKBREAK );
  loadSample( packGetFile(sndDir,"scoretick.ogg"), SND_SCORECOUNT );
  loadSample( packGetFile(sndDir,"countdown.ogg"), SND_COUNTDOWNTOSTART );
  loadSample( packGetFile(sndDir,"start.ogg"), SND_START );
  loadSample( packGetFile(sndDir,"timeout.ogg"), SND_TIMEOUT );
  loadSample( packGetFile(sndDir,"victory.ogg"), SND_VICTORY );
  loadSample( packGetFile(sndDir,"timeout.ogg"), SND_TIMEOUT );
  loadSample( packGetFile(sndDir,"onewaymove.ogg"), SND_ONEWAY_MOVE );
  loadSample( packGetFile(sndDir,"teleported.ogg"), SND_TELEPORTED );
  loadSample( packGetFile(sndDir,"switchactivate.ogg"), SND_SWITCH_ACTIVATED );
  loadSample( packGetFile(sndDir,"switchinactive.ogg"), SND_SWITCH_DEACTIVATED );
  loadSample( packGetFile(sndDir,"brickswap.ogg"), SND_BRICKSWAP );
  loadSample( packGetFile(sndDir,"brickcopy.ogg"), SND_BRICKCOPY );
  loadSample( packGetFile(sndDir,"brickswapdenied.ogg"), SND_BRICKSWAP );
  loadSample( packGetFile(sndDir,"brickcopydenied.ogg"), SND_BRICKCOPY );
  loadSample( packGetFile(sndDir, "winner.ogg"), SND_WINNER);
  loadSample( packGetFile(sndDir, "loser.ogg"), SND_LOSER);

  //Music load code
  if(setting()->disableMusic) return;
  if( !musicFile ) return;

  //Load ingame song if not allready loaded.
  if(strcmp(lastLoadedSongFn, packGetFile("./",musicFile))!=0 && !setting()->userMusic)
  {
    //Free old song if loaded.
    if(mus[1])
    {
      Mix_FreeMusic(mus[1]);
    }
    strcpy(lastLoadedSongFn, packGetFile("./",musicFile));
    mus[1]=Mix_LoadMUS( lastLoadedSongFn );
    if(!mus[1])
      printf("Couldn't load music: '%s'\n",packGetFile("./",musicFile));

    mPos[1] = 0.0f;

    if( !Mix_PlayingMusic() )
    {
      Mix_FadeInMusicPos(mus[1], -1, MUSIC_FADETIME,mPos[1]);
    }
  }

}
开发者ID:DusteDdk,项目名称:Wizznic,代码行数:49,代码来源:sound.c

示例4: switch_keys

static void switch_keys() {
	rotated = TRUE;

	if (n_keyset < 1) {
		plugin_print("mcp game", "cannot switch CD key set (no key sets loaded)\n");
		return;
	}

	i_keyset = (i_keyset + 1) % n_keyset;

	plugin_print("mcp game", "switching to CD key set %i\n", i_keyset + 1);

	strcpy(setting("ClassicKey")->s_var, keyset[i_keyset].classic);
	strcpy(setting("ExpansionKey")->s_var, keyset[i_keyset].expansion);
}
开发者ID:Bigorneau,项目名称:motoko,代码行数:15,代码来源:mcp_game.c

示例5: locker

//-------------------------------------------------------------------------------------------------
void tNdp2kTableDataSources::OnMyRowChanged( int row )
{
    tDataType dataType;
    tSourceSelections selections;
    {
        tQMutexLocker locker( &m_Lock );
        if (row >= m_Table.count())
            return;
        dataType = m_Table[ row ].dataType;
        selections = m_Table[ row ].selections;
    }

    if (row < m_DefaultFormatRows && m_ShareChanges == true)
    {
        tDataType type = m_pDefaultFormatTypes[ row ];
        Assert( type == dataType );
        eDigitalDataSourceSettingId settingID =  m_pSourceSettings->DataTypeToSettingId( type );
        if (m_pSourceSettings->SettingIdToDataType( settingID ) == type)
        {
            tDigitalDataSourceSettings::tGlobalSetting setting(*m_pSourceSettings);
            setting.SetDataSourceList( selections );
            setting.Save( settingID, eDDSFrom_Table );
        }
    }
    Settings().SetValue( QString::number(row), ToVariant( dataType, selections ) );
}
开发者ID:dulton,项目名称:53_hero,代码行数:27,代码来源:tNdp2kTableDataSources.cpp

示例6: SetFormat

//---------------------------------------------------------------------------------------
void tNdp2kTableDataSources::LoadFromGlobalSettings()
{
    SetFormat( m_DefaultFormat );

    int errors = 0;
    m_Table.resize( m_DefaultFormatRows );
    for (int row = 0; row < m_DefaultFormatRows; ++row)
    {
        tDataType type = m_pDefaultFormatTypes[row];
        eDigitalDataSourceSettingId settingID = m_pSourceSettings->DataTypeToSettingId( type );

        tRow& info = m_Table[ row ];
        info.dataType = type;
        info.dirty = false;

        bool ok = false;
        if (m_pSourceSettings->SettingIdToDataType( settingID ) == type)
        {
            tDigitalDataSourceSettings::tGlobalSetting setting(*m_pSourceSettings);
            if (setting.Load( settingID ))
            {
                info.selections = setting.DataSourceList();
                ok = true;
            }
        }
        if (ok == false)
        {
            info.selections = tSourceSelections();
            ++errors;
        }
    }
}
开发者ID:dulton,项目名称:53_hero,代码行数:33,代码来源:tNdp2kTableDataSources.cpp

示例7: setting

void CopySenderServer::loadCompressPath(){
    QSettings setting("settings.ini",QSettings::IniFormat);
    //grouping the settings
    setting.beginGroup("FileCopy");

    //default settings values
    QVariant defaultfileCompressPath;
    QString theDefaultPathCompress = "buildCompressed";
    defaultfileCompressPath.setValue(theDefaultPathCompress);

    //send in the default values in case it does not exist...
    QString loadedFileCompressPath = setting.value("fileCompressPath", defaultfileCompressPath).toString();

    setting.endGroup();

    if(!QDir(loadedFileCompressPath).exists()){
        //firstly try and create that directory...
        bool successCreate = QDir().mkdir(loadedFileCompressPath);
        //...if it fails, revert to default
        if(!successCreate){
            fileCompressPath = "buildCompressed";
            QDir().mkdir(fileCompressPath);
        }
    }
    else{
        fileCompressPath = loadedFileCompressPath;
    }
}
开发者ID:hhvvkk,项目名称:COS301DistrobutedApplicationManger,代码行数:28,代码来源:copysenderserver.cpp

示例8: QChar

void MainPage::init(){
    this->man = NULL;
    ToolUtil::initStyle(this);
    IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d), 10);
    IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068), 10);
    IconHelper::Instance()->SetIcon(ui->btnMenu, QChar(0xf0c9), 10);
//    IconHelper::Instance()->Set(ui->lab_Ico, QChar(0xf19c), 12);
    IconHelper::Instance()->SetBackground(ui->lab_Ico, "logo.png");

    main_menu = new MainMenu();
    icon_menu = new IconMenu();

    //信号量注册
    connect(ui->bt_quit,SIGNAL(clicked()),this,SLOT(userLogout()));

    /***********menu slot****************/
    connect(main_menu,SIGNAL(setting()),this,SLOT(menuSetting()));
    connect(main_menu,SIGNAL(aboutus()),this,SLOT(menuAboutus()));

    connect(icon_menu,SIGNAL(login()),this,SLOT(menuLogin()));
    connect(icon_menu,SIGNAL(logout()),this,SLOT(userLogout()));
    connect(icon_menu,SIGNAL(min()),this,SLOT(on_btnMenu_Min_clicked()));
    connect(icon_menu,SIGNAL(useradd()),this,SLOT(userAdd()));
    connect(icon_menu,SIGNAL(clo()),this,SLOT(close()));
    connect(icon_menu,SIGNAL(pwdchange()),this,SLOT(menuPwdChange()));

    /*********login************/
    this->showLoginDlg();
}
开发者ID:DingYong4223,项目名称:EConnect,代码行数:29,代码来源:mainpage.cpp

示例9: setting

/**
 * Updates preferences
 */
void MainWindow::updatePreferences()
{
    QSettings setting("rk", "scribo");
    setting.beginGroup("writing");

    QString style = "#textEdit_mainWindow_surface { margin: " +
            setting.value("marginTop", 35).toString() +
            " " +
            setting.value("marginRight", 35).toString() +
            " " +
            setting.value("marginBottom", 0).toString() +
            " " +
            setting.value("marginLeft", 35).toString() + "; " +
            "padding: " +
            setting.value("paddingTop", 20).toString() +
            " " +
            setting.value("paddingRight", 20).toString() +
            " " +
            setting.value("paddingBottom", 0).toString() +
            " " +
            setting.value("paddingLeft", 20).toString() +
            "; background: " +
            "rgb(" +
                setting.value("red", 255).toString() + "," +
                setting.value("green", 255).toString() + "," +
                setting.value("blue", 255).toString() + "); " +
            "}";
    ui->textEdit_mainWindow_surface->setStyleSheet(style);
    passwordUsed = setting.value("passwordUsed", false).toBool();
    setting.endGroup();
}
开发者ID:1cy1c3,项目名称:scribo,代码行数:34,代码来源:mainwindow.cpp

示例10: main

int main(int argc, char** argv)
{
    Application app(argc, argv);
    if (!app.parseArgs()) {
        qDebug() << "Wrong usage!";
        return 42;
    }

#ifdef Q_OS_LINUX
//    int d = daemon(0, 0);
//    Q_UNUSED(d);
#endif

    QString pathToConfig = app.config();

    if (app.logFile().size()) {
        if (Logger::configure(app.logFile()))
            qInstallMessageHandler(Logger::logger);
        else
            qDebug() << "Log file not been set";
    }

    Settings setting(pathToConfig);
    pSaver saver;
    pThreadPool pool(Settings::threads());

    pServer server;

    app.exec();
}
开发者ID:AnatolyRugalev,项目名称:Pastexen,代码行数:30,代码来源:main.cpp

示例11: do_start_document

 void do_start_document(const Settings& settings)
 {
   seen_root_ = false;
   settings_ = settings;
   if(setting("indent") == "yes")
     indent_ = 0;
 } // do_start_document
开发者ID:KITSVictorGubin,项目名称:jornal,代码行数:7,代码来源:xslt_sink.hpp

示例12: setting

bool Configuration::loadConfig(QString& path){
    QSettings setting(path, QSettings::IniFormat);
    setting.sync();
    this->threads_num_ = setting.value("settings/threads_num",0).toInt();
    this->queue_size_ = setting.value("settings/queue_size",0).toInt();
    this->servers_nb_ = setting.value("settings/servers_number",0).toInt();
    this->DBServers_nb_ = setting.value("settings/servers_DB_number",0).toInt();
    this->interval_ = setting.value("master_settings/interval",0).toInt();
    for(int i = 1; i<=this->servers_nb_ + this->DBServers_nb_; ++i) {
        QString ip = setting.value("serwer"+QString::number(i)+"/ip","0.0.0.0").toString();
        int portExt = setting.value("serwer"+QString::number(i)+"/portExt", 0).toInt();
        int portDB = setting.value("serwer"+QString::number(i)+"/portDB", 0).toInt();
        int portClient = setting.value("serwer"+QString::number(i)+"/portClient", 0).toInt();
        QString stype = setting.value("serwer"+QString::number(i)+"/type","srv").toString();
        SrvType type;
        if(stype == "srv"){
            type = SrvType::SRV;
        }
        else{
            if(stype == "db"){
                type = SrvType::DB;
            }
        }
        QString pubKey = setting.value("serwer"+QString::number(i)+"/key","").toString();
        SServer srv(i, ip, portExt, portDB, portClient, pubKey, type);

        addServer(srv);
    }
}
开发者ID:Gonz8,项目名称:RSO-16L,代码行数:29,代码来源:configuration.cpp

示例13: listWidget_show

void NetEin:: listWidget_show()
{
extern int dialog_auswertung;
int row = 1;
QString key_;
QString key;
QStringList comNet_;
    key = " ";
    row = listWidget_net->currentRow();
    comNet = widget_net[row];
    if (comNet.indexOf(" ") != -1){
    comNet_ = comNet.split(" ");
    comNet = comNet_[0];
    comNet_name = comNet_[1];}
    else
         comNet_name = "";
    // Prüfen ob Daten in setting
   QSettings setting("qt5-fsarchiver", "qt5-fsarchiver");
   setting.beginGroup(comNet_name);
   user = setting.value("Name").toString();
   key_ = setting.value("key").toString();
   setting.endGroup();
   //Netzwerk-Daten in Textfeld eintragen
   //key entschlüsseln 
   key = decrypt(key_);
   dummykey = key;
   txt_user ->setText(user);
   txt_key ->setText(key);
}
开发者ID:DieterBaum,项目名称:qt5-fsarchiver,代码行数:29,代码来源:net_ein.cpp

示例14: QTcpServer

Server::Server(Management *m,QObject *parent) :
    QTcpServer(parent),
    management(m)
{
    QSettings setting("settings.ini",QSettings::IniFormat);
    //grouping the settings
    setting.beginGroup("Connection");

    //default settings values
    QVariant defaultPort;
    defaultPort.setValue(4450);

    //send in the default values in case it does not exist...
    QString loadedPort = setting.value("port", defaultPort).toString();

    setting.endGroup();

    bool validPort;
    int aPort = loadedPort.toInt(&validPort);

    if(!validPort) {
        showMessage("The loaded port a valid number(1024-65000), reverting to default(4450)", "error");
        port = 4450;
    } else {
        if(aPort >= 1024 && aPort <= 65000)
            port = aPort;
        else {
            showMessage("The loaded port was not within range(1024-65000), reverting to default(4450)", "error");
            port = 4450;
        }
    }
}
开发者ID:hhvvkk,项目名称:COS301DistrobutedApplicationManger,代码行数:32,代码来源:server.cpp

示例15: do_register_setting

		i_setting::id_type do_register_setting(const string& aSettingCategory, const string& aSettingName, simple_variant::type_e aSettingType, const simple_variant& aDefaultValue = simple_variant(), bool aHidden = false)
		{
			setting_by_name_list::iterator iterCheck = iSettingsByName.find(setting_by_name_list::key_type(aSettingCategory, aSettingName));
			if (iterCheck != iSettingsByName.end())
				throw setting_already_registered();
			simple_variant currentValue = aDefaultValue;
			if (iStore.get() != 0)
			{
				xml::element::iterator xmlIterCategory = iStore->root().find(aSettingCategory.c_str());
				if (xmlIterCategory != iStore->root().end())
				{
					xml::element::iterator xmlIterSetting = xmlIterCategory->find(aSettingName.c_str());
					if (xmlIterSetting != xmlIterCategory->end())
					{
						if (aSettingType != i_simple_variant::CustomType)
							currentValue = from_string(xmlIterSetting->attribute_value("value"), aSettingType);
						else
						{
							string valueType = xmlIterSetting->attribute_value("type");
							string valueData = xmlIterSetting->attribute_value("value");
							currentValue = simple_variant(auto_ref<i_custom_type>(iCustomSettingTypeFactory->create(valueType, valueData)));
						}
					}
				}
			}
			setting_list::iterator iter = iSettings.insert(setting(*this, iNextSettingId++, aSettingCategory, aSettingName, aSettingType, currentValue, aHidden));
			iSettingsByName[std::pair<string, string>(aSettingCategory, aSettingName)] = iter->id();
			return iter->id();
		}
开发者ID:AndreasMartin72,项目名称:neolib,代码行数:29,代码来源:settings.hpp


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