本文整理汇总了C++中TDEConfig::group方法的典型用法代码示例。如果您正苦于以下问题:C++ TDEConfig::group方法的具体用法?C++ TDEConfig::group怎么用?C++ TDEConfig::group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDEConfig
的用法示例。
在下文中一共展示了TDEConfig::group方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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()
}
示例2: 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();
}
示例3: add
void TDERecentDocument::add(const KURL& url, const TQString& desktopEntryName)
{
if ( url.isLocalFile() && !TDEGlobal::dirs()->relativeLocation("tmp", url.path()).startsWith("/"))
return;
TQString openStr = url.url();
openStr.replace( TQRegExp("\\$"), "$$" ); // Desktop files with type "Link" are $-variable expanded
kdDebug(250) << "TDERecentDocument::add for " << openStr << endl;
TDEConfig *config = TDEGlobal::config();
TQString oldGrp = config->group();
config->setGroup(TQString::fromLatin1("RecentDocuments"));
bool useRecent = config->readBoolEntry(TQString::fromLatin1("UseRecent"), true);
int maxEntries = config->readNumEntry(TQString::fromLatin1("MaxEntries"), 10);
config->setGroup(oldGrp);
if(!useRecent)
return;
TQString path = recentDocumentDirectory();
TQString dStr = path + url.fileName();
TQString ddesktop = dStr + TQString::fromLatin1(".desktop");
int i=1;
// check for duplicates
while(TQFile::exists(ddesktop)){
// see if it points to the same file and application
KSimpleConfig tmp(ddesktop);
tmp.setDesktopGroup();
if(tmp.readEntry(TQString::fromLatin1("X-TDE-LastOpenedWith"))
== desktopEntryName)
{
utime(TQFile::encodeName(ddesktop), NULL);
return;
}
// if not append a (num) to it
++i;
if ( i > maxEntries )
break;
ddesktop = dStr + TQString::fromLatin1("[%1].desktop").arg(i);
}
TQDir dir(path);
// check for max entries, delete oldest files if exceeded
TQStringList list = dir.entryList(TQDir::Files | TQDir::Hidden, TQDir::Time | TQDir::Reversed);
i = list.count();
if(i > maxEntries-1){
TQStringList::Iterator it;
it = list.begin();
while(i > maxEntries-1){
TQFile::remove(dir.absPath() + TQString::fromLatin1("/") + (*it));
--i, ++it;
}
}
// create the applnk
KSimpleConfig conf(ddesktop);
conf.setDesktopGroup();
conf.writeEntry( TQString::fromLatin1("Type"), TQString::fromLatin1("Link") );
conf.writePathEntry( TQString::fromLatin1("URL"), openStr );
// If you change the line below, change the test in the above loop
conf.writeEntry( TQString::fromLatin1("X-TDE-LastOpenedWith"), desktopEntryName );
TQString name = url.fileName();
if (name.isEmpty())
name = openStr;
conf.writeEntry( TQString::fromLatin1("Name"), name );
conf.writeEntry( TQString::fromLatin1("Icon"), KMimeType::iconForURL( url ) );
}