https://bugs.kde.org/show_bug.cgi?id=371453

            Bug ID: 371453
           Summary: Deleted entries in config file are not correctly
                    removed on save
           Product: frameworks-kconfig
           Version: 5.27.0
          Platform: Archlinux Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: NOR
         Component: general
          Assignee: matt...@mjdsystems.ca
          Reporter: alex.bikado...@kdemail.net
                CC: kdelibs-b...@kde.org

My application is called "main_EXE", the config file is saved at
"~/.config/main_EXErc" and this is the content:
>>>
[Startup]
MenuBar=Enabled

<<<

The (complete) application code:
>>>
#include <QApplication>

#include <KConfigCore/KConfigGroup>
#include <KConfigCore/KSharedConfig>
#include <KXmlGui/KXmlGuiWindow>

class MainWindow : public KXmlGuiWindow {
  Q_OBJECT

public:
  MainWindow() : KXmlGuiWindow(0) {

    KSharedConfig::openConfig()->deleteGroup("Startup");
  }
};

int main(int argc, char *argv[]) {
  QApplication app(argc, argv);

  MainWindow *window = new MainWindow();
  window->show();

  return app.exec();
}

#include "main.moc"
<<<

After running the code, this is the new content of the config file:
>>>
[Startup]
MenuBar[$d]

<<<

* removing the entry directly ( deleteEntry("ActiveTab") ) does not work too
* a sync() call writes the incorrect config to the file
* it works correctly if the config path is specified with a custom path
* it works correctly if the group was not in the config file when the
application started (create+delete works)

And most important: When I search for "[$d]" in ~/.config/* , there are 10
config files with these invalid entries (ksmserverrc, oktetarc, khotkeyrc,
plasmashellrc, ...). This bug is slowly messing up the config files for all KDE
applications and can trigger further bugs.


Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to