JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Quirk in RMIR Girr export

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Software
View previous topic :: View next topic  
Author Message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1415
Location: Munich, Germany

                    
PostPosted: Sat Apr 06, 2024 3:40 am    Post subject: Quirk in RMIR Girr export Reply with quote

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

Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Sat Apr 06, 2024 9:36 am    Post subject: Reply with quote

Yes please, do check it in.
_________________
Graham
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Software All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control