Opened 17 years ago

Closed 16 years ago

#4084 closed patch (fixed)

Mythtv uses QApplication::enter_loop which is obsolete

Reported by: candrews@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Mythtv uses QApplication::enter_loop which is obsolete. QT advises against its use, and documentation for it is very scarce. It would probably be best to use whatever the recommended way to achieve this functionality is rather than use this obsolete method.

Attachments (2)

mythdialogs-up-to-date-loop.patch (900 bytes) - added by candrews@… 17 years ago.
mythdialogs-up-to-date-loop.2.patch (1005 bytes) - added by candrews@… 17 years ago.
original patch was messed up - this one works!

Download all attachments as: .zip

Change History (10)

comment:1 Changed 17 years ago by danielk

Resolution: invalid
Status: newclosed

Patch missing...

comment:2 Changed 17 years ago by malban@…

from qt3.3 reference document:

"int QApplication::enter_loop () This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.

This function enters the main event loop (recursively). Do not call it unless you really know what you are doing.

Use QApplication::eventLoop()->enterLoop() instead."

comment:3 Changed 17 years ago by candrews@…

That why I don't think Myth should be using it. Furthermore, enter_loop causes polling, which is a power consumption problem if you look at powertop (see #3757). I don't know what to replace the enter_loop and exit_loop calls with... I can't figure out what they were obsoleted in favor of, nor am I a QT developer. I suppose I'll hit IRC and see if anyone can tell me what to do / how to fix this.

comment:4 Changed 17 years ago by danielk

Please do not use the bug reporting system for discussions, we have mailing lists for that.

Changed 17 years ago by candrews@…

comment:5 Changed 17 years ago by candrews@…

Resolution: invalid
Status: closedreopened

Attached a patch as requested

comment:6 Changed 17 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: reopenednew
Type: defectpatch
Version: unknownhead

Changed 17 years ago by candrews@…

original patch was messed up - this one works!

comment:7 Changed 16 years ago by anonymous

FYI - the patch does not affect the polling problem.

Currently around 72 timeouts per second (mythwelcome at idle), with and without the patch.

comment:8 Changed 16 years ago by danielk

Resolution: fixed
Status: newclosed

(In [14951]) Fixes #4084. Code tidy from candrews.

As of Qt 3.1 using the QApplication thunks for QEventLoop::enterLoop() and QEventLoop::exitLoop() is depreciated. Instead you get a pointer from QApplication to it's event loop, check that it isn't null, and then call enter and exit directly.

This does not offer any power saving enhancements or anything like that discussed in the ticket comments, but it should be one less thing to worry about for the Qt 4.x port.

Note: See TracTickets for help on using tickets.