Quirk in RMIR Girr export

Discussion forum for JP1 software tools currently in use, or being developed, such as IR, KM, RemoteMaster, and other misc apps/tools.

Moderator: Moderators

Post Reply
Barf
Expert
Posts: 1524
Joined: Fri Oct 24, 2008 1:54 pm
Location: Munich, Germany
Contact:

Quirk in RMIR Girr export

Post by Barf »

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: Select all

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 );

mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

Yes please, do check it in.
Graham
Post Reply