title: android inotify_add_watch failed : permission denied?
body: <p>I'm using QtCreator and Qt for android.<br>
  I was trying to make a file dialog app on android,using QFileSystemModel.<br>
  And I'm debugging on my phone(HTC A9).</p>
  
  <p>I can't see any other content on my phone except my package(QDir::currentPath())
  but if I set to QDir::rootPath(), the file dialog shows nothing but / at beginning(nothing after I try to access it)</p>
  
  <p>The console shows :</p>
  
  <blockquote>
    <p>W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/data/user") failed: "Permission denied"<br>
    W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/data") failed: "Permission denied"<br>
    W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/") failed: "Permission denied"<br>
    W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/data") failed: "Permission denied"<br>
    W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/data/user") failed: "Permission denied"<br>
    W libFileDialog.so: (null):0 ((null)): inotify_add_watch("/data/user/0") failed: "Permission denied"  </p>
  </blockquote>
  
  <p>I added permissions </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/&gt;
  
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  </code></pre>
  
  <p>But it still says inotify_add_watch failed blahblah...<br>
  And it works totally fine on windows.
  And if I use virtual device to debug, it still denies sometimes but only denies permission when I try to set the root path of the model to some directory called (date, config... etc)<br>
  How should I fix that?<br>
  Or is it the problem about coding an android app with only C++ so it's telling me to go to learn JAVA?( I really want to stick to C++ :c )</p>
  
  <p>code:  </p>
  
  <pre><code>_fileModel = new QFileSystemModel;
  _fileModel-&gt;setReadOnly(false);
  _fileModel-&gt;setRootPath(QDir::rootPath());
  _fileModel-&gt;setFilter(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files);
  ui-&gt;listView-&gt;setModel(_fileModel);  
  </code></pre>
  
  <hr>
  
  <p>I just read that after I need to request permission while running.</p>
  
  <hr>
  
  <p>I called static java method to request permissions, and it's granted, but I still can't see the files.
  (only difference is that I can see /sdcard inside my virtual device.) </p>