Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5596 closed task (fixed)

port libmyth to Qt4

Reported by: danielk Owned by: danielk
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description


Attachments (17)

5596-v1.patch.bz2 (57.6 KB) - added by danielk 11 years ago.
Preliminary patch
5596-v2.patch.bz2 (57.2 KB) - added by danielk 11 years ago.
Updated to current svn
5596-v3.patch.bz2 (59.4 KB) - added by danielk 11 years ago.
Adds a couple Qt3 UI classes to mythmusic to allow plugin to compile with qt4 libmyth.
5596-v5.patch.bz2 (61.2 KB) - added by danielk 11 years ago.
Implements most of the TODO's in the patch
5596-v6.patch.bz2 (61.9 KB) - added by danielk 11 years ago.
5596-v7.patch.bz2 (58.6 KB) - added by danielk 11 years ago.
no improvements, just updated to the latest svn
5596-v9.patch.bz2 (56.7 KB) - added by danielk 11 years ago.
Updated patch, this one should compile with Qt 4.3.
5596-v10.patch.bz2 (49.2 KB) - added by Nigel 11 years ago.
v9 less Nigel's recent commits
5596-v11.patch.bz2 (49.3 KB) - added by Nigel 11 years ago.
v10 plus a few omissions
5596-v12.patch.bz2 (50.6 KB) - added by Nigel 11 years ago.
5596-v13.patch (248.8 KB) - added by Nigel 11 years ago.
Patch against r18518
5596-v13b.patch (248.8 KB) - added by danielk 11 years ago.
just updated patch to latest svn
5596-v14.patch (154.9 KB) - added by danielk 11 years ago.
updated patch
5596-v15.patch (106.6 KB) - added by danielk 11 years ago.
updated patch
5596-v17.patch (81.4 KB) - added by danielk 11 years ago.
Updated patch
5596-v19.patch (18.4 KB) - added by danielk 11 years ago.
Updated patch
5596-v20.patch (15.1 KB) - added by danielk 11 years ago.
what remains -- rich text widget removal

Download all attachments as: .zip

Change History (75)

Changed 11 years ago by danielk

Attachment: 5596-v1.patch.bz2 added

Preliminary patch

comment:1 Changed 11 years ago by danielk

The patch currently breaks a lot of things, and there are a lot of TODO's in the code, but it compiles :)

comment:2 Changed 11 years ago by Nigel

(In [18164]) A few trivial QString fixes found by Daniel. See #5596

Changed 11 years ago by danielk

Attachment: 5596-v2.patch.bz2 added

Updated to current svn

Changed 11 years ago by danielk

Attachment: 5596-v3.patch.bz2 added

Adds a couple Qt3 UI classes to mythmusic to allow plugin to compile with qt4 libmyth.

Changed 11 years ago by danielk

Attachment: 5596-v5.patch.bz2 added

Implements most of the TODO's in the patch

Changed 11 years ago by danielk

Attachment: 5596-v6.patch.bz2 added

comment:3 Changed 11 years ago by danielk

Note: As of the last patch all the code segments marked TODO in the earlier patch have been implemented. There are still problems remaining, mostly having to do with signal/slots having been renamed in Qt4.

comment:4 Changed 11 years ago by Nigel

Had lots of errors like:

diseqcsettings.cpp:950: error: no matching function for call to 'MythListBox::setCurrentRow(int, QItemSelectionModel::SelectionFlag)'
/Volumes/MythBuild/.osx-packager/build/include/QtGui/qlistwidget.h:229: note: candidates are: void QListWidget::setCurrentRow(int)

Instead of changing all the code's setSelected(), am wondering if it might be easier to have a wrapper method MythListBox::setSelected(const int i, const bool flag) { setCurrentRow(i); (void)flag; };

Changed 11 years ago by danielk

Attachment: 5596-v7.patch.bz2 added

no improvements, just updated to the latest svn

comment:5 Changed 11 years ago by danielk

Nigel, that's my fault. I used a Qt 4.4 function, in Qt 4.0 through 4.3 there is no selection model parameter. I'll fix this in the next round.

comment:6 Changed 11 years ago by danielk

(In [18259]) Refs #5596. Changes cerr redirects to VERBOSE macros in xmlparse. A number of these were using the unsafe QString->cstring conversions disabled when you turn off Qt3 compatibility mode.

Changed 11 years ago by danielk

Attachment: 5596-v9.patch.bz2 added

Updated patch, this one should compile with Qt 4.3.

comment:7 Changed 11 years ago by Nigel

For some reason:

patching file mythtv/libs/libmyth/mediamonitor-unix.cpp
Hunk #3 FAILED at 160.

Still testing, but this really is mammoth. I might start applying the little parts that I have tested, if that's OK?

comment:8 Changed 11 years ago by danielk

Nigel, more than ok. :)

I'm super busy with work for the next few weeks, but the smaller this patch gets the easier it will be to apply. The media monitor code contains some fixes too which I was planning to factor out anyway (I wasn't able to test the media monitor changes until I got the existing media monitor code to work on my machine first...)

There is also a known bug with the exit from mythtv dialog (when configured to prompt on exit), other dialogs I tested appeared to work, but this is probably a generic failure of some sort. My first suspicion with these is that some Qt slot has been renamed, but I didn't notice any complaints about that when entering mythtv and trying to exit immediately, so this may be something like a changed Dialog result code, or something else entirely. I haven't had a chance to look at it myself other than to note the problem.

comment:9 Changed 11 years ago by Nigel

(In [18300]) Qt4 port the first two methods. Loosely based on Daniel's patch. See #5596

comment:10 Changed 11 years ago by mythdev@…

The last patch does not compile, because in the header it says:

 static const QString           kUDEV_FIFO;

And the cpp says:

  const char * MediaMonitorUnix::kUDEV_FIFO = "/tmp/mythtv_media";

So the patch would be:

Index: libs/libmyth/mediamonitor-unix.h
===================================================================
--- libs/libmyth/mediamonitor-unix.h    (revision 18300)
+++ libs/libmyth/mediamonitor-unix.h    (working copy)
@@ -23,7 +23,7 @@

   protected:
     int                          m_fifo;
-    static const QString         kUDEV_FIFO;
+    static const char *          kUDEV_FIFO;
 };

 #endif // MYTH_MEDIA_MONITOR_H

comment:11 Changed 11 years ago by Nigel

(In [18301]) Build error located/patched by mythdev at telfort dot nl. Refs #5596.

comment:12 Changed 11 years ago by Nigel

(In [18317]) A few more of Daniel's Qt3->Qt4 fixes (see #5596), tidy a few VERBOSE messages. Note that GetCDROMBlockDevices() seems to be broken for me - stream.atEnd() seems to always think the /proc/sys/dev/cdrom/info file is empty?

comment:13 Changed 11 years ago by Nigel

(In [18319]) The last of Daniel's Qt3->Qt4 in this file. See #5596. I am unable to test the CheckDeviceNotifications??() changes, because my udev setup only sends "mount/umount" notifications, not "add/remove" ones. The code is nearly identical to that in CheckMountable??(), so it should be good. (hint, someone could create a CheckRemovable??)

comment:14 Changed 11 years ago by Nigel

(In [18323]) A few more of Daniel's Qt4 fixes that I have tested. See #5596

comment:15 Changed 11 years ago by Nigel

(In [18324]) More of Daniel's Qt4 fixes. See #5596. Note that killAudioLock is in the base class, so it doesn't seem to need initialising in the ALSA derived sub-class.

comment:16 Changed 11 years ago by Nigel

(In [18325]) Pointless char*->QString->char* conversion, which is dangerous in Qt4. Looks like it has been that way since the original MMon patch [2696]. Much easier to change these instances, and pass char* around, than change all the method signatures, like in Daniel's patch. See #5596

comment:17 Changed 11 years ago by Nigel

(In [18326]) Qt4 QMutex initialiser. See #5596

comment:18 Changed 11 years ago by Nigel

(In [18327]) Fix QString -> char * conversions which are unsafe under Qt4. See #5596

comment:19 Changed 11 years ago by Nigel

(In [18328]) A few more Qt3isms gone. See #5596. I hadn't realised that QObject::tr(QString) is now unsafe. Its one of the few Qt methods that uses a char * instead of a QString. TrollTech? should provide a QString one?

comment:20 Changed 11 years ago by Nigel

(In [18329]) Until we fully remove qt3 support, add a define. See #5596

comment:21 Changed 11 years ago by Nigel

(In [18330]) Some plugins still need Q3UrlOperator. See #5596

comment:22 Changed 11 years ago by Nigel

(In [18331]) Add a header for Qt4 porting. See #5596

comment:23 Changed 11 years ago by Nigel

(In [18332]) Add a header for Qt4 porting. See #5596

comment:24 Changed 11 years ago by Nigel

(In [18333]) One too many changes in [18328]. See #5596

comment:25 Changed 11 years ago by Nigel

(In [18334]) Qt4 safe strings, deprecate Qt3 compat QGridLayout methods. See #5596. That is nearly the end of the easy stuff! Time to update the patch

Changed 11 years ago by Nigel

Attachment: 5596-v10.patch.bz2 added

v9 less Nigel's recent commits

comment:26 Changed 11 years ago by Nigel

(In [18339]) Harmless header addition. (I missed this in [18331]). Refs #5596

Changed 11 years ago by Nigel

Attachment: 5596-v11.patch.bz2 added

v10 plus a few omissions

comment:27 Changed 11 years ago by Nigel

(In [18390]) Remove Qt3-isms. Slightly simpler version of Daniel's patch. See #5596. (I changed the MythListBox? to a QListWidget for now)

comment:28 Changed 11 years ago by Nigel

(In [18391]) Another Qt4 QString safety thing. See #5596

comment:29 Changed 11 years ago by Nigel

(In [18432]) Rationalise mythcontext.h usage, unwrap long lines, cerr -> VERBOSE. Inspired by Daniel's Qt4 patch. See #5596.

Changed 11 years ago by Nigel

Attachment: 5596-v12.patch.bz2 added

comment:30 Changed 11 years ago by Nigel

v12 patch has some of the MythThemedDialog? subclasses that were missed (in the plugins). Looking at all those method signature changes, I think we should just stay with the char*, and do this in mythwidgets.cpp and mythdialogs.cpp.

    if (name)
        setObjectName(QString(name));

if necessary.
I'm hoping to have some time to change settings.cpp to use the new MythUI, but we'll see?

comment:31 Changed 11 years ago by Nigel

(In [18473]) Header tidyup, Q3Frame -> QFrame, add some object names. See #5596. Also changes all VERBOSE -> cerr

comment:32 Changed 11 years ago by Nigel

(In [18474]) Cut/paste/typo in 18473. See #5596

comment:33 Changed 11 years ago by Nigel

(In [18475]) The other part of [18473] - one Q3VBox... to QBox... - see #5596

comment:34 Changed 11 years ago by Nigel

(In [18478]) Lastly (fow a few hours), const-ify a few QString parameters. See #5596. Use consistent QString null initializers (I prefer = QString() - its shortest).

comment:35 Changed 11 years ago by Nigel

(In [18483]) Pass const QString refs to MythThemedDialog?, default object name. See #5596

comment:36 Changed 11 years ago by Nigel

(In [18516]) Default widget object names, lots of whitespace changes to reduce size of future patching. See #5596

comment:37 Changed 11 years ago by Nigel

(In [18517]) Default widget object names, tidy Qt header names, some Qt3 compat removal. See #5596

Changed 11 years ago by Nigel

Attachment: 5596-v13.patch added

Patch against r18518

Changed 11 years ago by danielk

Attachment: 5596-v13b.patch added

just updated patch to latest svn

comment:38 Changed 11 years ago by danielk

(In [18571]) Refs #5596. Use Qt4 QRegExp::indexIn() instead of Qt3 only QRegExp::search()

comment:39 Changed 11 years ago by danielk

(In [18585]) Refs #5596. Converts Qt3 only container classes in libmyth to Qt4 compatible containers. This changes the binary revision and so requires relinking the plugins.

Changed 11 years ago by danielk

Attachment: 5596-v14.patch added

updated patch

comment:40 Changed 11 years ago by danielk

(In [18589]) Refs #5596. Port MythListBox? to Qt4.

Note: MythMusic was the only user of MythListView? and also used some funky aspects of MythListBox?, so it now has it's own copies of these two Qt3 classes and MythListView? is gone from libmyth. I didn't try to port mythmusic to Qt4 since I understand there is already an effort to port it to MythUI.

Changed 11 years ago by danielk

Attachment: 5596-v15.patch added

updated patch

comment:41 Changed 11 years ago by danielk

(In [18595]) Refs #5596. Revert [18589]. This caused some serious layout problems in mythtv-setup, I think we need to commit the Qt3->Qt4 layout class conversion before committing this..

comment:42 Changed 11 years ago by danielk

(In [18598]) Refs #5596. This applies a number of smaller Qt4 fixes to libmyth. Mostly methods that have been renamed or otherwise changed slightly since Qt3. Note: requires plugin relinking.

comment:43 Changed 11 years ago by danielk

(In [18602]) Refs #5596. Reapply [18589]. The problem turned out to be an error in one line of code in the patch where an 'H' was used instead of a 'V'. This completely fubarred a number of layouts.

Note this does require relinking the plugins.. as will another patch later today.

comment:44 Changed 11 years ago by danielk

(In [18603]) Refs #5596. Rest of [18602], committed from wrong directory.

Changed 11 years ago by danielk

Attachment: 5596-v17.patch added

Updated patch

comment:45 Changed 11 years ago by danielk

(In [18605]) Refs #5596. Use Qt4 layout managers instead of Qt3 versions in libmyth. Note this does require relinking the plugins.

comment:46 Changed 11 years ago by danielk

(In [18607]) Refs #5596. Switch from Q3EditText to QEditText. Requires relinking plugins.

comment:47 Changed 11 years ago by danielk

Note: #5792 should be applied before closing this ticket, in addition to other changes, It changes some Qt3 compat calls to Qt4 calls.

Changed 11 years ago by danielk

Attachment: 5596-v19.patch added

Updated patch

comment:48 Changed 11 years ago by danielk

(In [18608]) Refs #5596. Connect correct signal for selection updates in ProgLister?; this was broken by [18602] this morning.

comment:49 Changed 11 years ago by danielk

(In [18609]) Refs #5596. Qt4.3 compatibility patch. This was in earlier versions of the patch in #5596, but fell through the cracks at some point.

comment:50 Changed 11 years ago by danielk

(In [18610]) Refs #5596. Convert from Q3ButtonGroup to QButtonGroup in libmyth

Changed 11 years ago by danielk

Attachment: 5596-v20.patch added

what remains -- rich text widget removal

comment:51 Changed 11 years ago by danielk

(In [18616]) Refs #5596. A number of small Qt3->Qt4 conversions. Note: plugins will need to be relinked.

comment:52 Changed 11 years ago by danielk

(In [18622]) Refs #5596. A few of the remaining Qt3 constructs in libmyth. This changeset does _not_ require relinking plugins.

comment:53 Changed 11 years ago by danielk

(In [18647]) Refs #5596. Port StackedConfigurationGroup? from Qt3 to Qt4.

comment:54 Changed 11 years ago by danielk

(In [18649]) Refs #5596. Port MythWizard? to Qt4, remove TabbedConfiguratioGroup? (which wasn't being used anywhere).

comment:55 Changed 11 years ago by danielk

(In [18650]) Refs #5596. Gets rid of Q3SimpleRichText.

Note the rendering is by no means as pretty with the new Qt4 rich text handler. It can be, but now we need to use CSS for the same effect, and I did not bother to make this pixel perfect since this should soon be replaced with a MythUI component.

comment:56 Changed 11 years ago by danielk

(In [18652]) Refs #5596. More Qt4 fixes for MythWizard?.

comment:57 Changed 11 years ago by danielk

Resolution: fixed
Status: newclosed

(In [18655]) Fixes #5596. Removes last vestiges of Qt3 in libmyth

comment:58 Changed 11 years ago by Janne Grunau

(In [18723]) fixes "Change Recording Group" broken due to incomplete qt4 porting in [18589]

The signal we were connecting to was removed from the Qt4 class. Refs #5596

Note: See TracTickets for help on using tickets.