Improve MenuProxy

pull/15/head
reionwong 4 years ago
parent b36ef8a90f
commit 07695b0e6a

1
debian/control vendored

@ -24,6 +24,7 @@ Build-Depends: cmake,
libpolkit-agent-1-dev,
libkf5windowsystem-dev,
libkf5globalaccel-dev,
libkf5coreaddons-dev,
libqt5x11extras5-dev,
qtbase5-dev,
qtdeclarative5-dev,

@ -221,26 +221,24 @@ void MenuProxy::writeGtk3Settings()
// mostly taken from kde-gtk-config
QSettings cfg(gtk3SettingsIniPath(), QSettings::IniFormat);
// cfg.beginGroup("Settings");
// auto cfg = KSharedConfig::openConfig(gtk3SettingsIniPath(), KConfig::NoGlobals);
// KConfigGroup group(cfg, "Settings");
// QStringList gtkModules = group.readEntry("gtk-modules", QString()).split(QLatin1Char(':'), Qt::SkipEmptyParts);
// addOrRemoveAppMenuGtkModule(gtkModules);
// if (!gtkModules.isEmpty()) {
// group.writeEntry("gtk-modules", gtkModules.join(QLatin1Char(':')));
// } else {
// group.deleteEntry("gtk-modules");
// }
// qDebug() << " gtk-modules:" << gtkModules;
// if (m_enabled) {
// group.writeEntry("gtk-shell-shows-menubar", 1);
// } else {
// group.deleteEntry("gtk-shell-shows-menubar");
// }
cfg.beginGroup(QStringLiteral("Settings"));
QStringList gtkModules = cfg.value(QStringLiteral("gtk-modules")).toString().split(QLatin1Char(':'));
addOrRemoveAppMenuGtkModule(gtkModules);
if (!gtkModules.isEmpty()) {
cfg.setValue(QStringLiteral("gtk-modules"), gtkModules.join(QLatin1Char(':')));
} else {
cfg.remove(QStringLiteral("gtk-modules"));
}
qDebug() << " gtk-modules:" << gtkModules;
if (m_enabled) {
cfg.setValue(QStringLiteral("gtk-shell-shows-menubar"), 1);
} else {
cfg.remove(QStringLiteral("gtk-shell-shows-menubar"));
}
qDebug() << " gtk-shell-shows-menubar:" << (m_enabled ? 1 : 0);

Loading…
Cancel
Save