kdePackages.kservice: handle sycoca disappearing better

This is not a complete fix, the whole thing is still full of races,
but at least this gets it to explode a lot less often.

K900 3f2aac32 ad3a164c

+17 -1
+3 -1
pkgs/kde/frameworks/kservice/default.nix
··· 2 mkKdeDerivation { 3 pname = "kservice"; 4 5 patches = [ 6 # follow symlinks when generating sycoca 7 - # FIXME(later): upstream 8 ./qdiriterator-follow-symlinks.patch 9 ]; 10 meta.mainProgram = "kbuildsycoca6"; 11 }
··· 2 mkKdeDerivation { 3 pname = "kservice"; 4 5 + # FIXME(later): upstream 6 patches = [ 7 # follow symlinks when generating sycoca 8 ./qdiriterator-follow-symlinks.patch 9 + # explode less when sycoca is deleted 10 + ./handle-sycoca-deletion.patch 11 ]; 12 meta.mainProgram = "kbuildsycoca6"; 13 }
+14
pkgs/kde/frameworks/kservice/handle-sycoca-deletion.patch
···
··· 1 + diff --git a/src/sycoca/ksycoca.cpp b/src/sycoca/ksycoca.cpp 2 + index 981342e6..5940f65f 100644 3 + --- a/src/sycoca/ksycoca.cpp 4 + +++ b/src/sycoca/ksycoca.cpp 5 + @@ -218,6 +218,10 @@ KSycoca::KSycoca() 6 + connect(d->m_fileWatcher.get(), &KDirWatch::dirty, this, [this]() { 7 + d->slotDatabaseChanged(); 8 + }); 9 + + // NIXPKGS: we sometimes delete sycoca externally 10 + + connect(d->m_fileWatcher.get(), &KDirWatch::deleted, this, [this]() { 11 + + d->slotDatabaseChanged(); 12 + + }); 13 + } 14 + }