D24087: Create an empty config (.e.g ~/.gtkrc-2.0) if none exists

Heiko Becker noreply at phabricator.kde.org
Thu Sep 19 16:22:59 BST 2019


heikobecker created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
heikobecker requested review of this revision.

REVISION SUMMARY
  After a9f3a3d <https://phabricator.kde.org/R99:a9f3a3ddcb0b197f96b750323201da438f15c4ad> saveSettingsPrivate() errors out if the config file
  doesn't exist. This is because QFile::open(QIODevice::ReadOnly... )
  doesn't create a new file for non-existant filenames, like the
  same invocation with the previously used QIODevice::WriteOnly does.
  
  I'm not sure how likely the absence of the config file is, but it's
  easy to recover from by creating an empty file first. We're trying
  to save our settings afterwards anyway.
  
  A place there this problem occurred is the configsave unit test. The
  filenames passed in ConfigSaveTest::testGtk2 don't exist when running
  the test, causing it to fail without this patch.

TEST PLAN
  - Moved ~/.gtkrc-2.0 out of the way, ran kcmshell5 kde-gtk-config, saving didn't error out
  
  -

REPOSITORY
  R99 KDE Gtk Configuration Tool

BRANCH
  Plasma/5.17

REVISION DETAIL
  https://phabricator.kde.org/D24087

AFFECTED FILES
  src/appearancegtk2.cpp

To: heikobecker
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190919/7830fdce/attachment.html>


More information about the Plasma-devel mailing list