mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kcontrol: remove oxygen-gtk style leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
782194eb95
commit
8714c4cd5f
5 changed files with 10 additions and 76 deletions
|
@ -1212,7 +1212,7 @@ void KColorCm::save()
|
|||
displayGroup.writeEntry("exportKDEColors", applyToAlien->isChecked());
|
||||
cfg.sync();
|
||||
|
||||
runRdb(KRdbExportQtColors | KRdbExportGtkTheme | ( applyToAlien->isChecked() ? KRdbExportColors : 0 ) );
|
||||
runRdb(KRdbExportQtColors | ( applyToAlien->isChecked() ? KRdbExportColors : 0 ) );
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
|
|
@ -333,7 +333,7 @@ bool FontAASettings::load()
|
|||
xft.apply(); // Save this setting
|
||||
KConfigGroup(&kglobals, "General").writeEntry("XftHintStyle", KXftConfig::toStr(hStyle));
|
||||
kglobals.sync();
|
||||
runRdb(KRdbExportXftSettings | KRdbExportGtkTheme);
|
||||
runRdb(KRdbExportXftSettings);
|
||||
}
|
||||
|
||||
hintingStyle->setCurrentIndex(getIndex(hStyle));
|
||||
|
@ -794,7 +794,7 @@ void KFonts::save()
|
|||
}
|
||||
#endif
|
||||
#endif
|
||||
runRdb(KRdbExportXftSettings | KRdbExportGtkTheme);
|
||||
runRdb(KRdbExportXftSettings);
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
|
|
@ -233,14 +233,15 @@ static QString color( const QColor& col )
|
|||
return QString( "{ %1, %2, %3 }" ).arg( item( col.red() ) ).arg( item( col.green() ) ).arg( item( col.blue() ) );
|
||||
}
|
||||
|
||||
static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTheme, const QString& gtkTheme, int version )
|
||||
static void createGtkrc( bool exportColors, const QPalette& cg, int version )
|
||||
{
|
||||
// lukas: why does it create in ~/.kde/share/config ???
|
||||
// pfeiffer: so that we don't overwrite the user's gtkrc.
|
||||
// it is found via the GTK_RC_FILES environment variable.
|
||||
KSaveFile saveFile( KStandardDirs::locateLocal( "config", 2==version?"gtkrc-2.0":"gtkrc" ) );
|
||||
if ( !saveFile.open() )
|
||||
if ( !saveFile.open() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
QTextStream t ( &saveFile );
|
||||
t.setCodec( QTextCodec::codecForLocale () );
|
||||
|
@ -260,64 +261,6 @@ static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTh
|
|||
t << endl;
|
||||
}
|
||||
|
||||
if (exportGtkTheme)
|
||||
{
|
||||
QString gtkStyle;
|
||||
if (gtkTheme.toLower() == "oxygen")
|
||||
gtkStyle = QString("oxygen-gtk");
|
||||
else
|
||||
gtkStyle = gtkTheme;
|
||||
|
||||
bool exist_gtkrc = false;
|
||||
QByteArray gtkrc = getenv(gtkEnvVar(version));
|
||||
QStringList listGtkrc = QFile::decodeName(gtkrc).split(":");
|
||||
if (listGtkrc.contains(saveFile.fileName()))
|
||||
listGtkrc.removeAll(saveFile.fileName());
|
||||
listGtkrc.append(QDir::homePath() + userGtkrc(version));
|
||||
listGtkrc.append(QDir::homePath() + "/.gtkrc-2.0-kde");
|
||||
listGtkrc.append(QDir::homePath() + "/.gtkrc-2.0-kde4");
|
||||
listGtkrc.removeAll("");
|
||||
listGtkrc.removeDuplicates();
|
||||
for (int i = 0; i < listGtkrc.size(); ++i)
|
||||
{
|
||||
if ((exist_gtkrc = QFile::exists(listGtkrc.at(i))))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!exist_gtkrc)
|
||||
{
|
||||
QString gtk2ThemeFilename;
|
||||
gtk2ThemeFilename = QString("%1/.themes/%2/gtk-2.0/gtkrc").arg(QDir::homePath()).arg(gtkStyle);
|
||||
if (!QFile::exists(gtk2ThemeFilename)) {
|
||||
QStringList gtk2ThemePath;
|
||||
gtk2ThemeFilename.clear();
|
||||
QByteArray xdgDataDirs = getenv("XDG_DATA_DIRS");
|
||||
gtk2ThemePath.append(QDir::homePath() + "/.local");
|
||||
gtk2ThemePath.append(QFile::decodeName(xdgDataDirs).split(":"));
|
||||
gtk2ThemePath.removeDuplicates();
|
||||
for (int i = 0; i < gtk2ThemePath.size(); ++i)
|
||||
{
|
||||
gtk2ThemeFilename = QString("%1/themes/%2/gtk-2.0/gtkrc").arg(gtk2ThemePath.at(i)).arg(gtkStyle);
|
||||
if (QFile::exists(gtk2ThemeFilename))
|
||||
break;
|
||||
else
|
||||
gtk2ThemeFilename.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (!gtk2ThemeFilename.isEmpty())
|
||||
{
|
||||
t << "include \"" << gtk2ThemeFilename << "\"" << endl;
|
||||
t << endl;
|
||||
t << "gtk-theme-name=\"" << gtkStyle << "\"" << endl;
|
||||
t << endl;
|
||||
if (gtkStyle == "oxygen-gtk")
|
||||
exportColors = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (exportColors)
|
||||
{
|
||||
t << "style \"default\"" << endl;
|
||||
|
@ -388,7 +331,6 @@ void runRdb( uint flags )
|
|||
bool exportQtColors = flags & KRdbExportQtColors;
|
||||
bool exportQtSettings = flags & KRdbExportQtSettings;
|
||||
bool exportXftSettings = flags & KRdbExportXftSettings;
|
||||
bool exportGtkTheme = flags & KRdbExportGtkTheme;
|
||||
|
||||
KSharedConfigPtr kglobalcfg = KSharedConfig::openConfig( "kdeglobals" );
|
||||
KConfigGroup kglobals(kglobalcfg, "KDE");
|
||||
|
@ -401,17 +343,10 @@ void runRdb( uint flags )
|
|||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
KConfigGroup generalCfgGroup(kglobalcfg, "General");
|
||||
|
||||
QString gtkTheme;
|
||||
if (generalCfgGroup.hasKey("widgetStyle"))
|
||||
gtkTheme = generalCfgGroup.readEntry("widgetStyle");
|
||||
else
|
||||
gtkTheme = "oxygen";
|
||||
|
||||
createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 1 );
|
||||
createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 2 );
|
||||
createGtkrc( exportColors, newPal, 1 );
|
||||
createGtkrc( exportColors, newPal, 2 );
|
||||
|
||||
// Export colors to non-(KDE/Qt) apps (e.g. Motif, GTK+ apps)
|
||||
if (exportColors)
|
||||
|
|
|
@ -26,7 +26,6 @@ enum KRdbAction
|
|||
KRdbExportQtColors = 0x0002, // Export KDE's colors to qtrc
|
||||
KRdbExportQtSettings = 0x0004, // Export all possible qtrc settings, excluding colors
|
||||
KRdbExportXftSettings = 0x0008, // Export KDE's Xft (anti-alias) settings
|
||||
KRdbExportGtkTheme = 0x0010 // Export KDE's widget style to Gtk if possible
|
||||
};
|
||||
|
||||
void runRdb( uint flags );
|
||||
|
|
|
@ -90,7 +90,7 @@ extern "C"
|
|||
{
|
||||
KDE_EXPORT void kcminit_style()
|
||||
{
|
||||
uint flags = KRdbExportQtSettings | KRdbExportQtColors | KRdbExportXftSettings | KRdbExportGtkTheme;
|
||||
uint flags = KRdbExportQtSettings | KRdbExportQtColors | KRdbExportXftSettings;
|
||||
KConfig _config( "kcmdisplayrc", KConfig::NoGlobals );
|
||||
KConfigGroup config(&_config, "X11");
|
||||
|
||||
|
@ -430,7 +430,7 @@ void KCMStyle::save()
|
|||
// export fonts/colors settings.
|
||||
if (m_bStyleDirty | m_bEffectsDirty) // Export only if necessary
|
||||
{
|
||||
uint flags = KRdbExportQtSettings | KRdbExportGtkTheme;
|
||||
uint flags = KRdbExportQtSettings;
|
||||
KConfig _kconfig( "kcmdisplayrc", KConfig::NoGlobals );
|
||||
KConfigGroup kconfig(&_kconfig, "X11");
|
||||
bool exportKDEColors = kconfig.readEntry("exportKDEColors", true);
|
||||
|
|
Loading…
Add table
Reference in a new issue