本文整理汇总了C++中KConfigGroup::writeXdgListEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigGroup::writeXdgListEntry方法的具体用法?C++ KConfigGroup::writeXdgListEntry怎么用?C++ KConfigGroup::writeXdgListEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigGroup
的用法示例。
在下文中一共展示了KConfigGroup::writeXdgListEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void BasicTab::apply()
{
if (_menuEntryInfo)
{
_menuEntryInfo->setDirty();
_menuEntryInfo->setCaption(_nameEdit->text());
_menuEntryInfo->setDescription(_descriptionEdit->text());
_menuEntryInfo->setIcon(_iconButton->icon());
KDesktopFile *df = _menuEntryInfo->desktopFile();
KConfigGroup dg = df->desktopGroup();
dg.writeEntry("Comment", _commentEdit->text());
if (_systrayCB->isChecked())
dg.writeEntry("Exec", _execEdit->lineEdit()->text().prepend("ksystraycmd "));
else
dg.writeEntry("Exec", _execEdit->lineEdit()->text());
dg.writePathEntry("Path", _pathEdit->lineEdit()->text());
if (_terminalCB->isChecked())
dg.writeEntry("Terminal", 1);
else
dg.writeEntry("Terminal", 0);
dg.writeEntry("TerminalOptions", _termOptEdit->text());
dg.writeEntry("X-KDE-SubstituteUID", _uidCB->isChecked());
dg.writeEntry("X-KDE-Username", _uidEdit->text());
dg.writeEntry("StartupNotify", _launchCB->isChecked());
dg.writeEntry( "NoDisplay", _hiddenEntryCB->isChecked() );
QStringList onlyShowIn = df->desktopGroup().readXdgListEntry("OnlyShowIn");
/* the exact semantics of this checkbox are unclear if there is more than just KDE in the list...
* For example: - The list is "Gnome;", the user enables "Only show in KDE" - should we remove Gnome?
* - The list is "Gnome;KDE;", the user unchecks the box - should we keep Gnome?
*/
if ( _onlyShowInKdeCB->isChecked() && !onlyShowIn.contains("KDE"))
onlyShowIn << "KDE";
else if ( !_onlyShowInKdeCB->isChecked() && onlyShowIn.contains("KDE"))
onlyShowIn.removeAll("KDE");
if (onlyShowIn.isEmpty())
dg.deleteEntry("OnlyShowIn");
else
dg.writeXdgListEntry("OnlyShowIn", onlyShowIn);
}
else
{
_menuFolderInfo->setCaption(_nameEdit->text());
_menuFolderInfo->setGenericName(_descriptionEdit->text());
_menuFolderInfo->setComment(_commentEdit->text());
_menuFolderInfo->setIcon(_iconButton->icon());
}
}
示例2: slotInstallSign
void kgpgOptions::slotInstallSign(const QString &mimetype)
{
QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kde5/services/") + QLatin1String( "ServiceMenus/signfile.desktop" ));
KDesktopFile configl2(path);
if (!configl2.isImmutable()) {
KConfigGroup gr = configl2.group("Desktop Entry");
gr.writeXdgListEntry("MimeType", QStringList(mimetype));
gr.writeEntry("X-KDE-ServiceTypes", "KonqPopupMenu/Plugin");
gr.writeEntry("Actions", "sign");
gr = configl2.group("Desktop Action sign");
gr.writeEntry("Name", i18n("Sign File"));
//gr.writeEntry("Icon", "sign_file");
gr.writeEntry("Exec","kgpg -S %F");
}
}