Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Sat Apr 06, 2024 3:40 am Post subject: Quirk in RMIR Girr export |
|
|
When generating a Girr export of a device update, the "Description" (topmost text field in the device upgrade editor) is taken as the name. If this is empty (which is stricly speaking sloppy, but we are humans, sometime sloppy), null is returned. RMIR sorts these in a dictionary with that name as a key, which means that there can be one and only one null. If there are several nulls, only one of these is exported, the user is presented with a more that confusing error message.
Enclosed fix takes, if "Description" empty, the setup code as name. This as, as I understand it, almost surely unique.
If desired, I will be happy to check it in.
Code: |
Index: src/main/java/com/hifiremote/jp1/DeviceUpgradeExporter.java
===================================================================
--- src/main/java/com/hifiremote/jp1/DeviceUpgradeExporter.java (revision 2042)
+++ src/main/java/com/hifiremote/jp1/DeviceUpgradeExporter.java (working copy)
@@ -750,7 +750,8 @@
jp1Parameters.put( "Protocol.name", upgrade.getProtocol().getName() );
Remote remote = new Remote( metaData, null, notes, commands, applicationParameters );
- remote.setName( upgrade.getDescription() );
+ remote.setName( upgrade.getDescription() != null ? upgrade.getDescription()
+ : ( "SetupCode_" + Integer.toString(upgrade.getSetupCode() ) ) );
RemoteConfiguration config = null;
File file = upgrade.getFile() != null ? upgrade.getFile()
: ( config = upgrade.getRemoteConfig() ) != null ? config.getOwner().file : null;
Index: src/main/java/com/hifiremote/jp1/RemoteConfiguration.java
===================================================================
--- src/main/java/com/hifiremote/jp1/RemoteConfiguration.java (revision 2042)
+++ src/main/java/com/hifiremote/jp1/RemoteConfiguration.java (working copy)
@@ -11380,7 +11380,7 @@
{
continue;
}
- String description = upgrade.getDescription();
+ String description = rSet.iterator().next().getName();
if ( !exports.contains( description ) )
{
fullSet.append( rSet );
|
|
|