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


C++ TDEConfig类代码示例

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


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

示例1: config

void KSaveIOConfig::setMinimumKeepSize( int _size )
{
  TDEConfig* cfg = config ();
  cfg->setGroup( TQString() );
  cfg->writeEntry( "MinimumKeepSize", _size );
  cfg->sync();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:7,代码来源:ksaveioconfig.cpp

示例2: http_config

void KSaveIOConfig::setCacheControl(TDEIO::CacheControl policy)
{
  TDEConfig* cfg = http_config ();
  TQString tmp = TDEIO::getCacheControlString(policy);
  cfg->writeEntry("cache", tmp);
  cfg->sync();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:7,代码来源:ksaveioconfig.cpp

示例3: mThemeDir

ObjKsTheme::ObjKsTheme( const TQString& theme )
  :mActiveTheme (theme), mThemeDir("/"), mThemeConfig (0L), mThemePrefix( "Themes/" ), d(0)
{
  // Get Xinerama config.
  TDEConfig *config = kapp->config();
  config->setGroup( "Xinerama" );
  TQDesktopWidget *desktop = kapp->desktop();
  mXineramaScreen = config->readNumEntry("KSplashScreen", desktop->primaryScreen());

  // For Xinerama, let's put the mouse on the first head.  Otherwise it could appear anywhere!
  if (desktop->isVirtualDesktop() && mXineramaScreen != -2)
  {
    TQRect rect = desktop->screenGeometry( mXineramaScreen );
    if (!rect.contains(TQCursor::pos()))
      TQCursor::setPos(rect.center());
  }

  // Does the active theme exist?
  if( !loadThemeRc( mActiveTheme, false ) )
    if( !loadLocalConfig( mActiveTheme, false ) )
      if( !loadThemeRc( "Default", false ) )
        loadLocalConfig( "Default", true ); //force: we need some defaults
  loadCmdLineArgs(TDECmdLineArgs::parsedArgs());
  mThemePrefix += ( mActiveTheme + "/" );
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:25,代码来源:objkstheme.cpp

示例4: main

main(int argc, char ** argv)
{
 TDECmdLineArgs::init(argc, argv, "test", description, version);
 
 TDEApplication app;
 TDEConfig * cfg = kapp->config();

 TQDict<char> dict;

 dict.insert("Blah", "Arse");
 dict.insert("Blah", "Smack");
 dict.insert("Blah", "Monkey");

 TQDictIterator<char> it(dict);

 TQString key = "TestConfigItem";

 for (; it.current(); ++it) {

  cerr << "Before saving: " << endl;
  cerr << "key : \"" << key << "\"" << endl;
  cerr << "val : \"" << it.current() << "\"" << endl;

  debug("got back [%s]",cfg->writeEntry(key, it.current()));
//  debug("got back [%s]",s.data());

  cerr << "After saving: " << endl;
  cerr << "key : \"" << key << "\"" << endl;
  cerr << "val : \"" << it.current() << "\"" << endl;

  cerr << endl;
 }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:33,代码来源:tdeconftest.cpp

示例5: setURL

void KfindTabWidget::setURL( const KURL & url )
{
  TDEConfig *conf = TDEGlobal::config();
  conf->setGroup("History");
  m_url = url;
  TQStringList sl = conf->readPathListEntry("Directories");
  dirBox->clear(); // make sure there is no old Stuff in there

  if(!sl.isEmpty()) {
    dirBox->insertStringList(sl);
    // If the _searchPath already exists in the list we do not
    // want to add it again
    int indx = sl.findIndex(m_url.prettyURL());
    if(indx == -1)
      dirBox->insertItem(m_url.prettyURL(), 0); // make it the first one
    else
      dirBox->setCurrentItem(indx);
  }
  else {
    TQDir m_dir("/lib");
    dirBox ->insertItem( m_url.prettyURL() );
    dirBox ->insertItem( "file:" + TQDir::homeDirPath() );
    dirBox ->insertItem( "file:/" );
    dirBox ->insertItem( "file:/usr" );
    if (m_dir.exists())
      dirBox ->insertItem( "file:/lib" );
    dirBox ->insertItem( "file:/home" );
    dirBox ->insertItem( "file:/etc" );
    dirBox ->insertItem( "file:/var" );
    dirBox ->insertItem( "file:/mnt" );
  }
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:32,代码来源:kftabdlg.cpp

示例6: cs

//---------------------------------------------------------------------------
//
// User clicked Cancel
//
void AmorDialog::slotCancel()
{
    // restore offset
    TDEConfig *config = kapp->config();
    TDEConfigGroupSaver cs(config, "General");
    emit offsetChanged(config->readNumEntry("Offset"));
    reject();
}
开发者ID:Fat-Zer,项目名称:tdetoys,代码行数:12,代码来源:amordialog.cpp

示例7: KSimpleConfig

TQString KIMProxy::preferredApp()
{
	TDEConfig *store = new KSimpleConfig( IM_CLIENT_PREFERENCES_FILE );
	store->setGroup( IM_CLIENT_PREFERENCES_SECTION );
	TQString preferredApp = store->readEntry( IM_CLIENT_PREFERENCES_ENTRY );
	//kdDebug( 790 ) << k_funcinfo << "found preferred app: " << preferredApp << endl;
	return preferredApp;
}	
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:8,代码来源:tdeimproxy.cpp

示例8: cfg_write

void Existing_window_condition::cfg_write( TDEConfig& cfg_P ) const
    {
    base::cfg_write( cfg_P );
    TQString save_cfg_group = cfg_P.group();
    cfg_P.setGroup( save_cfg_group + "Window" );
    window()->cfg_write( cfg_P );
    cfg_P.setGroup( save_cfg_group );
    cfg_P.writeEntry( "Type", "EXISTING_WINDOW" ); // overwrites value set in base::cfg_write()
    }
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:9,代码来源:conditions.cpp

示例9: TDEConfig

void EvaServers::fetchAddress( bool isUdp )
{
	int num = 0;
	if(m_bIsFirst){
		m_bIsFirst = false;
		TDEConfig* config = new TDEConfig( (TQDir::homeDirPath() + "/.eva/eva.cfg") );
		config->setGroup("General");
		TQString type = config->readEntry("Server Type");
		if(!type.isEmpty()){
			TQHostAddress addr(config->readEntry("Server IP"));
			if(!addr.isNull()) {
				if( (type == "UDP" && isUdp) ||
						(type == "TCP" && !isUdp)){
					emit isReady(addr);
					return;
				}
			}
		}
		delete config;
	}
				
	if(isUdp){
		num = UDPServers.count();
		fetchType = UDP;
	} else{
		num = TCPServers.count();
		fetchType = TCP;
	}
	if(num == 0 ){
		defaultAddress();
		return;
	}
	//int index = rand() % num;

	int maxItems = isUdp?UDPServers.count():TCPServers.count();
	if(m_CurrAddrIndex>maxItems) m_CurrAddrIndex = 0;
	serverItem addr;
	if(isUdp)
		addr = UDPServers[m_CurrAddrIndex++];
	else
		addr = TCPServers[m_CurrAddrIndex++];
	
	if(addr.type == Addr_IP){
		emit isReady(TQHostAddress(addr.addr.latin1())); // this way, Red hat 9 might work properly
		return;
	}
	
	// the address should be a URL now, so we try to get the IP
	TQDns * dns =  new TQDns(addr.addr, TQDns::A);
	TQObject::connect(dns, SIGNAL(resultsReady()), this, SLOT(getResultsSlot()));


	m_Timeout = new TQTimer(this, "dns timer");
	TQObject::connect(m_Timeout, SIGNAL(timeout()), SLOT(slotTimeout()));
	m_Timeout->start(30000, true);
}
开发者ID:MagicGroup,项目名称:eva,代码行数:56,代码来源:evaservers.cpp

示例10: Condition

Existing_window_condition::Existing_window_condition( TDEConfig& cfg_P, Condition_list_base* parent_P )
    : Condition( cfg_P, parent_P )
    {
    TQString save_cfg_group = cfg_P.group();
    cfg_P.setGroup( save_cfg_group + "Window" );
    _window = new Windowdef_list( cfg_P );
    cfg_P.setGroup( save_cfg_group );
    init();
    set_match();
    }
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:10,代码来源:conditions.cpp

示例11: loadMisc

void KCMStyle::loadMisc( TDEConfig& config )
{
	// TDE's Part via TDEConfig
	config.setGroup("Toolbar style");
	cbHoverButtons->setChecked(config.readBoolEntry("Highlighting", true));
	cbTransparentToolbars->setChecked(config.readBoolEntry("TransparentMoving", true));

	TQString tbIcon = config.readEntry("IconText", "IconOnly");
	if (tbIcon == "TextOnly")
		comboToolbarIcons->setCurrentItem(1);
	else if (tbIcon == "IconTextRight")
		comboToolbarIcons->setCurrentItem(2);
	else if (tbIcon == "IconTextBottom")
		comboToolbarIcons->setCurrentItem(3);
	else
		comboToolbarIcons->setCurrentItem(0);

	config.setGroup("KDE");
	cbIconsOnButtons->setChecked(config.readBoolEntry("ShowIconsOnPushButtons", false));
	cbEnableTooltips->setChecked(!config.readBoolEntry("EffectNoTooltip", false));
	cbTearOffHandles->setChecked(config.readBoolEntry("InsertTearOffHandle", false));

	TQSettings settings;
	cbScrollablePopupMenus->setChecked(settings.readBoolEntry("/TDEStyle/Settings/ScrollablePopupMenus", false));
	cbAutoHideAccelerators->setChecked(settings.readBoolEntry("/TDEStyle/Settings/AutoHideAccelerators", false));
	cbMenuAltKeyNavigation->setChecked(settings.readBoolEntry("/TDEStyle/Settings/MenuAltKeyNavigation", true));
	m_popupMenuDelay->setValue(settings.readNumEntry("/TDEStyle/Settings/PopupMenuDelay", 250));

	m_bToolbarsDirty = false;
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:30,代码来源:kcmstyle.cpp

示例12: accept

void KasPrefsDialog::accept()
{
   TDEConfig *conf = kasbar->config();
   if ( conf ) {
       kasbar->writeConfig( conf );

       conf->setGroup("Layout");
       // TODO: This needs to be made independent of the gui and moved to kastasker
       conf->writeEntry( "MaxBoxes", maxBoxesSpin->value() );

       conf->sync();
   }

   TQDialog::accept();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:15,代码来源:kasprefsdlg.cpp

示例13: TDEConfig

void KeyboardConfig::init_keyboard()
{
	TDEConfig *config = new TDEConfig("kcminputrc", true); // Read-only, no globals
	config->setGroup("Keyboard");

	XKeyboardState   kbd;
	XKeyboardControl kbdc;

	XGetKeyboardControl(kapp->getDisplay(), &kbd);
	bool key = config->readBoolEntry("KeyboardRepeating", true);
	kbdc.key_click_percent = config->readNumEntry("ClickVolume", kbd.key_click_percent);
	kbdc.auto_repeat_mode = (key ? AutoRepeatModeOn : AutoRepeatModeOff);

	XChangeKeyboardControl(kapp->getDisplay(),
						   KBKeyClickPercent | KBAutoRepeatMode,
						   &kbdc);

	if( key ) {
		int delay_ = config->readNumEntry("RepeatDelay", 500);
		double rate_ = config->readDoubleNumEntry("RepeatRate", 30);
		set_repeatrate(delay_, rate_);
	}


	int numlockState = config->readNumEntry( "NumLock", 2 );
	if( numlockState != 2 )
		numlockx_change_numlock_state( numlockState == 0 );

	delete config;
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:30,代码来源:kcmmisc.cpp

示例14: saveSettings

void KMMainView::saveSettings()
{
	TDEConfig	*conf = KMFactory::self()->printConfig();
	conf->setGroup("General");
	conf->writeEntry("ViewType",(int)m_printerview->viewType());
	conf->writeEntry("Orientation",(int)orientation());
	conf->writeEntry("ViewToolBar",((TDEToggleAction*)m_actions->action("view_toolbar"))->isChecked());
	conf->writeEntry("ViewMenuBar",static_cast<TDEToggleAction*>( m_actions->action("view_menubar") )->isChecked());
	conf->writeEntry("ViewPrinterInfos",((TDEToggleAction*)m_actions->action("view_printerinfos"))->isChecked());
	conf->sync();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:11,代码来源:kmmainview.cpp

示例15: init

void KFSConfigPage::init()
{
  TDEConfig *config = kapp->config();
  config->setGroup( "fileselector" );
  // toolbar
  TQStringList l = config->readListEntry( "toolbar actions", ',' );
  if ( l.isEmpty() ) // default toolbar
    l << "up" << "back" << "forward" << "home" <<
                "short view" << "detailed view" <<
                "bookmarks" << "sync_dir";

  // actions from diroperator + two of our own
  TQStringList allActions;
  allActions << "up" << "back" << "forward" << "home" <<
                "reload" << "mkdir" << "delete" <<
                "short view" << "detailed view" /*<< "view menu" <<
                "show hidden" << "properties"*/ <<
                "bookmarks" << "sync_dir";
  TQRegExp re("&(?=[^&])");
  TDEAction *ac;
  TQListBox *lb;
  for ( TQStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it ) {
    lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
    if ( *it == "bookmarks" || *it == "sync_dir" )
      ac = fileSelector->actionCollection()->action( (*it).latin1() );
    else
      ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() );
    if ( ac )
      new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it );
  }

  // sync
  int s = fileSelector->autoSyncEvents;
  cbSyncActive->setChecked( s & KateFileSelector::DocumentChanged );
  cbSyncShow->setChecked( s & KateFileSelector::GotVisible );
  // histories
  sbPathHistLength->setValue( fileSelector->cmbPath->maxItems() );
  sbFilterHistLength->setValue( fileSelector->filter->maxCount() );
  // session
  cbSesLocation->setChecked( config->readBoolEntry( "restore location", true ) );
  cbSesFilter->setChecked( config->readBoolEntry( "restore last filter", true ) );
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:42,代码来源:katefileselector.cpp


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