Summary: | KTzfileTimeZoneSource and KTimeZoneBackend are too noisy when running Dolphin | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Frank Reininghaus <frank78ac> |
Component: | kdecore | Assignee: | David Jarvie <djarvie> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | djarvie, frank78ac |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Patch for ktimezonestest_p.h which fixes most of the problem.
New patch, which should also work if KDEHOME is not set |
Description
Frank Reininghaus
2012-03-05 20:52:16 UTC
What are the contents of your ktimezonedrc file, in the KDE config directory in your home directory? I'm pasting the contents below. If you need any further info, please let me know. [TimeZones] LocalZone=Europe/Paris ZoneinfoDir=/home/kde-devel/.kde-unit-test/ktimezonestest Zonetab=/home/kde-devel/.kde-unit-test/ktimezonestest/zone.tab ZonetabCache= It looks as if the ktimezonestest unit test may have been run and then cancelled before it completed. The contents of ktimezonedrc are those set up by ktimezonestest, but normally the test cleans up after each test step. Try deleting ktimezonedrc - this may well make things run normally again. Thanks for the hint, but deleting ktimezonedrc only solved the problem partially and temporarily: 1. The "-> No chache" messages still appeared after the deletion. 2. After the next run of "make test" in kdelibs, which terminated correctly, the situation was as before. I've had a quick look at the ktimezonestest sources and could not see any code that cleans up the config, but I might have missed something. The config set up by ktimezonestest is cleaned up by calling cleanupTimeZoneTest() in ktimezonestest_p.h, which is called from KTimeZonesTest::cleanupTestCase(), which in turn is called automatically by the test framework at the end of each test step. I don't think this is the problem in your case, however. The way that the test framework is supposed to work is that it sets the KDE home to ~/.kde-unit-test, so that your normal KDE home directory is left untouched. So it's strange that your ~/.kde/share/config/ktimezonedrc is being changed by the tests. I don't think the problem is due to a bug in ktimezonestest (it works ok for me), but rather to some problem with the test framework on your system. Thanks for the information. I had actually never noticed that unit tests are supposed to use a different KDEHOME - maybe because it doesn't work for me. (In reply to comment #5) > The config set up by ktimezonestest is cleaned up by calling > cleanupTimeZoneTest() in ktimezonestest_p.h, which is called from > KTimeZonesTest::cleanupTestCase(), which in turn is called automatically by > the test framework at the end of each test step. I actually saw that function, but couldn't see how cleaning up the .kde-unit-test dir can fix my config which is stored somewhere else. But I see now that this is due to the test framework not taking care of the KDEHOME properly on my system. I'll try to find out why that is the case. Created attachment 69556 [details]
Patch for ktimezonestest_p.h which fixes most of the problem.
Now I know why "make test" changes the ktimezonedrc in my normal $KDEHOME (i.e., not in ~/.kde-unit-test). It does not happen when running ktimezonestest, but in kdeui/tests/ktimezonewidget_unittest.
That test uses the same private header file to modify the config, but it does not set KDEHOME to .kde-unit-test (which is intentional, according to the comments in the test source). On the other hand, cleanupTimeZoneTest() in ktimezonestest_p.h uses a hardcoded path (QDir::homePath() + "/.kde-unit-test/share") when it tries to clean up the config modified by the test.
I propose to determine the path of the config file dynamically by reading the contents of $KDEHOME when cleaning up, see attached patch.
Even with that patch, the "-> No cache" messages still remain. The only easy way to get rid of them is probably to remove them altogether, but if these messages are useful to you, I think I can probably live with them - they are far less disturbing than the error messages that my patch gets rid of :-)
Looking at the code again, one could probably also remove the line removeDir(QLatin1String("share/config")); in TimeZoneTestData::cleanupTimeZoneTest(). I don't think your patch will work on many systems, because the environment variable KDEHOME is an optional variable these days - it can be set to override the default ~/.kde, but otherwise doesn't have to exist. Created attachment 69689 [details]
New patch, which should also work if KDEHOME is not set
You're right, of course. My new proposed patch should work even if KDEHOME is not set.
Your patch seems to work, so go ahead and commit it. Git commit 0c7ce8d96886efdf6b2bc0ac71c4a87821ea5fd0 by Frank Reininghaus. Committed on 22/03/2012 at 06:45. Pushed by freininghaus into branch 'KDE/4.8'. Clean up ktimezonedrc properly after each unit test ktimezonestest_p.h already did try to clean up the config after testing, but the folder to be removed was hardcoded (~/.kde-unit-test/share). This does work for ktimezonestest, but not for ktimezonewidget_unittest. That test uses the same private header, but does not change KDEHOME to ~/.kde-unit-test, such that the user's normal config was modified by the test, and the changes persisted even after the test. This then caused applications like, e.g., Dolphin to output lots of unwanted error messages at runtime. This commit changes that by determining the full path of ktimezonedrc at runtime and deleting that file. M +2 -2 kdecore/tests/ktimezonestest_p.h http://commits.kde.org/kdelibs/0c7ce8d96886efdf6b2bc0ac71c4a87821ea5fd0 Git commit e8a152d78eb32f1a8fc12041f7405934307c7249 by Ivan Čukić, on behalf of Frank Reininghaus. Committed on 22/03/2012 at 06:45. Pushed by ivan into branch 'ivan/solid-fuse-access'. Clean up ktimezonedrc properly after each unit test ktimezonestest_p.h already did try to clean up the config after testing, but the folder to be removed was hardcoded (~/.kde-unit-test/share). This does work for ktimezonestest, but not for ktimezonewidget_unittest. That test uses the same private header, but does not change KDEHOME to ~/.kde-unit-test, such that the user's normal config was modified by the test, and the changes persisted even after the test. This then caused applications like, e.g., Dolphin to output lots of unwanted error messages at runtime. This commit changes that by determining the full path of ktimezonedrc at runtime and deleting that file. M +2 -2 kdecore/tests/ktimezonestest_p.h http://commits.kde.org/kdelibs/e8a152d78eb32f1a8fc12041f7405934307c7249 |