bugGNU Octave - Bugs: bug #55902, Reformat libqterminal's...

 
 

bug #55902: Reformat libqterminal's ExtendedDefaultTranslator*.h for consistency

Submitter:  Andrew Janke <apjanke>
Submitted:  Wed 13 Mar 2019 05:18:24 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 14 Mar 2019 08:15:04 PM UTC, comment #4: 

You're welcome! Thanks for accepting this patch.

Andrew Janke <apjanke>
Thu 14 Mar 2019 08:03:29 PM UTC, comment #3: 

My mistake, the files are indeed used. They just can't be loaded at run time and allow different keyboard mappings to be used (see bug #50542).

I pushed your patch here after adding the bug number and a small description:

http://hg.savannah.gnu.org/hgweb/octave/rev/8efea0dcccd4

Thanks.

Pantxo Diribarne <pantxo>
Group Member
Wed 13 Mar 2019 09:42:29 PM UTC, comment #2: 

I think they are being used, at least on Mac.

I added this to ExtendedDefaultTranslatorMac.h:


"key Left +Control : \"Control-Left\"\n"
"key Left +Meta : \"Meta-Left\"\n"
"key Left +Shift : \"Shift-Left\"\n"


and banged on the keyboard a bit, and this came out:


>> Control-Left Meta-Left Shift-Left


Which means I'll need to edit this file in order to fix https://savannah.gnu.org/bugs/index.php?49703#comment9, so it'd be nice if this could be merged to make editing easier.

Additionally, I stuck some debugging code in:


const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QString& name)
{
    if ( name.isEmpty() ) {
        printf("%s\n", "Using default translator because name is empty.");
        return defaultTranslator();
    }

    //here was smth wrong in original Konsole source
    findTranslators();

    if ( _translators.contains(name) && _translators[name] != nullptr ) {
        qDebug() << "Found cached keyboard translator name=" << name;
        return _translators[name];
    }

    KeyboardTranslator* translator = loadTranslator(name);

    if ( translator != nullptr ) {
        qDebug() << "Loaded keyboard translator name=" << name;
        _translators[name] = translator;
    }
    else if ( !name.isEmpty() )
        qWarning() << "Unable to load translator" << name;

    return translator;
}


And got this when I ran octave-gui:


$ ./run-octave --gui
Using default translator because name is empty.


Andrew Janke <apjanke>
Wed 13 Mar 2019 10:04:50 AM UTC, comment #1: 

IIUC this file is not actually used so there won't be any functional change :-).

Pantxo Diribarne <pantxo>
Group Member
Wed 13 Mar 2019 05:18:24 AM UTC, original submission:  

I know you normally don't want patches that only affect code style. But there's a practical consideration here: The differences in the ExtendedDefaultTranslator.h and ExtendedDefaultTranslatorMac.h files in libqterminal make the Mac one hard to read, and impossible to diff the two files to see where the platforms differ.

This patch reformats the two files to make them consistent, using the open/tabular format used by ExtendedDefaultTranslator.h.

No functional changes.

Andrew Janke <apjanke>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #46513:  reformat-extended-default-translators.diff added by apjanke (9KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by apjanke (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-14 pantxo StatusNone Fixed
        Open/ClosedOpen Closed
    2019-03-13 apjanke Attached File- Added reformat-extended-default-translators.diff, #46513

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code