本文整理汇总了C++中ksharedconfig::Ptr::deleteGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::deleteGroup方法的具体用法?C++ Ptr::deleteGroup怎么用?C++ Ptr::deleteGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ksharedconfig::Ptr
的用法示例。
在下文中一共展示了Ptr::deleteGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void ArchiveMailWidget::save()
{
if (!mChanged)
return;
KSharedConfig::Ptr config = KGlobal::config();
// first, delete all filter groups:
const QStringList filterGroups =config->groupList().filter( QRegExp( archiveMailCollectionPattern ) );
foreach ( const QString &group, filterGroups ) {
config->deleteGroup( group );
}
示例2: save
bool FollowUpReminderInfoWidget::save()
{
if (!mChanged) {
return false;
}
KSharedConfig::Ptr config = KSharedConfig::openConfig();
// first, delete all filter groups:
const QStringList filterGroups = config->groupList().filter(QRegularExpression(followUpItemPattern()));
foreach (const QString &group, filterGroups) {
config->deleteGroup(group);
}
示例3: writeConfig
//______________________________________________________________
void ExceptionList::writeConfig( KSharedConfig::Ptr config )
{
// remove all existing exceptions
QString groupName;
for( int index = 0; config->hasGroup( groupName = exceptionGroupName( index ) ); ++index )
{ config->deleteGroup( groupName ); }
// rewrite current exceptions
int index = 0;
foreach( const ConfigurationPtr& exception, _exceptions )
{
Util::writeConfig( exception.data(), config.data(), exceptionGroupName( index ) );
++index;
}
示例4: removeFromConfig
void AlarmDialog::removeFromConfig( const QList<Akonadi::Item::Id> &ids )
{
KSharedConfig::Ptr config = KGlobal::config();
KConfigGroup genGroup( config, "General" );
const int oldNumReminders = genGroup.readEntry( "Reminders", 0 );
QList<ConfItem> newReminders;
// Delete everything
for ( int i = 1; i <= oldNumReminders; ++i ) {
const QString group( QString( "Incidence-%1" ).arg( i ) );
KConfigGroup incGroup( config, group );
const QString uid = incGroup.readEntry( "UID" );
const QDateTime remindAtDate = incGroup.readEntry( "RemindAt", QDateTime() );
const KUrl akonadiUrl = incGroup.readEntry( "AkonadiUrl" );
const Akonadi::Item::Id id = Akonadi::Item::fromUrl( akonadiUrl ).id();
if ( !ids.contains( id ) ) {
ConfItem ci;
ci.akonadiUrl = akonadiUrl;
ci.remindAt = remindAtDate;
ci.uid = uid;
newReminders.append( ci );
}
config->deleteGroup( group );
}
genGroup.writeEntry( "Reminders", newReminders.count() );
//Write everything except those which have an uid we don't want
for ( int i = 0; i < newReminders.count(); ++i ) {
const QString group( QString( "Incidence-%1" ).arg( i + 1 ) );
KConfigGroup incGroup( config, group );
incGroup.writeEntry( "UID", newReminders[i].uid );
incGroup.writeEntry( "RemindAt", newReminders[i].remindAt );
incGroup.writeEntry( "AkonadiUrl", newReminders[i].akonadiUrl );
incGroup.sync();
}
genGroup.sync();
}