read*entry--
svn path=/trunk/KDE/kdebase/workspace/; revision=500998
This commit is contained in:
parent
9eb77ae332
commit
42937f76a7
12 changed files with 108 additions and 112 deletions
|
@ -107,8 +107,8 @@ void ModernSysConfig::load(KConfig* /*conf*/)
|
|||
cbShowHandle->setChecked(i);
|
||||
hbox->setEnabled(i);
|
||||
handleSizeSlider->setEnabled(i);
|
||||
handleWidth = clientrc->readUnsignedNumEntry("HandleWidth", 6);
|
||||
handleSize = clientrc->readUnsignedNumEntry("HandleSize", 30);
|
||||
handleWidth = clientrc->readEntry("HandleWidth", 6);
|
||||
handleSize = clientrc->readEntry("HandleSize", 30);
|
||||
handleSizeSlider->setValue(QMIN((handleWidth - 6) / 2, (uint)4));
|
||||
|
||||
}
|
||||
|
|
|
@ -222,10 +222,10 @@ void ModernSysFactory::read_config()
|
|||
|
||||
KConfig c("kwinmodernsysrc");
|
||||
c.setGroup("General");
|
||||
showh = c.readEntry("ShowHandle", QVariant(true)).toBool();
|
||||
showh = c.readEntry("ShowHandle", true);
|
||||
|
||||
hwidth = c.readUnsignedNumEntry("HandleWidth", 6);
|
||||
hsize = c.readUnsignedNumEntry("HandleSize", 30);
|
||||
hwidth = c.readEntry("HandleWidth", 6);
|
||||
hsize = c.readEntry("HandleSize", 30);
|
||||
if (!(showh && hsize && hwidth)) {
|
||||
showh = false;
|
||||
hwidth = hsize = 0;
|
||||
|
|
|
@ -170,7 +170,7 @@ void PlastikHandler::readConfig()
|
|||
m_titleShadow = config.readEntry("TitleShadow", QVariant(true)).toBool();
|
||||
|
||||
QFontMetrics fm(m_titleFont); // active font = inactive font
|
||||
int titleHeightMin = config.readNumEntry("MinTitleHeight", 16);
|
||||
int titleHeightMin = config.readEntry("MinTitleHeight", 16);
|
||||
// The title should strech with bigger font sizes!
|
||||
m_titleHeight = QMAX(titleHeightMin, fm.height() + 4); // 4 px for the shadow etc.
|
||||
// have an even title/button size so the button icons are fully centered...
|
||||
|
@ -178,7 +178,7 @@ void PlastikHandler::readConfig()
|
|||
m_titleHeight++;
|
||||
|
||||
fm = QFontMetrics(m_titleFontTool); // active font = inactive font
|
||||
int titleHeightToolMin = config.readNumEntry("MinTitleHeightTool", 13);
|
||||
int titleHeightToolMin = config.readEntry("MinTitleHeightTool", 13);
|
||||
// The title should strech with bigger font sizes!
|
||||
m_titleHeightTool = QMAX(titleHeightToolMin, fm.height() ); // don't care about the shadow etc.
|
||||
// have an even title/button size so the button icons are fully centered...
|
||||
|
|
|
@ -395,10 +395,10 @@ void KFocusConfig::load( void )
|
|||
else if(key == "FocusStrictlyUnderMouse")
|
||||
setFocus(FOCUS_STRICTLY_UNDER_MOUSE);
|
||||
|
||||
int k = config->readNumEntry(KWIN_AUTORAISE_INTERVAL,750);
|
||||
int k = config->readEntry(KWIN_AUTORAISE_INTERVAL,750);
|
||||
setAutoRaiseInterval(k);
|
||||
|
||||
k = config->readNumEntry(KWIN_DELAYFOCUS_INTERVAL,750);
|
||||
k = config->readEntry(KWIN_DELAYFOCUS_INTERVAL,750);
|
||||
setDelayFocusInterval(k);
|
||||
|
||||
key = config->readEntry(KWIN_AUTORAISE);
|
||||
|
@ -669,14 +669,14 @@ void KAdvancedConfig::load( void )
|
|||
|
||||
setAnimateShade(config->readEntry(KWIN_ANIMSHADE, QVariant(true)).toBool());
|
||||
setShadeHover(config->readEntry(KWIN_SHADEHOVER, QVariant(false)).toBool());
|
||||
setShadeHoverInterval(config->readNumEntry(KWIN_SHADEHOVER_INTERVAL, 250));
|
||||
setShadeHoverInterval(config->readEntry(KWIN_SHADEHOVER_INTERVAL, 250));
|
||||
|
||||
setElectricBorders(config->readNumEntry(KWM_ELECTRIC_BORDER, false));
|
||||
setElectricBorderDelay(config->readNumEntry(KWM_ELECTRIC_BORDER_DELAY, 150));
|
||||
setElectricBorders(config->readEntry(KWM_ELECTRIC_BORDER, false));
|
||||
setElectricBorderDelay(config->readEntry(KWM_ELECTRIC_BORDER_DELAY, 150));
|
||||
|
||||
// setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 2 ));
|
||||
// setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 2 ));
|
||||
// TODO default to low for now
|
||||
setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 1 ));
|
||||
setFocusStealing( config->readEntry(KWIN_FOCUS_STEALING, 1 ));
|
||||
setHideUtilityWindowsForInactive( config->readEntry( KWIN_HIDE_UTILITY, QVariant(true )).toBool());
|
||||
|
||||
emit KCModule::changed(false);
|
||||
|
@ -1024,7 +1024,7 @@ void KMovingConfig::load( void )
|
|||
|
||||
//CT 17Jun1998 - variable animation speed from 0 (none!!) to 10 (max)
|
||||
bool anim = config->readEntry(KWIN_MINIMIZE_ANIM, QVariant(true )).toBool();
|
||||
int animSpeed = config->readNumEntry(KWIN_MINIMIZE_ANIM_SPEED, 5);
|
||||
int animSpeed = config->readEntry(KWIN_MINIMIZE_ANIM_SPEED, 5);
|
||||
if( animSpeed < 1 ) animSpeed = 0;
|
||||
if( animSpeed > 10 ) animSpeed = 10;
|
||||
setMinimizeAnim( anim );
|
||||
|
@ -1080,12 +1080,12 @@ void KMovingConfig::load( void )
|
|||
|
||||
int v;
|
||||
|
||||
v = config->readNumEntry(KWM_BRDR_SNAP_ZONE, KWM_BRDR_SNAP_ZONE_DEFAULT);
|
||||
v = config->readEntry(KWM_BRDR_SNAP_ZONE, KWM_BRDR_SNAP_ZONE_DEFAULT);
|
||||
if (v > MAX_BRDR_SNAP) setBorderSnapZone(MAX_BRDR_SNAP);
|
||||
else if (v < 0) setBorderSnapZone (0);
|
||||
else setBorderSnapZone(v);
|
||||
|
||||
v = config->readNumEntry(KWM_WNDW_SNAP_ZONE, KWM_WNDW_SNAP_ZONE_DEFAULT);
|
||||
v = config->readEntry(KWM_WNDW_SNAP_ZONE, KWM_WNDW_SNAP_ZONE_DEFAULT);
|
||||
if (v > MAX_WNDW_SNAP) setWindowSnapZone(MAX_WNDW_SNAP);
|
||||
else if (v < 0) setWindowSnapZone (0);
|
||||
else setWindowSnapZone(v);
|
||||
|
@ -1441,15 +1441,15 @@ void KTranslucencyConfig::load( void )
|
|||
keepAboveAsActive->setChecked(config->readEntry("TreatKeepAboveAsActive", QVariant(true)).toBool());
|
||||
onlyDecoTranslucent->setChecked(config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool());
|
||||
|
||||
activeWindowOpacity->setValue(config->readNumEntry("ActiveWindowOpacity",100));
|
||||
inactiveWindowOpacity->setValue(config->readNumEntry("InactiveWindowOpacity",75));
|
||||
movingWindowOpacity->setValue(config->readNumEntry("MovingWindowOpacity",25));
|
||||
dockWindowOpacity->setValue(config->readNumEntry("DockOpacity",80));
|
||||
activeWindowOpacity->setValue(config->readEntry("ActiveWindowOpacity",100));
|
||||
inactiveWindowOpacity->setValue(config->readEntry("InactiveWindowOpacity",75));
|
||||
movingWindowOpacity->setValue(config->readEntry("MovingWindowOpacity",25));
|
||||
dockWindowOpacity->setValue(config->readEntry("DockOpacity",80));
|
||||
|
||||
int ass, iss, dss;
|
||||
dss = config->readNumEntry("DockShadowSize", 33);
|
||||
ass = config->readNumEntry("ActiveWindowShadowSize", 133);
|
||||
iss = config->readNumEntry("InactiveWindowShadowSize", 67);
|
||||
dss = config->readEntry("DockShadowSize", 33);
|
||||
ass = config->readEntry("ActiveWindowShadowSize", 133);
|
||||
iss = config->readEntry("InactiveWindowShadowSize", 67);
|
||||
|
||||
activeWindowOpacity->setEnabled(activeWindowTransparency->isChecked());
|
||||
inactiveWindowOpacity->setEnabled(inactiveWindowTransparency->isChecked());
|
||||
|
@ -1462,10 +1462,10 @@ void KTranslucencyConfig::load( void )
|
|||
disableARGB->setChecked(conf_.readEntry("DisableARGB", QVariant(FALSE)).toBool());
|
||||
|
||||
useShadows->setChecked(conf_.readEntry("Compmode","CompClientShadows").compare("CompClientShadows") == 0);
|
||||
shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-80)));
|
||||
shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",0)));
|
||||
shadowTopOffset->setValue(-1*(conf_.readEntry("ShadowOffsetY",-80)));
|
||||
shadowLeftOffset->setValue(-1*(conf_.readEntry("ShadowOffsetX",0)));
|
||||
|
||||
int ss = conf_.readNumEntry("ShadowRadius",6);
|
||||
int ss = conf_.readEntry("ShadowRadius",6);
|
||||
dockWindowShadowSize->setValue((int)(dss*ss/100.0));
|
||||
activeWindowShadowSize->setValue((int)(ass*ss/100.0));
|
||||
inactiveWindowShadowSize->setValue((int)(iss*ss/100.0));
|
||||
|
@ -1481,8 +1481,8 @@ void KTranslucencyConfig::load( void )
|
|||
|
||||
fadeInWindows->setChecked(conf_.readEntry("FadeWindows", QVariant(TRUE)).toBool());
|
||||
fadeOnOpacityChange->setChecked(conf_.readEntry("FadeTrans", QVariant(FALSE)).toBool());
|
||||
fadeInSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeInStep",0.020)*1000.0));
|
||||
fadeOutSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeOutStep",0.070)*1000.0));
|
||||
fadeInSpeed->setValue((int)(conf_.readEntry("FadeInStep",0.020)*1000.0));
|
||||
fadeOutSpeed->setValue((int)(conf_.readEntry("FadeOutStep",0.070)*1000.0));
|
||||
|
||||
emit KCModule::changed(false);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ static void loadRules( QList< Rules* >& rules )
|
|||
{
|
||||
KConfig cfg( "kwinrulesrc", true );
|
||||
cfg.setGroup( "General" );
|
||||
int count = cfg.readNumEntry( "count" );
|
||||
int count = cfg.readEntry( "count",0 );
|
||||
for( int i = 1;
|
||||
i <= count;
|
||||
++i )
|
||||
|
|
|
@ -152,7 +152,7 @@ void KCMRulesList::load()
|
|||
rules.clear();
|
||||
KConfig cfg( "kwinrulesrc", true );
|
||||
cfg.setGroup( "General" );
|
||||
int count = cfg.readNumEntry( "count" );
|
||||
int count = cfg.readEntry( "count",0 );
|
||||
rules.reserve( count );
|
||||
for( int i = 1;
|
||||
i <= count;
|
||||
|
|
36
options.cpp
36
options.cpp
|
@ -74,9 +74,9 @@ unsigned long Options::updateSettings()
|
|||
|
||||
rollOverDesktops = config->readEntry("RollOverDesktops", QVariant(TRUE)).toBool();
|
||||
|
||||
// focusStealingPreventionLevel = config->readNumEntry( "FocusStealingPreventionLevel", 2 );
|
||||
// focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 2 );
|
||||
// TODO use low level for now
|
||||
focusStealingPreventionLevel = config->readNumEntry( "FocusStealingPreventionLevel", 1 );
|
||||
focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 1 );
|
||||
focusStealingPreventionLevel = qMax( 0, qMin( 4, focusStealingPreventionLevel ));
|
||||
if( !focusPolicyIsReasonable()) // #48786, comments #7 and later
|
||||
focusStealingPreventionLevel = 0;
|
||||
|
@ -104,7 +104,7 @@ unsigned long Options::updateSettings()
|
|||
animateShade = config->readEntry("AnimateShade", QVariant(TRUE )).toBool();
|
||||
|
||||
animateMinimize = config->readEntry("AnimateMinimize", QVariant(TRUE )).toBool();
|
||||
animateMinimizeSpeed = config->readNumEntry("AnimateMinimizeSpeed", 5 );
|
||||
animateMinimizeSpeed = config->readEntry("AnimateMinimizeSpeed", 5 );
|
||||
|
||||
if( focusPolicy == ClickToFocus )
|
||||
{
|
||||
|
@ -116,22 +116,22 @@ unsigned long Options::updateSettings()
|
|||
else
|
||||
{
|
||||
autoRaise = config->readEntry("AutoRaise", QVariant(FALSE )).toBool();
|
||||
autoRaiseInterval = config->readNumEntry("AutoRaiseInterval", 0 );
|
||||
autoRaiseInterval = config->readEntry("AutoRaiseInterval", 0 );
|
||||
delayFocus = config->readEntry("DelayFocus", QVariant(FALSE )).toBool();
|
||||
delayFocusInterval = config->readNumEntry("DelayFocusInterval", 0 );
|
||||
delayFocusInterval = config->readEntry("DelayFocusInterval", 0 );
|
||||
}
|
||||
|
||||
shadeHover = config->readEntry("ShadeHover", QVariant(FALSE )).toBool();
|
||||
shadeHoverInterval = config->readNumEntry("ShadeHoverInterval", 250 );
|
||||
shadeHoverInterval = config->readEntry("ShadeHoverInterval", 250 );
|
||||
|
||||
// important: autoRaise implies ClickRaise
|
||||
clickRaise = autoRaise || config->readEntry("ClickRaise", QVariant(TRUE )).toBool();
|
||||
|
||||
borderSnapZone = config->readNumEntry("BorderSnapZone", 10);
|
||||
windowSnapZone = config->readNumEntry("WindowSnapZone", 10);
|
||||
borderSnapZone = config->readEntry("BorderSnapZone", 10);
|
||||
windowSnapZone = config->readEntry("WindowSnapZone", 10);
|
||||
snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", QVariant(FALSE)).toBool();
|
||||
electric_borders = config->readNumEntry("ElectricBorders", 0);
|
||||
electric_border_delay = config->readNumEntry("ElectricBorderDelay", 150);
|
||||
electric_borders = config->readEntry("ElectricBorders", 0);
|
||||
electric_border_delay = config->readEntry("ElectricBorderDelay", 150);
|
||||
|
||||
OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "Shade"), true );
|
||||
d->OpMaxButtonLeftClick = windowOperation( config->readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true );
|
||||
|
@ -151,7 +151,7 @@ unsigned long Options::updateSettings()
|
|||
++it )
|
||||
(*it) = (*it).lower();
|
||||
|
||||
killPingTimeout = config->readNumEntry( "KillPingTimeout", 5000 );
|
||||
killPingTimeout = config->readEntry( "KillPingTimeout", 5000 );
|
||||
hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", QVariant( true )).toBool();
|
||||
|
||||
// Mouse bindings
|
||||
|
@ -177,19 +177,19 @@ unsigned long Options::updateSettings()
|
|||
useTranslucency = config->readEntry("UseTranslucency", QVariant(false)).toBool();
|
||||
config->setGroup( "Translucency");
|
||||
translucentActiveWindows = config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool();
|
||||
activeWindowOpacity = uint((config->readNumEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
|
||||
activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
|
||||
translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", QVariant(false)).toBool();
|
||||
inactiveWindowOpacity = uint((config->readNumEntry("InactiveWindowOpacity", 75)/100.0)*0xFFFFFFFF);
|
||||
inactiveWindowOpacity = uint((config->readEntry("InactiveWindowOpacity", 75)/100.0)*0xFFFFFFFF);
|
||||
translucentMovingWindows = config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool();
|
||||
movingWindowOpacity = uint((config->readNumEntry("MovingWindowOpacity", 50)/100.0)*0xFFFFFFFF);
|
||||
movingWindowOpacity = uint((config->readEntry("MovingWindowOpacity", 50)/100.0)*0xFFFFFFFF);
|
||||
translucentDocks = config->readEntry("TranslucentDocks", QVariant(false)).toBool();
|
||||
dockOpacity = uint((config->readNumEntry("DockOpacity", 80)/100.0)*0xFFFFFFFF);
|
||||
dockOpacity = uint((config->readEntry("DockOpacity", 80)/100.0)*0xFFFFFFFF);
|
||||
keepAboveAsActive = config->readEntry("TreatKeepAboveAsActive", QVariant(true)).toBool();
|
||||
//TODO: remove this variable
|
||||
useTitleMenuSlider = true;
|
||||
activeWindowShadowSize = config->readNumEntry("ActiveWindowShadowSize", 200);
|
||||
inactiveWindowShadowSize = config->readNumEntry("InactiveWindowShadowSize", 100);
|
||||
dockShadowSize = config->readNumEntry("DockShadowSize", 80);
|
||||
activeWindowShadowSize = config->readEntry("ActiveWindowShadowSize", 200);
|
||||
inactiveWindowShadowSize = config->readEntry("InactiveWindowShadowSize", 100);
|
||||
dockShadowSize = config->readEntry("DockShadowSize", 80);
|
||||
removeShadowsOnMove = config->readEntry("RemoveShadowsOnMove", QVariant(true)).toBool();
|
||||
removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", QVariant(true)).toBool();
|
||||
onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool();
|
||||
|
|
|
@ -119,8 +119,8 @@ void PopupInfo::reconfigure()
|
|||
{
|
||||
KConfig * c(KGlobal::config());
|
||||
c->setGroup("PopupInfo");
|
||||
m_show = c->readNumEntry("ShowPopup", false );
|
||||
m_delayTime = c->readNumEntry("PopupHideDelay", 350 );
|
||||
m_show = c->readEntry("ShowPopup", false );
|
||||
m_delayTime = c->readEntry("PopupHideDelay", 350 );
|
||||
}
|
||||
|
||||
void PopupInfo::showInfo(QString infoString)
|
||||
|
|
90
rules.cpp
90
rules.cpp
|
@ -86,29 +86,26 @@ Rules::Rules( const QString& str, bool temporary )
|
|||
#define READ_MATCH_STRING( var, func ) \
|
||||
var = cfg.readEntry( #var ) func; \
|
||||
var##match = (StringMatch) QMAX( FirstStringMatch, \
|
||||
QMIN( LastStringMatch, static_cast< StringMatch >( cfg.readNumEntry( #var "match" ))));
|
||||
QMIN( LastStringMatch, static_cast< StringMatch >( cfg.readEntry( #var "match",0 ))));
|
||||
|
||||
#define READ_SET_RULE( var, type, func ) \
|
||||
var = func ( cfg.read##type##Entry( #var )); \
|
||||
var##rule = readSetRule( cfg, #var "rule" );
|
||||
|
||||
#define READ_SET_RULE_DEF( var, type, func, def ) \
|
||||
var = func ( cfg.read##type##Entry( #var, def )); \
|
||||
var##rule = readSetRule( cfg, #var "rule" );
|
||||
|
||||
#define READ_SET_RULE_2( var, type, func, funcarg ) \
|
||||
var = func ( cfg.read##type##Entry( #var ), funcarg ); \
|
||||
#define READ_SET_RULE( var, func, def ) \
|
||||
var = func ( cfg.readEntry( #var, def)); \
|
||||
var##rule = readSetRule( cfg, #var "rule" );
|
||||
|
||||
#define READ_FORCE_RULE( var, type, func ) \
|
||||
var = func ( cfg.read##type##Entry( #var )); \
|
||||
#define READ_SET_RULE_DEF( var , func, def ) \
|
||||
var = func ( cfg.readEntry( #var, def )); \
|
||||
var##rule = readSetRule( cfg, #var "rule" );
|
||||
|
||||
#define READ_FORCE_RULE( var, func, def) \
|
||||
var = func ( cfg.readEntry( #var, def)); \
|
||||
var##rule = readForceRule( cfg, #var "rule" );
|
||||
|
||||
#define READ_FORCE_RULE_2( var, type, func, funcarg ) \
|
||||
var = func ( cfg.read##type##Entry( #var ), funcarg ); \
|
||||
#define READ_FORCE_RULE2( var, def, func, funcarg ) \
|
||||
var = func ( cfg.readEntry( #var, def),funcarg ); \
|
||||
var##rule = readForceRule( cfg, #var "rule" );
|
||||
|
||||
|
||||
|
||||
Rules::Rules( KConfig& cfg )
|
||||
: temporary_state( 0 )
|
||||
{
|
||||
|
@ -127,51 +124,50 @@ void Rules::readFromCfg( KConfig& cfg )
|
|||
READ_MATCH_STRING( extrarole, .lower().latin1() );
|
||||
READ_MATCH_STRING( clientmachine, .lower().latin1() );
|
||||
types = cfg.readUnsignedLongNumEntry( "types", NET::AllTypesMask );
|
||||
READ_FORCE_RULE_2( placement,, Placement::policyFromString, false );
|
||||
READ_SET_RULE_DEF( position, Point,, &invalidPoint );
|
||||
READ_SET_RULE( size, Size, );
|
||||
READ_FORCE_RULE2( placement,QString(), Placement::policyFromString,false );
|
||||
READ_SET_RULE_DEF( position, , invalidPoint );
|
||||
READ_SET_RULE( size,, QSize());
|
||||
if( size.isEmpty() && sizerule != ( SetRule )Remember)
|
||||
sizerule = UnusedSetRule;
|
||||
READ_FORCE_RULE( minsize, Size, );
|
||||
READ_FORCE_RULE( minsize,, QSize());
|
||||
if( !minsize.isValid())
|
||||
minsize = QSize( 1, 1 );
|
||||
READ_FORCE_RULE( maxsize, Size, );
|
||||
READ_FORCE_RULE( maxsize, , QSize());
|
||||
if( maxsize.isEmpty())
|
||||
maxsize = QSize( 32767, 32767 );
|
||||
READ_FORCE_RULE( opacityactive, Num, );
|
||||
READ_FORCE_RULE( opacityactive, , 0);
|
||||
if( opacityactive < 0 || opacityactive > 100 )
|
||||
opacityactive = 100;
|
||||
READ_FORCE_RULE( opacityinactive, Num, );
|
||||
READ_FORCE_RULE( opacityinactive,, 0);
|
||||
if( opacityinactive < 0 || opacityinactive > 100 )
|
||||
opacityinactive = 100;
|
||||
READ_FORCE_RULE( ignoreposition, Bool, );
|
||||
READ_SET_RULE( desktop, Num, );
|
||||
READ_FORCE_RULE( ignoreposition,, false);
|
||||
READ_SET_RULE( desktop,,0 );
|
||||
type = readType( cfg, "type" );
|
||||
typerule = type != NET::Unknown ? readForceRule( cfg, "typerule" ) : UnusedForceRule;
|
||||
READ_SET_RULE( maximizevert, Bool, );
|
||||
READ_SET_RULE( maximizehoriz, Bool, );
|
||||
READ_SET_RULE( minimize, Bool, );
|
||||
READ_SET_RULE( shade, Bool, );
|
||||
READ_SET_RULE( skiptaskbar, Bool, );
|
||||
READ_SET_RULE( skippager, Bool, );
|
||||
READ_SET_RULE( above, Bool, );
|
||||
READ_SET_RULE( below, Bool, );
|
||||
READ_SET_RULE( fullscreen, Bool, );
|
||||
READ_SET_RULE( noborder, Bool, );
|
||||
READ_FORCE_RULE( fsplevel, Num, limit0to4 ); // fsp is 0-4
|
||||
READ_FORCE_RULE( acceptfocus, Bool, );
|
||||
READ_FORCE_RULE( moveresizemode, , Options::stringToMoveResizeMode );
|
||||
READ_FORCE_RULE( closeable, Bool, );
|
||||
READ_FORCE_RULE( strictgeometry, Bool, );
|
||||
READ_SET_RULE( shortcut, , );
|
||||
READ_FORCE_RULE( disableglobalshortcuts, Bool, );
|
||||
READ_SET_RULE( maximizevert,, false);
|
||||
READ_SET_RULE( maximizehoriz,, false);
|
||||
READ_SET_RULE( minimize,, false);
|
||||
READ_SET_RULE( shade,, false);
|
||||
READ_SET_RULE( skiptaskbar,, false);
|
||||
READ_SET_RULE( skippager,, false);
|
||||
READ_SET_RULE( above,, false);
|
||||
READ_SET_RULE( below,, false);
|
||||
READ_SET_RULE( fullscreen,, false);
|
||||
READ_SET_RULE( noborder,,false );
|
||||
READ_FORCE_RULE( fsplevel,limit0to4,0 ); // fsp is 0-4
|
||||
READ_FORCE_RULE( acceptfocus, , false);
|
||||
READ_FORCE_RULE( moveresizemode,Options::stringToMoveResizeMode, QString());
|
||||
READ_FORCE_RULE( closeable, , false);
|
||||
READ_FORCE_RULE( strictgeometry, , false);
|
||||
READ_SET_RULE( shortcut, ,QString() );
|
||||
READ_FORCE_RULE( disableglobalshortcuts, , false);
|
||||
}
|
||||
|
||||
#undef READ_MATCH_STRING
|
||||
#undef READ_SET_RULE
|
||||
#undef READ_SET_RULE_2
|
||||
#undef READ_FORCE_RULE
|
||||
#undef READ_FORCE_RULE_2
|
||||
#undef READ_FORCE_RULE2
|
||||
|
||||
#define WRITE_MATCH_STRING( var, cast, force ) \
|
||||
if( !var.isEmpty() || force ) \
|
||||
|
@ -295,7 +291,7 @@ bool Rules::isEmpty() const
|
|||
|
||||
Rules::SetRule Rules::readSetRule( KConfig& cfg, const QString& key )
|
||||
{
|
||||
int v = cfg.readNumEntry( key );
|
||||
int v = cfg.readEntry( key,0 );
|
||||
if( v >= DontAffect && v <= ForceTemporarily )
|
||||
return static_cast< SetRule >( v );
|
||||
return UnusedSetRule;
|
||||
|
@ -303,7 +299,7 @@ Rules::SetRule Rules::readSetRule( KConfig& cfg, const QString& key )
|
|||
|
||||
Rules::ForceRule Rules::readForceRule( KConfig& cfg, const QString& key )
|
||||
{
|
||||
int v = cfg.readNumEntry( key );
|
||||
int v = cfg.readEntry( key,0 );
|
||||
if( v == DontAffect || v == Force || v == ForceTemporarily )
|
||||
return static_cast< ForceRule >( v );
|
||||
return UnusedForceRule;
|
||||
|
@ -311,7 +307,7 @@ Rules::ForceRule Rules::readForceRule( KConfig& cfg, const QString& key )
|
|||
|
||||
NET::WindowType Rules::readType( KConfig& cfg, const QString& key )
|
||||
{
|
||||
int v = cfg.readNumEntry( key );
|
||||
int v = cfg.readEntry( key,0 );
|
||||
if( v >= NET::Normal && v <= NET::Splash )
|
||||
return static_cast< NET::WindowType >( v );
|
||||
return NET::Unknown;
|
||||
|
@ -960,7 +956,7 @@ void Workspace::loadWindowRules()
|
|||
}
|
||||
KConfig cfg( "kwinrulesrc", true );
|
||||
cfg.setGroup( "General" );
|
||||
int count = cfg.readNumEntry( "count" );
|
||||
int count = cfg.readEntry( "count",0 );
|
||||
for( int i = 1;
|
||||
i <= count;
|
||||
++i )
|
||||
|
|
16
sm.cpp
16
sm.cpp
|
@ -150,8 +150,8 @@ void Workspace::loadSessionInfo()
|
|||
session.clear();
|
||||
KConfig* config = kapp->sessionConfig();
|
||||
config->setGroup("Session" );
|
||||
int count = config->readNumEntry( "count" );
|
||||
int active_client = config->readNumEntry( "active" );
|
||||
int count = config->readEntry( "count",0 );
|
||||
int active_client = config->readEntry( "active",0 );
|
||||
for ( int i = 1; i <= count; i++ )
|
||||
{
|
||||
QString n = QString::number(i);
|
||||
|
@ -163,12 +163,12 @@ void Workspace::loadSessionInfo()
|
|||
info->wmClientMachine = config->readEntry( QString("wmClientMachine")+n, QString() ).latin1();
|
||||
info->resourceName = config->readEntry( QString("resourceName")+n, QString() ).latin1();
|
||||
info->resourceClass = config->readEntry( QString("resourceClass")+n, QString() ).lower().latin1();
|
||||
info->geometry = config->readRectEntry( QString("geometry")+n );
|
||||
info->restore = config->readRectEntry( QString("restore")+n );
|
||||
info->fsrestore = config->readRectEntry( QString("fsrestore")+n );
|
||||
info->maximized = config->readNumEntry( QString("maximize")+n, 0 );
|
||||
info->fullscreen = config->readNumEntry( QString("fullscreen")+n, 0 );
|
||||
info->desktop = config->readNumEntry( QString("desktop")+n, 0 );
|
||||
info->geometry = config->readEntry( QString("geometry")+n,QRect() );
|
||||
info->restore = config->readEntry( QString("restore")+n,QRect() );
|
||||
info->fsrestore = config->readEntry( QString("fsrestore")+n,QRect() );
|
||||
info->maximized = config->readEntry( QString("maximize")+n, 0 );
|
||||
info->fullscreen = config->readEntry( QString("fullscreen")+n, 0 );
|
||||
info->desktop = config->readEntry( QString("desktop")+n, 0 );
|
||||
info->minimized = config->readEntry( QString("iconified")+n, FALSE );
|
||||
info->onAllDesktops = config->readEntry( QString("sticky")+n, FALSE );
|
||||
info->shaded = config->readEntry( QString("shaded")+n, FALSE );
|
||||
|
|
|
@ -523,7 +523,7 @@ void TabBox::reconfigure()
|
|||
{
|
||||
KConfig * c(KGlobal::config());
|
||||
c->setGroup("TabBox");
|
||||
options_traverse_all = c->readNumEntry("TraverseAll", false );
|
||||
options_traverse_all = c->readEntry("TraverseAll", false );
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -548,7 +548,7 @@ void TabBox::delayedShow()
|
|||
{
|
||||
KConfig * c(KGlobal::config());
|
||||
c->setGroup("TabBox");
|
||||
bool delay = c->readNumEntry("ShowDelay", true);
|
||||
bool delay = c->readEntry("ShowDelay", true);
|
||||
|
||||
if (!delay)
|
||||
{
|
||||
|
@ -556,7 +556,7 @@ void TabBox::delayedShow()
|
|||
return;
|
||||
}
|
||||
|
||||
int delayTime = c->readNumEntry("DelayTime", 90);
|
||||
int delayTime = c->readEntry("DelayTime", 90);
|
||||
delayedShowTimer.start(delayTime, true);
|
||||
}
|
||||
|
||||
|
@ -928,7 +928,7 @@ void Workspace::CDEWalkThroughWindows( bool forward )
|
|||
bool options_traverse_all;
|
||||
{
|
||||
KConfigGroup group( KGlobal::config(), "TabBox" );
|
||||
options_traverse_all = group.readNumEntry("TraverseAll", false );
|
||||
options_traverse_all = group.readEntry("TraverseAll", false );
|
||||
}
|
||||
|
||||
Client* firstClient = 0;
|
||||
|
|
|
@ -316,7 +316,7 @@ void Workspace::init()
|
|||
else
|
||||
{
|
||||
KConfigGroup group( kapp->sessionConfig(), "Session" );
|
||||
initial_desktop = group.readNumEntry( "desktop", 1 );
|
||||
initial_desktop = group.readEntry( "desktop", 1 );
|
||||
}
|
||||
if( !setCurrentDesktop( initial_desktop ))
|
||||
setCurrentDesktop( 1 );
|
||||
|
@ -908,7 +908,7 @@ void Workspace::loadDesktopSettings()
|
|||
groupname.sprintf("Desktops-screen-%d", screen_number);
|
||||
KConfigGroup group(c,groupname);
|
||||
|
||||
int n = group.readNumEntry("Number", 4);
|
||||
int n = group.readEntry("Number", 4);
|
||||
number_of_desktops = n;
|
||||
delete workarea;
|
||||
workarea = new QRect[ n + 1 ];
|
||||
|
|
Loading…
Reference in a new issue