Opened 9 years ago

Closed 9 years ago

#8613 closed patch (fixed)

MythGame fails to find ROMs when "extensions" field is blank in DB

Reported by: mythtv@… Owned by: robertm
Priority: minor Milestone: 0.24
Component: Plugin - MythGame Version: 0.23-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When scanning for new/missing ROMs, the GameHandler::buildFileList method checks for handler->validextensions.count() > 0. However, when this field is generated, it uses the QString::split() method which will always return a single-element list if the source string has no separator. This means that when the gameplayers.extensions field is blank, the count() will be 1 instead of zero.

This simple patch fixes it by passing QString::SkipEmptyParts?

Attachments (1)

fix_extensions.patch (641 bytes) - added by mythtv@… 9 years ago.
Prevent split() from returning empty elements

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by mythtv@…

Attachment: fix_extensions.patch added

Prevent split() from returning empty elements

comment:1 Changed 9 years ago by robertm

Status: newinfoneeded_new

Can you please be more explicit about what you are attempting to fix? I just ran a test and an emulator set up with no extensions properly finds all files in the configured directory, as the tooltip indicates it should. What is this patch meant to fix?

comment:2 Changed 9 years ago by mythtv@…

In my database, the "extensions" column in the gameplayers table does not have a value for any of the configured emulators. When the code calls the QString::split() method on an empty string, it will always return a single element list with the original string (according to the docs and to my experience using MythTV). When a checked is later done for handler->validextensions.count() > 0, it will always return that single element list (which is blank). It then tries to find files with those extensions (which it will find none), then skips processing that file (thus never adding it to the m_GameMap list.

if (result.isEmpty())

continue;

The missing information might be related to scanning for new ROMs. When I go scan for new games without the patch applied, it thinks that every existing ROM is no longer found and wants to remove it. With the patch, it correctly finds the existing ROMs and skips them.

comment:3 Changed 9 years ago by robertm

Status: infoneeded_newnew

comment:4 Changed 9 years ago by robertm

Owner: changed from greg to robertm
Status: newassigned

comment:5 Changed 9 years ago by robertm

Milestone: unknown0.24

comment:6 Changed 9 years ago by robertm

Resolution: fixed
Status: assignedclosed

Fixed in r25779.

MythGame?: Fix scan when extensions field is left empty with a patch from mythtv A T pasher. Thanks for the patch and sorry for the delay in applying it.

Note: See TracTickets for help on using tickets.