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


C++ readConfig函数代码示例

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


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

示例1: QGroupBox

KASearchSettings::KASearchSettings(const char *title, QWidget *parent, const char *name)
  :QGroupBox( title, parent, name )
{
  // setup the main organizer
  //  mainlayout = new QGridLayout( this, 2, 2, 15, 0 );

  // setup the searchlevel
  searchbox = new QGroupBox( this, "searchbox" );
  searchbox->setFrameStyle( QFrame::NoFrame );
  searchmode = new QComboBox( searchbox, "searchmode" );
  //  searchmode->insertStrList(&SearchMode::fullList());
  searchlabel = new QLabel( searchmode, "S&earch Mode", searchbox, "searchlabel" );
  searchlabel->adjustSize();

  // setup the sorttype
  //  sortbox = new QGroupBox( this, "sortbox" );
  //  sortbox->setFrameStyle( QFrame::NoFrame );
  //  sortmode = new QComboBox( sortbox, "sortmode" );
  //  sortlabel = new QLabel( sortmode, "S&ort Mode", sortbox, "sortlabel" );
  //  sortlabel->adjustSize();

  // setup the weightsbox, belongs to sorttype
  //  weightbox = new QGroupBox( this, "weightbox" );
  //  weightbox->setFrameStyle( QFrame::NoFrame );
  //  weightlist = new QListBox( weightbox, "weightlist" );
  //  weightlabel = new QLabel( weightlist, "&Weight", weightbox, "weightlabel" );
  //  weightlabel->adjustSize();

  // setup the nicelevel
  nicebox = new QGroupBox( this, "nicebox" );
  nicebox->setFrameStyle( QFrame::NoFrame );
  nicelevel = new QComboBox( nicebox, "nicelevel" );
  nicelabel = new QLabel( nicelevel, i18n("&Nice Level"), nicebox, "nicelabel" );
  nicelabel->adjustSize();

  // setup the hitslevel
  hitsbox = new QGroupBox( this, "hitsbox" );
  hitsbox->setFrameStyle( QFrame::NoFrame );
  maxhits = new KIntegerLine( hitsbox, "maxhits" );
  hitslabel = new QLabel( maxhits, i18n("max. &Hits"), hitsbox, "hitslabel" );
  hitslabel->adjustSize();
  connect(maxhits, SIGNAL(returnPressed()),
	  this, SLOT(slotRP()) );

  initWidgets();

  doLayout();

  readConfig();
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:50,代码来源:KASettings.cpp

示例2: rInfo

/**
 * \brief Reads components parameters and checks set integrity before signaling the Worker thread to start running
 *   (1) Ice parameters
 *   (2) Local component parameters read at start
 *
 */
void SpecificMonitor::initialize()
{
	rInfo("Starting monitor ...");
	initialTime=QTime::currentTime();
	RoboCompCommonBehavior::ParameterList params;
	readPConfParams(params);
	readConfig(params);
	if(!sendParamsToWorker(params))
	{
		rError("Error reading config parameters. Exiting");
		killYourSelf();
	}
	state = RoboCompCommonBehavior::Running;
}
开发者ID:robocomp,项目名称:robocomp-shelly,代码行数:20,代码来源:specificmonitor.cpp

示例3: configParser

nodeInfo * configParser(int num, char * pwd)
{
    char * buffer;
    nodeInfo * n;

    if ((n=nodeNew(num)) == NULL)
        errorMessage("can not allocate memory!");

    buffer = textPreOper(pwd, num);
    readConfig(buffer, n, num);
    
    free(buffer);
    return n;
}
开发者ID:chengzhycn,项目名称:sdsn,代码行数:14,代码来源:configParser.c

示例4: main

/****** Interactive/qrsh/--qrsh_starter ***************************************
*
*  NAME
*     qrsh_starter -- start a command special correct environment
*
*  SYNOPSIS
*     qrsh_starter <environment file> <noshell>
*     int main(int argc, char **argv[])
*
*  FUNCTION
*     qrsh_starter is used to start a command, optionally with additional
*     arguments, in a special environment.
*     The environment is read from the given <environment file>.
*     The command to be executed is read from the environment variable
*     QRSH_COMMAND and executed either standalone, passed to a wrapper
*     script (environment  variable QRSH_WRAPPER) or (default) in a users login
*     shell (<shell> -c <command>).
*     On exit of the command, or if an error occurs, an exit code is written
*     to the file $TMPDIR/qrsh_exit_code.
*
*     qrsh_starter is called from qrsh to start the remote processes in 
*     the correct environment.
*
*  INPUTS
*     environment file - file with environment information, each line 
*                        contains a tuple <name>=<value>
*     noshell          - if this parameter is passed, the command will be
*                        executed standalone
*
*  RESULT
*     EXIT_SUCCESS, if all actions could be performed,
*     EXIT_FAILURE, if an error occured
*
*  EXAMPLE
*     setenv QRSH_COMMAND "echo test"
*     env > ~/myenvironment
*     rsh <hostname> qrsh_starter ~/myenvironment 
*
*  SEE ALSO
*     Interactive/qsh/--Interactive
*
****************************************************************************
*/
int main(int argc, char *argv[])
{
   int   exitCode = 0;
   char *command  = NULL;
   char *wrapper = NULL;
   int  noshell  = 0;

   /* check for correct usage */
   if(argc < 2) {
      fprintf(stderr, "usage: %s <job spooldir> [noshell]\n", argv[0]);
      exit(EXIT_FAILURE);        
   }

   /* check for noshell */
   if(argc > 2) {
      if(strcmp(argv[2], "noshell") == 0) {
         noshell = 1;
      }
   }

   if(!readConfig(argv[1])) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }

   /* setup environment */
   command = setEnvironment(argv[1], &wrapper);
   if(command == NULL) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }   

   if(!changeDirectory()) {
      writeExitCode(EXIT_FAILURE, 0);
      exit(EXIT_FAILURE);
   }

   /* start job */
   exitCode = startJob(command, wrapper, noshell);

   /* JG: TODO: At this time, we could already pass the exitCode to qrsh.
    *           Currently, this is done by shepherd, but only after 
    *           qrsh_starter and rshd exited.
    *           If we pass exitCode to qrsh, we also have to implement the
    *           shepherd_about_to_exit mechanism here.
    */

   /* write exit code and exit */
   return writeExitCode(EXIT_SUCCESS, exitCode);
}
开发者ID:HPCKP,项目名称:gridengine,代码行数:93,代码来源:qrsh_starter.c

示例5:

//-----------------------------------------------------------------------------
KMFilter::KMFilter(KConfig* config)
{
  int i;

  if (!sActionDict) sActionDict = new KMFilterActionDict;
  if (config) readConfig(config);
  else
  {
    mName = 0;
    mOperator = OpIgnore;
    for (i=0; i<=FILTER_MAX_ACTIONS; i++)
      mAction[i] = NULL;
  }
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:15,代码来源:kmfilter.cpp

示例6: load

OptionsGraphicsMenu::OptionsGraphicsMenu(::Engines::Console *console) : KotORBase::GUI(console) {
	load("optgraphics");

	addBackground(KotORBase::kBackgroundTypeMenu);

	_advanced.reset(new OptionsGraphicsAdvancedMenu(_console));
	_resolution.reset(new OptionsResolutionMenu(_console));

	// Hardcoded, the gui file returns incorrect values
	getCheckBox("CB_SHADOWS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
	getCheckBox("CB_GRASS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);

	readConfig();
}
开发者ID:Supermanu,项目名称:xoreos,代码行数:14,代码来源:graphics.cpp

示例7: ToolsConfigWidgetBase

ToolsConfigWidget::ToolsConfigWidget(QWidget *parent, const char *name)
    : ToolsConfigWidgetBase(parent, name)
{
    m_toolsmenuEntries.setAutoDelete(true);
    m_filecontextEntries.setAutoDelete(true);
    m_dircontextEntries.setAutoDelete(true);

    toolsmenuBox->setAcceptDrops(true);
    toolsmenuBox->installEventFilter(this);
    toolsmenuBox->viewport()->setAcceptDrops(true);
    toolsmenuBox->viewport()->installEventFilter(this);

    readConfig();
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:14,代码来源:toolsconfigwidget.cpp

示例8: LOG_5

void MainDialog::showOptions()
{
	LOG_5("MWIN: Showing settings dialog");
	SettingsDialog * settings = new SettingsDialog(this);
	// Exec for a modal dialog
	int result = settings->exec();
	
	if( result == QDialog::Accepted ){
		LOG_5("MWIN: Applying new settings");
		settings->applyChanges();	// Apply the changes to 'config'
		readConfig();				// Read the values from 'config'
	}
	delete settings;
}
开发者ID:EntityFXCode,项目名称:arsenalsuite,代码行数:14,代码来源:maindialog.cpp

示例9: readConfig

bool OutputString::set_value(std::string val)
{
    if (!isEnabled()) return true;

    readConfig();

    set_value_real(val);
   
    value = val;
    EmitSignalIO();
    emitChange();

    return true;
}
开发者ID:expertisesolutions,项目名称:calaos_base,代码行数:14,代码来源:OutputString.cpp

示例10: readConfig

//______________________________________________________________________________
bool scopeConfigReader::readConfigFiles()
{
    bool success = true;
    /// There are 2 types of objects in the scope, a trace monitor and a number monitor;
    /// They are defined in seperate config files to seperate the data more clearly
    /// they still all end up in an scopeObject
    //NUM
    scopeNumObjects.clear();
    scopeNumMonStructs.clear();
    bool numSuccess = readConfig( *this,  configFile1, &scopeConfigReader::addToScopeNumObjectsV1,nullptr, &scopeConfigReader::addToScopeNumMonStructsV1 );
    if( !numSuccess )
        success = false;
//    if( numObjs == scopeTraceDataObject.size() )
    if( numObjs == scopeNumObjects.size() )
        debugMessage( "*** Created ", numObjs, " scope num Objects, As Expected ***", "\n" );
    else
    {
        debugMessage( "*** Created ", scopeNumObjects.size() ," scope num Objects, Expected ", numObjs,  " ERROR ***", "\n"  );
        success = false;
    }
    //TRACE
    scopeTraceDataObjects.clear();
    scopeTraceDataMonStructs.clear();
    bool traceSuccess = readConfig( *this,  configFile2, &scopeConfigReader::addToScopeTraceDataObjectsV1,nullptr, &scopeConfigReader::addToScopeTraceDataMonStructsV1 );
    if( !traceSuccess )
        success = false;
//    if( numObjs == scopeTraceDataObject.size() )
    if( numObjs == scopeTraceDataObjects.size() )
        debugMessage( "*** Created ", numObjs, " scope trace Objects, As Expected ***", "\n" );
    else
    {
        debugMessage( "*** Created ", scopeTraceDataObjects.size() ," scope trace Objects, Expected ", numObjs,  " ERROR ***", "\n"  );
        success = false;
    }

    return success;
}
开发者ID:adb-xkc85723,项目名称:VELA-CLARA-Controllers,代码行数:38,代码来源:scopeConfigReader.cpp

示例11: main

int main( int argc, char **argv )
{
  TDECmdLineArgs::init( argc, argv, "kasbar", "KasBar", I18N_NOOP( "An alternative task manager" ), VERSION_STRING );
  TDECmdLineArgs::addCmdLineOptions( options );
  TDEGlobal::locale()->setMainCatalogue( "kasbarextension" );
  TDEApplication app;
  TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();

  kdDebug(1345) << "Kasbar starting..." << endl;

  int wflags = TQt::WStyle_Customize | TQt::WX11BypassWM | TQt::WStyle_DialogBorder | TQt::WStyle_StaysOnTop;
  KasBar *kasbar;
  TDEConfig conf( "kasbarrc" );

  if ( args->isSet("test") ) {
      kasbar = new KasBar( Qt::Vertical, 0, "testkas", (TQ_WFlags)wflags );
      kasbar->setItemSize( KasBar::Large );
      kasbar->append( new KasClockItem(kasbar) );
      kasbar->append( new KasItem(kasbar) );
      kasbar->append( new KasLoadItem(kasbar) );
      kasbar->append( new KasItem(kasbar) );
      kasbar->addTestItems();
  }
  else {
      KasTasker *kastasker = new KasTasker( Qt::Vertical, 0, "testkas", (TQ_WFlags)wflags );
      kastasker->setConfig( &conf );
      kastasker->setStandAlone( true );
      kasbar = kastasker;

      kastasker->readConfig();
      kastasker->move( kastasker->detachedPosition() );
      kastasker->connect( kastasker->resources(), TQT_SIGNAL(changed()), TQT_SLOT(readConfig()) );
      kastasker->refreshAll();
  }

  kdDebug(1345) << "Kasbar about to show" << endl;
  app.setMainWidget( kasbar );
  kasbar->show();

  kasbar->setDetached( true );
  KWin::setOnAllDesktops( kasbar->winId(), true );
  kdDebug() << "kasbar: Window id is " << kasbar->winId() << endl;

  TDEApplication::kApplication()->dcopClient()->registerAs( "kasbar" );

  app.connect( &app, TQT_SIGNAL( lastWindowClosed() ), TQT_SLOT(quit()) );

  return app.exec();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:49,代码来源:kasbarapp.cpp

示例12: handle_init

void handle_init() {
  int i;

  srand(time(NULL));
  initColors();

  readConfig();
  swapDigitShapes();
  app_message_init();

  initSplash();

  window = window_create();
  if (invertStatus) {
    window_set_background_color(window, GColorWhite);
  } else {
    window_set_background_color(window, GColorBlack);
  }
  window_stack_push(window, true);

  rootLayer = window_get_root_layer(window);
  mainLayer = layer_create(layer_get_bounds(rootLayer));
  layer_add_child(rootLayer, mainLayer);
  layer_set_update_proc(mainLayer, updateMainLayer);

  for (i=0; i<NUMSLOTS; i++) {
    initSlot(i, mainLayer);
  }

  initDigitCorners();

  animImpl.setup = NULL;
  animImpl.update = animateDigits;
#ifdef PBL_PLATFORM_APLITE
  animImpl.teardown = destroyAnim;
#else
  animImpl.teardown = NULL;
#endif
  createAnim();

  timer = app_timer_register(STARTDELAY, handle_timer, NULL);

  tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);

  accel_tap_service_subscribe(handle_tap);

  lastBluetoothStatus = bluetooth_connection_service_peek();
  bluetooth_connection_service_subscribe(handle_bluetooth);
}
开发者ID:mcandre,项目名称:Blockslide,代码行数:49,代码来源:Blockslide.c

示例13: main

int
main(int argc, char** argv)
{

  setvbuf(stdout, NULL, _IONBF, 0);

  readConfig(argv[1]);

  log_kernel = log_create(argv[2], "KERNEL", false, LOG_LEVEL_TRACE);
  log_info(log_kernel, "Se inicio el Kernel");

  initializateCollections();

  setupSemaphores();

  fillDictionaries();

  startCommunicationWithUMV();

  pthread_t hilo_PLP;
  pthread_t hilo_PCP;

  pthread_create(&hilo_PLP, NULL, *threadPLP, NULL );
  pthread_create(&hilo_PCP, NULL, *threadPCP, NULL );

  actualizarEstado();
  t_nodo_proceso* nodoAListo;
  while (1)
    {

      sem_wait(&sem_multiprog);
      sem_wait(&sem_listaNuevos);
      pthread_mutex_lock(&mutex_listaNuevos);
      nodoAListo = list_remove(listaNuevos, 0);
      pthread_mutex_unlock(&mutex_listaNuevos);
      log_info(log_kernel, "Moviendo PID %d a la lista de Listos",
          nodoAListo->pcb.pid);
      pthread_mutex_lock(&mutex_listaListos);
      queue_push(listaListos, nodoAListo);
      pthread_mutex_unlock(&mutex_listaListos);
      sem_post(&sem_listaListos);
      actualizarEstado();
    }

  pthread_join(hilo_PLP, NULL );
  pthread_join(hilo_PCP, NULL );

  return 0;
}
开发者ID:Charlyzzz,项目名称:estaCoverflow,代码行数:49,代码来源:kernelPosta.c

示例14: KConfigSkeleton

PHPSettings::PHPSettings(  )
  : KConfigSkeleton( QString::fromLatin1( "protoeditorrc" ) )
{
  setCurrentGroup( QString::fromLatin1( "PHP" ) );

  KConfigSkeleton::ItemString  *itemDefaultDebugger;
  itemDefaultDebugger = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "DefaultDebugger" ), mDefaultDebugger );
  addItem( itemDefaultDebugger, QString::fromLatin1( "DefaultDebugger" ) );

  KConfigSkeleton::ItemString  *itemPHPCommand;
  itemPHPCommand = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "PHPCommand" ), mPHPCommand, "php %1");
  addItem( itemPHPCommand, QString::fromLatin1( "PHPCommand" ) );

  readConfig();
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:15,代码来源:phpsettings.cpp

示例15: kbackupdlgdecl

KBackupDlg::KBackupDlg(QWidget* parent)
    : kbackupdlgdecl(parent)
{
  readConfig();

  KGuiItem chooseButtenItem(i18n("C&hoose..."),
                            QIcon::fromTheme("folder"),
                            i18n("Select mount point"),
                            i18n("Use this to browse to the mount point."));
  KGuiItem::assign(chooseButton, chooseButtenItem);

  connect(chooseButton, SIGNAL(clicked()), this, SLOT(chooseButtonClicked()));
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
开发者ID:KDE,项目名称:kmymoney,代码行数:15,代码来源:kbackupdlg.cpp


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