Changeset View
Changeset View
Standalone View
Standalone View
kcms/krdb/krdb.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | #include <kconfiggroup.h> | 45 | #include <kconfiggroup.h> | ||
46 | #include <kprocess.h> | 46 | #include <kprocess.h> | ||
47 | #include <KLocalizedString> | 47 | #include <KLocalizedString> | ||
48 | #include <kdelibs4migration.h> | 48 | #include <kdelibs4migration.h> | ||
49 | #include <KWindowSystem> | 49 | #include <KWindowSystem> | ||
50 | 50 | | |||
51 | #include <updatelaunchenvjob.h> | 51 | #include <updatelaunchenvjob.h> | ||
52 | 52 | | |||
53 | #include "../fonts/kxftconfig.h" | ||||
54 | #include "../fonts/fontssettingsaa.h" | ||||
55 | | ||||
53 | #include "krdb.h" | 56 | #include "krdb.h" | ||
54 | #if HAVE_X11 | 57 | #if HAVE_X11 | ||
55 | #include <X11/Xlib.h> | 58 | #include <X11/Xlib.h> | ||
56 | #include <QX11Info> | 59 | #include <QX11Info> | ||
57 | #endif | 60 | #endif | ||
58 | inline const char * gtkEnvVar(int version) | 61 | inline const char * gtkEnvVar(int version) | ||
59 | { | 62 | { | ||
60 | return 2==version ? "GTK2_RC_FILES" : "GTK_RC_FILES"; | 63 | return 2==version ? "GTK2_RC_FILES" : "GTK_RC_FILES"; | ||
▲ Show 20 Lines • Show All 620 Lines • ▼ Show 20 Line(s) | 672 | { | |||
681 | 684 | | |||
682 | QTemporaryFile tmpFile; | 685 | QTemporaryFile tmpFile; | ||
683 | if (!tmpFile.open()) | 686 | if (!tmpFile.open()) | ||
684 | { | 687 | { | ||
685 | qDebug() << "Couldn't open temp file"; | 688 | qDebug() << "Couldn't open temp file"; | ||
686 | exit(0); | 689 | exit(0); | ||
687 | } | 690 | } | ||
688 | 691 | | |||
689 | | ||||
690 | KConfigGroup generalCfgGroup(kglobalcfg, "General"); | | |||
691 | | ||||
692 | QString gtkTheme; | 692 | QString gtkTheme; | ||
693 | if (kglobals.hasKey("widgetStyle")) | 693 | if (kglobals.hasKey("widgetStyle")) | ||
694 | gtkTheme = kglobals.readEntry("widgetStyle"); | 694 | gtkTheme = kglobals.readEntry("widgetStyle"); | ||
695 | else | 695 | else | ||
696 | gtkTheme = QStringLiteral("oxygen"); | 696 | gtkTheme = QStringLiteral("oxygen"); | ||
697 | 697 | | |||
698 | createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 1 ); | 698 | createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 1 ); | ||
699 | createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 2 ); | 699 | createGtkrc( exportColors, newPal, exportGtkTheme, gtkTheme, 2 ); | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
759 | if (!theme.isNull()) | 759 | if (!theme.isNull()) | ||
760 | contents = "Xcursor.theme: " + theme + '\n'; | 760 | contents = "Xcursor.theme: " + theme + '\n'; | ||
761 | 761 | | |||
762 | if (!size.isNull()) | 762 | if (!size.isNull()) | ||
763 | contents += "Xcursor.size: " + size + '\n'; | 763 | contents += "Xcursor.size: " + size + '\n'; | ||
764 | 764 | | |||
765 | if (exportXftSettings) | 765 | if (exportXftSettings) | ||
766 | { | 766 | { | ||
767 | FontsSettingsAA settingsAA; | ||||
767 | contents += QLatin1String("Xft.antialias: "); | 768 | contents += QLatin1String("Xft.antialias: "); | ||
768 | if(generalCfgGroup.readEntry("XftAntialias", true)) | 769 | if(settingsAA.antiAliasing()) | ||
769 | contents += QLatin1String("1\n"); | 770 | contents += QLatin1String("1\n"); | ||
770 | else | 771 | else | ||
771 | contents += QLatin1String("0\n"); | 772 | contents += QLatin1String("0\n"); | ||
772 | 773 | | |||
773 | QString hintStyle = generalCfgGroup.readEntry("XftHintStyle", "hintslight"); | 774 | KXftConfig::Hint::Style hStyle = (KXftConfig::Hint::Style)settingsAA.hinting(); | ||
crossi: `static_cast<>` | |||||
775 | QString hintStyle = KXftConfig::toStr(hStyle); | ||||
774 | contents += QLatin1String("Xft.hinting: "); | 776 | contents += QLatin1String("Xft.hinting: "); | ||
775 | if(hintStyle.isEmpty()) | 777 | if(hintStyle.isEmpty()) | ||
776 | contents += QLatin1String("-1\n"); | 778 | contents += QLatin1String("-1\n"); | ||
777 | else | 779 | else | ||
778 | { | 780 | { | ||
779 | if(hintStyle!=QLatin1String("hintnone")) | 781 | if(hintStyle!=QLatin1String("hintnone")) | ||
780 | contents += QLatin1String("1\n"); | 782 | contents += QLatin1String("1\n"); | ||
781 | else | 783 | else | ||
782 | contents += QLatin1String("0\n"); | 784 | contents += QLatin1String("0\n"); | ||
783 | contents += "Xft.hintstyle: " + hintStyle + '\n'; | 785 | contents += "Xft.hintstyle: " + hintStyle + '\n'; | ||
784 | } | 786 | } | ||
785 | 787 | | |||
786 | QString subPixel = generalCfgGroup.readEntry("XftSubPixel", "rgb"); | 788 | KXftConfig::SubPixel::Type spType = (KXftConfig::SubPixel::Type)settingsAA.subPixel(); | ||
crossi: `static_cast<>` | |||||
789 | QString subPixel = KXftConfig::toStr(spType); | ||||
787 | if(!subPixel.isEmpty()) | 790 | if(!subPixel.isEmpty()) | ||
788 | contents += "Xft.rgba: " + subPixel + '\n'; | 791 | contents += "Xft.rgba: " + subPixel + '\n'; | ||
789 | 792 | | |||
790 | KConfig _cfgfonts( QStringLiteral("kcmfonts") ); | 793 | KConfig _cfgfonts( QStringLiteral("kcmfonts") ); | ||
791 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | 794 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | ||
792 | 795 | | |||
793 | int dpi; | 796 | int dpi; | ||
794 | 797 | | |||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |
static_cast<>