diff --git a/autotests/test_virtual_desktops.cpp b/autotests/test_virtual_desktops.cpp index 61b2ab9c22..57b359628b 100644 --- a/autotests/test_virtual_desktops.cpp +++ b/autotests/test_virtual_desktops.cpp @@ -621,12 +621,9 @@ void TestVirtualDesktops::load() config->group("Desktops").writeEntry("Number", 4); vds->load(); QCOMPARE(vds->count(), (uint)4); - // setting the screen number should reset to one desktop as config value is missing - screen_number = 2; - vds->load(); - QCOMPARE(vds->count(), (uint)1); - // creating the respective group should properly load - config->group("Desktops-screen-2").writeEntry("Number", 5); + + // setting the config value and reloading should update + config->group("Desktops").writeEntry("Number", 5); vds->load(); QCOMPARE(vds->count(), (uint)5); } @@ -650,23 +647,6 @@ void TestVirtualDesktops::save() QCOMPARE(desktops.hasKey("Name_2"), false); QCOMPARE(desktops.hasKey("Name_3"), false); QCOMPARE(desktops.hasKey("Name_4"), false); - - // change screen number - screen_number = 3; - QCOMPARE(config->hasGroup("Desktops-screen-3"), false); - vds->setCount(3); - vds->save(); - QCOMPARE(config->hasGroup("Desktops-screen-3"), true); - // old one should be unchanged - desktops = config->group("Desktops"); - QCOMPARE(desktops.readEntry("Number", 1), 4); - desktops = config->group("Desktops-screen-3"); - QCOMPARE(desktops.readEntry("Number", 1), 3); - QCOMPARE(desktops.hasKey("Name_1"), false); - QCOMPARE(desktops.hasKey("Name_2"), false); - QCOMPARE(desktops.hasKey("Name_3"), false); - QCOMPARE(desktops.hasKey("Name_4"), false); - } QTEST_MAIN(TestVirtualDesktops) diff --git a/virtualdesktops.cpp b/virtualdesktops.cpp index 121c5f602d..a439460926 100644 --- a/virtualdesktops.cpp +++ b/virtualdesktops.cpp @@ -35,7 +35,6 @@ along with this program. If not, see . #include namespace KWin { -extern int screen_number; static bool s_loadingDesktopSettings = false; static QByteArray generateDesktopId() @@ -701,13 +700,8 @@ void VirtualDesktopManager::load() if (!m_config) { return; } - QString groupname; - if (screen_number == 0) { - groupname = QStringLiteral("Desktops"); - } else { - groupname = QStringLiteral("Desktops-screen-%1").arg(screen_number); - } - KConfigGroup group(m_config, groupname); + + KConfigGroup group(m_config, QStringLiteral("Desktops")); const int n = group.readEntry("Number", 1); setCount(n); @@ -744,13 +738,7 @@ void VirtualDesktopManager::save() if (!m_config) { return; } - QString groupname; - if (screen_number == 0) { - groupname = QStringLiteral("Desktops"); - } else { - groupname = QStringLiteral("Desktops-screen-%1").arg(screen_number); - } - KConfigGroup group(m_config, groupname); + KConfigGroup group(m_config, QStringLiteral("Desktops")); for (int i = count() + 1; group.hasKey(QStringLiteral("Id_%1").arg(i)); i++) { group.deleteEntry(QStringLiteral("Id_%1").arg(i));