@ -1783,12 +1783,18 @@ void TestXdgShellClientRules::testMaximizeForceTemporarily()
void TestXdgShellClientRules : : testDesktopDontAffect ( )
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Initialize RuleBook with the test rule.
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktoprule " , int ( Rules : : DontAffect ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : DontAffect ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -1796,12 +1802,6 @@ void TestXdgShellClientRules::testDesktopDontAffect()
RuleBook : : self ( ) - > setConfig ( config ) ;
workspace ( ) - > slotReconfigure ( ) ;
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Create the test client.
AbstractClient * client ;
Surface * surface ;
@ -1821,12 +1821,18 @@ void TestXdgShellClientRules::testDesktopDontAffect()
void TestXdgShellClientRules : : testDesktopApply ( )
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Initialize RuleBook with the test rule.
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktoprule " , int ( Rules : : Apply ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : Apply ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -1834,12 +1840,6 @@ void TestXdgShellClientRules::testDesktopApply()
RuleBook : : self ( ) - > setConfig ( config ) ;
workspace ( ) - > slotReconfigure ( ) ;
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Create the test client.
AbstractClient * client ;
Surface * surface ;
@ -1875,12 +1875,18 @@ void TestXdgShellClientRules::testDesktopApply()
void TestXdgShellClientRules : : testDesktopRemember ( )
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Initialize RuleBook with the test rule.
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktoprule " , int ( Rules : : Remember ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : Remember ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -1888,12 +1894,6 @@ void TestXdgShellClientRules::testDesktopRemember()
RuleBook : : self ( ) - > setConfig ( config ) ;
workspace ( ) - > slotReconfigure ( ) ;
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Create the test client.
AbstractClient * client ;
Surface * surface ;
@ -1925,12 +1925,18 @@ void TestXdgShellClientRules::testDesktopRemember()
void TestXdgShellClientRules : : testDesktopForce ( )
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Initialize RuleBook with the test rule.
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktoprule " , int ( Rules : : Force ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : Force ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -1938,11 +1944,6 @@ void TestXdgShellClientRules::testDesktopForce()
RuleBook : : self ( ) - > setConfig ( config ) ;
workspace ( ) - > slotReconfigure ( ) ;
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Create the test client.
AbstractClient * client ;
@ -1998,8 +1999,8 @@ void TestXdgShellClientRules::testDesktopApplyNow()
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktop rule" , int ( Rules : : ApplyNow ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : ApplyNow ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -2029,12 +2030,18 @@ void TestXdgShellClientRules::testDesktopApplyNow()
void TestXdgShellClientRules : : testDesktopForceTemporarily ( )
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Initialize RuleBook with the test rule.
auto config = KSharedConfig : : openConfig ( QString ( ) , KConfig : : SimpleConfig ) ;
config - > group ( " General " ) . writeEntry ( " count " , 1 ) ;
KConfigGroup group = config - > group ( " 1 " ) ;
group . writeEntry ( " desktop " , 2 ) ;
group . writeEntry ( " desktoprule " , int ( Rules : : ForceTemporarily ) ) ;
group . writeEntry ( " desktop s " , { VirtualDesktopManager : : self ( ) - > desktopForX11Id ( 2 ) - > id ( ) } ) ;
group . writeEntry ( " desktop s rule" , int ( Rules : : ForceTemporarily ) ) ;
group . writeEntry ( " wmclass " , " org.kde.foo " ) ;
group . writeEntry ( " wmclasscomplete " , false ) ;
group . writeEntry ( " wmclassmatch " , int ( Rules : : ExactMatch ) ) ;
@ -2042,12 +2049,6 @@ void TestXdgShellClientRules::testDesktopForceTemporarily()
RuleBook : : self ( ) - > setConfig ( config ) ;
workspace ( ) - > slotReconfigure ( ) ;
// We need at least two virtual desktop for this test.
VirtualDesktopManager : : self ( ) - > setCount ( 2 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > count ( ) , 2u ) ;
VirtualDesktopManager : : self ( ) - > setCurrent ( 1 ) ;
QCOMPARE ( VirtualDesktopManager : : self ( ) - > current ( ) , 1 ) ;
// Create the test client.
AbstractClient * client ;
Surface * surface ;