Do the previous commit at buildtime instead of runtime.

CCMAIL: espen.hustad@gmail.com

svn path=/trunk/KDE/kdebase/workspace/; revision=894258
This commit is contained in:
Lucas Murray 2008-12-08 11:00:01 +00:00
parent d760d90eb6
commit 3f1f5b8686
2 changed files with 11 additions and 19 deletions

View file

@ -70,8 +70,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
: KCModule( KWinCompositingConfigFactory::componentData(), parent ) : KCModule( KWinCompositingConfigFactory::componentData(), parent )
, mKWinConfig(KSharedConfig::openConfig( "kwinrc" )) , mKWinConfig(KSharedConfig::openConfig( "kwinrc" ))
, m_showConfirmDialog( false ) , m_showConfirmDialog( false )
, openglIndex( 0 )
, xrenderIndex( 1 )
{ {
KGlobal::locale()->insertCatalog( "kwin_effects" ); KGlobal::locale()->insertCatalog( "kwin_effects" );
ui.setupUi(this); ui.setupUi(this);
@ -80,23 +78,20 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
ui.statusTitleWidget->hide(); ui.statusTitleWidget->hide();
setupElectricBorders(); setupElectricBorders();
#define OPENGL_INDEX 0
#define XRENDER_INDEX 1
#ifndef KWIN_HAVE_OPENGL_COMPOSITING #ifndef KWIN_HAVE_OPENGL_COMPOSITING
ui.compositingType->removeItem(openglIndex); ui.compositingType->removeItem( OPENGL_INDEX );
ui.glGroup->setEnabled(false); ui.glGroup->setEnabled( false );
#define OPENGL_INDEX -1
#define XRENDER_INDEX 0
#endif #endif
#ifndef KWIN_HAVE_XRENDER_COMPOSITING #ifndef KWIN_HAVE_XRENDER_COMPOSITING
ui.compositingType->removeItem(xrenderIndex); ui.compositingType->removeItem( XRENDER_INDEX );
ui.xrenderGroup->setEnabled(false); ui.xrenderGroup->setEnabled( false );
#define XRENDER_INDEX -1
#endif #endif
openglIndex = ui.glGroup->isEnabled() ? 0 : -1;
if(ui.xrenderGroup->isEnabled() && ui.glGroup->isEnabled())
xrenderIndex = 1;
else if(ui.xrenderGroup->isEnabled() && !ui.glGroup->isEnabled())
xrenderIndex = 0;
else
xrenderIndex = -1;
connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(compositingEnabled(bool))); connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(compositingEnabled(bool)));
connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
@ -363,7 +358,7 @@ void KWinCompositingConfig::loadAdvancedTab()
{ {
KConfigGroup config(mKWinConfig, "Compositing"); KConfigGroup config(mKWinConfig, "Compositing");
QString backend = config.readEntry("Backend", "OpenGL"); QString backend = config.readEntry("Backend", "OpenGL");
ui.compositingType->setCurrentIndex((backend == "XRender") ? xrenderIndex : 0); ui.compositingType->setCurrentIndex((backend == "XRender") ? XRENDER_INDEX : 0);
// 4 - off, 5 - shown, 6 - always, other are old values // 4 - off, 5 - shown, 6 - always, other are old values
int hps = config.readEntry("HiddenPreviews", 5); int hps = config.readEntry("HiddenPreviews", 5);
if( hps == 6 ) // always if( hps == 6 ) // always
@ -521,7 +516,7 @@ bool KWinCompositingConfig::saveAdvancedTab()
|| config.readEntry("XRenderSmoothScale", false ) != ui.xrenderSmoothScale->isChecked() ) || config.readEntry("XRenderSmoothScale", false ) != ui.xrenderSmoothScale->isChecked() )
advancedChanged = true; advancedChanged = true;
config.writeEntry("Backend", (ui.compositingType->currentIndex() == openglIndex) ? "OpenGL" : "XRender"); config.writeEntry("Backend", (ui.compositingType->currentIndex() == OPENGL_INDEX) ? "OpenGL" : "XRender");
config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex() ] ); config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex() ] );
config.writeEntry("DisableChecks", ui.disableChecks->isChecked()); config.writeEntry("DisableChecks", ui.disableChecks->isChecked());

View file

@ -91,9 +91,6 @@ class KWinCompositingConfig : public KCModule
KSharedConfigPtr mTmpConfig; KSharedConfigPtr mTmpConfig;
bool m_showConfirmDialog; bool m_showConfirmDialog;
int openglIndex;
int xrenderIndex;
enum ElectricBorderEffects enum ElectricBorderEffects
{ {
NoEffect, NoEffect,