<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>343735</bug_id>
          
          <creation_ts>2015-02-03 13:06:48 +0000</creation_ts>
          <short_desc>user-places.xbel regularly gets overridden (so custom places disappear)</short_desc>
          <delta_ts>2015-04-21 21:49:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>plasmashell</product>
          <component>general</component>
          <version>5.2.0</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>342685</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.0</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jiehong">email</reporter>
          <assigned_to name="David Edmundson">kde</assigned_to>
          <cc>AndyKluger</cc>
    
    <cc>bshah</cc>
    
    <cc>emmanuelpescosta099</cc>
    
    <cc>marco_silva85</cc>
    
    <cc>notmart</cc>
    
    <cc>simonandric5</cc>
    
    <cc>xplwowi</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1496797</commentid>
    <comment_count>0</comment_count>
    <who name="Jiehong">email</who>
    <bug_when>2015-02-03 13:06:48 +0000</bug_when>
    <thetext>$HOME/.local/share/user-places.xbel gets overridden once in a while, by an unknown process

Reproducible: Always

Steps to Reproduce:
1. open Dolphin or Konqueror, and add a local place;
2. verify that $HOME/.local/share/user-places.xbel contains the directory you just added, and close Dolphin;
3. wait a moment (can vary), and see that its contain has been overridden (and the place has disappeared from Dolphin.

Actual Results:  
The content of user-places.xbel always gets overiden with the following default content:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;                                                                                                                
&lt;!DOCTYPE xbel&gt;
&lt;xbel xmlns:mime=&quot;http://www.freedesktop.org/standards/shared-mime-info&quot; xmlns:kdepriv=&quot;http://www.kde.org/kdepriv&quot; xmlns:bookmark=&quot;http://www.freedesktop.org/standards/desktop-bookmarks&quot;/&gt;

Expected Results:  
user-places.xbel should not be overridden by any applications, unless a place is added/removed by the user.

In my last trial, it took 7 minutes for the file to be modified, and I was trying to know what happened at the time of modification of the file (permissions: -rw-r--r--) : 13:18:15 (local time).

$ journalctl -b --no-pager | grep -i &apos;13\:18\:15&apos;
Feb 03 13:18:15 laptop kwin_x11[658]: kwin_core: screens:  1 desktops:  2
Feb 03 13:18:15 laptop kwin_x11[658]: kwin_core: Done.
Feb 03 13:18:15 laptop kdeinit5[603]: Enabled: false
Feb 03 13:18:15 laptop kdeinit5[603]: Handler: 0
Feb 03 13:18:15 laptop kdeinit5[603]: Exclude: 0x0  Match?  false
Feb 03 13:18:15 laptop kdeinit5[603]: false
Feb 03 13:18:15 laptop kdeinit5[603]: Gesture ungrab
Feb 03 13:18:15 laptop kdeinit5[603]: Enabled: false
Feb 03 13:18:15 laptop kdeinit5[603]: Handler: 0
Feb 03 13:18:15 laptop kdeinit5[603]: Exclude: 0x0  Match?  false
Feb 03 13:18:15 laptop kdeinit5[603]: false
Feb 03 13:18:15 laptop kdeinit5[603]: Gesture ungrab</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1497586</commentid>
    <comment_count>1</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2015-02-06 10:50:46 +0000</bug_when>
    <thetext>are the applications such as Dolphin or konqueror KDE4 or KF5 based?

any idea who is actually writing user-places.xbel ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1497590</commentid>
    <comment_count>2</comment_count>
    <who name="Jiehong">email</who>
    <bug_when>2015-02-06 11:22:16 +0000</bug_when>
    <thetext>Dolphin
Version 14.11.97 (actually 14.12.1 according to the package)
Using KDE Development Platform 4.14.4

Konqueror
Version 4.14.4 (actually 14.12.1 according to the package)
Using KDE Development Platform 4.14.4

I wish I knew what application were modifying the file, but I only have the information of when that file were modified (with stat for example).

Logs don&apos;t contain `user-places`, and the activity around the time of modification is not very helpful.

`audit` is not activated in the Archlinux kernel, so monitoring the file&apos;s access and modifications require a custom kernel that I haven&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1498662</commentid>
    <comment_count>3</comment_count>
    <who name="Emmanuel Pescosta">emmanuelpescosta099</who>
    <bug_when>2015-02-08 13:11:04 +0000</bug_when>
    <thetext>Duplicate of bug 342685?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1498663</commentid>
    <comment_count>4</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2015-02-08 13:12:46 +0000</bug_when>
    <thetext>looks it, thanks.

*** This bug has been marked as a duplicate of bug 342685 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1498938</commentid>
    <comment_count>5</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2015-02-09 17:22:47 +0000</bug_when>
    <thetext>Git commit e7e0f2d8f06e4086a1872757d779e19a06537b2a by Marco Martin.
Committed on 09/02/2015 at 17:18.
Pushed by mart into branch &apos;master&apos;.

sync bookmarkmanager only if change was by process

This is an attempt to fix a bug that seems quite difficult to reproduce,
It seems there is a weird race condition linked to the sync of the two files
.local/share/user-places.xbel
.local/share/kfileplaces/bookmarks.xml
causing the bug
https://bugs.kde.org/show_bug.cgi?id=343735
all processes that are listening for changes in the bookmark manager will
try to sync their bookmarks with the shared ones (user-places.xbel)
and depending what process arrives first, some bookmarks may be lost

The same commit will happen on kdelibs4 as well
REVIEW:122459

M  +9    -0    src/filewidgets/kfileplacesmodel.cpp
M  +1    -6    src/filewidgets/kfileplacessharedbookmarks.cpp
M  +2    -1    src/filewidgets/kfileplacessharedbookmarks_p.h

http://commits.kde.org/kio/e7e0f2d8f06e4086a1872757d779e19a06537b2a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1498939</commentid>
    <comment_count>6</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2015-02-09 17:23:20 +0000</bug_when>
    <thetext>Git commit 2b5c6e42fc8114c6854ce490b9cdd4356be683d9 by Marco Martin.
Committed on 09/02/2015 at 17:22.
Pushed by mart into branch &apos;KDE/4.14&apos;.

sync bookmarkmanager only if change was by process

This is an attempt to fix a bug that seems quite difficult to reproduce,
It seems there is a weird race condition linked to the sync of the two files
.local/share/user-places.xbel
.local/share/kfileplaces/bookmarks.xml
causing the bug
https://bugs.kde.org/show_bug.cgi?id=343735
all processes that are listening for changes in the bookmark manager will
try to sync their bookmarks with the shared ones (user-places.xbel)
and depending what process arrives first, some bookmarks may be lost

The same commit will happen on kdelibs4 as well
REVIEW:122459

M  +9    -0    kfile/kfileplacesmodel.cpp
M  +1    -6    kfile/kfileplacessharedbookmarks.cpp
M  +2    -2    kfile/kfileplacessharedbookmarks_p.h

http://commits.kde.org/kdelibs/2b5c6e42fc8114c6854ce490b9cdd4356be683d9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1498941</commentid>
    <comment_count>7</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2015-02-09 17:25:19 +0000</bug_when>
    <thetext>Emmanuel: should the same commit happen on dolphin as well?
or even better: could Dolphin be made use kfileplacesmodel (expanded as necessary) as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1499353</commentid>
    <comment_count>8</comment_count>
    <who name="Emmanuel Pescosta">emmanuelpescosta099</who>
    <bug_when>2015-02-11 16:15:41 +0000</bug_when>
    <thetext>(In reply to Marco Martin from comment #7)
&gt; Emmanuel: should the same commit happen on dolphin as well?

Given that the Dolphin places model uses a lot of kfileplacesmodel code, I think we have to apply the same changes in Dolphin as well. But I&apos;ll check it and come up with a patch.

&gt; could Dolphin be made use kfileplacesmodel (expanded as necessary) as well?

kfileplacesmodel and Dolphin have different model interfaces (QModelIndex vs itemviews-ng), so it isn&apos;t a real drop-in replacement. But merging them in the long term is definitely something to keep in mind ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1505881</commentid>
    <comment_count>9</comment_count>
    <who name="Marco Silva">marco_silva85</who>
    <bug_when>2015-03-17 14:10:50 +0000</bug_when>
    <thetext>still happens as of today in archlinux current. Using KDE 4.
could it be related to usage of KDE Connect? (since it edits user-places to add a item for remote browsing the phone)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507111</commentid>
    <comment_count>10</comment_count>
    <who name="Emmanuel Pescosta">emmanuelpescosta099</who>
    <bug_when>2015-03-24 14:03:42 +0000</bug_when>
    <thetext>(In reply to Marco Silva from comment #9)
&gt; still happens as of today in archlinux current. Using KDE 4.
&gt; could it be related to usage of KDE Connect? (since it edits user-places to
&gt; add a item for remote browsing the phone)

Please have a look at https://bugs.kde.org/show_bug.cgi?id=345174</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>