[Development] QInotifyFileSystemWatcherEngine might have incomplete data?

2013-11-17 Thread Mark Gaiser
Hi,

I'm trying to make my first little steps in making a Qt patch to implement a:

signal created(const QString path)

because that would allow you to know which files get created in a
folder that is being watched. KDirWatch has that feature,
QFileSystemWatcher doesn't.

However, when trying to implement that feature i was faced with an
empty inotify_event,name.

According to the inotify docs [1]. Specifically:
-- QUOTE --
The name field is only present when an event is returned for a file
inside a watched directory; it identifies the file pathname relative
to the watched directory. This pathname is null-terminated, and may
include further null bytes to align subsequent reads to a suitable
address boundary.
-- END QUOTE --

I'm not quite sure of this is a bug, something intentional or
something i'm doing wrong. The steps to reproduce this are as follows:

1. Create a simple that watches a folder:
#include QCoreApplication
#include QFileSystemWatcher

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

QFileSystemWatcher* watcher = new QFileSystemWatcher(a);
watcher-addPath(/path/to/folder/);

return a.exec();
}

2. Set a breakpoint within the
QInotifyFileSystemWatcherEngine::readFromInotify() function after the
point where you have an event object.

3. Create a new file in the folder you're monitoring.
4. GDB (or whatever you used) should hit the bearkpoint. Now inspace
the event members (name specifically). It's empty while it shouldn't
be.

Just to be sure that inotify works, i tested the same by typing the command:
inotifywait -m -e create /path/to/folder/
Creating a new file then gives me a new line like:
/path/to/folder/ CREATE newFileName

Which leads me to think that inotify itself is working just fine.

I hope someone could take a look at this and see if i'm wrong or if
this is a bug somewhere?

CCing the people that changed the readFromInotify function.

Cheers,
Mark

[1] http://linux.die.net/man/7/inotify
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QInotifyFileSystemWatcherEngine might have incomplete data?

2013-11-17 Thread Olivier Goffart
On Sunday 17 November 2013 19:07:48 Mark Gaiser wrote:

 4. GDB (or whatever you used) should hit the bearkpoint. Now inspace
 the event members (name specifically). It's empty while it shouldn't
 be.

Hi,
I'd add a qDebug()  to be sure.
Maybe it's just GDB giving wronf information.  Perhaps the data as been 
optimized.  Perhaps gdb think the name has lengh 0 because it is declared as a 
char[].  

--
Olivier

Woboq - Qt services and support - http://woboq.com


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QInotifyFileSystemWatcherEngine might have incomplete data?

2013-11-17 Thread Mark Gaiser
On Sun, Nov 17, 2013 at 8:03 PM, Olivier Goffart oliv...@woboq.com wrote:
 On Sunday 17 November 2013 19:07:48 Mark Gaiser wrote:

 4. GDB (or whatever you used) should hit the bearkpoint. Now inspace
 the event members (name specifically). It's empty while it shouldn't
 be.

 Hi,
 I'd add a qDebug()  to be sure.
 Maybe it's just GDB giving wronf information.  Perhaps the data as been
 optimized.  Perhaps gdb think the name has lengh 0 because it is declared as a
 char[].

Hi Oliver,

I tried your suggestion and that indeed works though not as i would expect it.
Yes, it does get printed on screen when i put event.name in a qDebug line.

However, none of the emit signals in that function (readFromInotify)
work anymore when i use event.name there. Anywhere! I just tried
that out since you've had send the reply.
You can find the diff of the stuff that's i've done thus far. Just
adding this to your code breaks all the emits and i have no clue as to
why that happens or how it's even possible.

If you have any clue.. please do tell.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QInotifyFileSystemWatcherEngine might have incomplete data?

2013-11-17 Thread Mark Gaiser
On Sun, Nov 17, 2013 at 9:20 PM, Mark Gaiser mark...@gmail.com wrote:
 On Sun, Nov 17, 2013 at 8:03 PM, Olivier Goffart oliv...@woboq.com wrote:
 On Sunday 17 November 2013 19:07:48 Mark Gaiser wrote:

 4. GDB (or whatever you used) should hit the bearkpoint. Now inspace
 the event members (name specifically). It's empty while it shouldn't
 be.

 Hi,
 I'd add a qDebug()  to be sure.
 Maybe it's just GDB giving wronf information.  Perhaps the data as been
 optimized.  Perhaps gdb think the name has lengh 0 because it is declared as 
 a
 char[].

 Hi Oliver,

 I tried your suggestion and that indeed works though not as i would expect it.
 Yes, it does get printed on screen when i put event.name in a qDebug line.

 However, none of the emit signals in that function (readFromInotify)
 work anymore when i use event.name there. Anywhere! I just tried
 that out since you've had send the reply.
 You can find the diff of the stuff that's i've done thus far. Just
 adding this to your code breaks all the emits and i have no clue as to
 why that happens or how it's even possible.

 If you have any clue.. please do tell.

Sorry, forgot the diff: http://pastebin.kde.org/pzqb2jph6
Lifetime of 30 days.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] StereoViewport for Qt3D

2013-11-17 Thread Svenn-Arne Dragly
On Wed 06 Nov 2013 12:54:07 PM CET, Rutledge Shawn wrote:

 On 28 Oct 2013, at 10:35 PM, Svenn-Arne Dragly wrote:

 Secondly, I was missing a stereo option for the default QML Viewport
 element, and decided to have a look at the implementation in QGLView to
 see if I could port that to the QML Viewport element. Luckily this was
 quite easy (thanks to Qt3D being well designed) and I have uploaded the
 resulting StereoViewport element to a GitHub repository:

 https://github.com/dragly/stereoviewport

 This should compile with Qt5.1.1 and the latest master branch of Qt3D.


 Cool. Are you using it with an Oculus Rift, 3D TV or something else?

Both and Oculus Rift and a 3D TV, actually. I have tested the stereo
mode where the viewport is split in two thoroughly, with one half of the
screen for the left eye and the other for the right. It works quite well
and seems to be stable.



 Now, I'm wondering if this feature should be a part of the original
 Viewport element. Should I contribute this into the main Qt3D
 repository? If so, what steps should I take before doing this, apart
 from those listed in the Qt Contributing Guidelines? I'm for instance
 not sure if I might have introduced some bugs or damaged any features of
 the original Viewport element. How should I verify that I haven't
 done so?


 I don't know much about that but I'm sure you will get a reply from
 someone who does. But it sounds like a good feature to have.

I hope so too, but if I don't hear anything I'll just try pushing it to
gerrit and see how it goes.


Svenn-Arne

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development