Skip to content
Snippets Groups Projects
  • Marcus Hoffmann's avatar
    313bd649
    InputBar: use multi-arg string replacement · 313bd649
    Marcus Hoffmann authored
    This could actually change the behaviour here (could, because I don't
    know if we can hit this special case) but this should hopefully the
    correct way of doing this.
    
    There's some detailed explanation of the difference here:
    https://doc.qt.io/qt-5/qstring.html#arg-14
    
    > This is the same as str.arg(a1).arg(a2), except that the strings
    > a1 and a2 are replaced in one pass. This can make a difference if
    > a1 contains e.g. %1:
    
    ```
    QString str;
    str = "%1 %2";
    
    str.arg("%1f", "Hello");        // returns "%1f Hello"
    str.arg("%1f").arg("Hello");    // returns "Hellof %2"
    ```
    
    Suggested-by:
    
    Clazy: Use multi-arg instead
    313bd649
    History
    InputBar: use multi-arg string replacement
    Marcus Hoffmann authored
    This could actually change the behaviour here (could, because I don't
    know if we can hit this special case) but this should hopefully the
    correct way of doing this.
    
    There's some detailed explanation of the difference here:
    https://doc.qt.io/qt-5/qstring.html#arg-14
    
    > This is the same as str.arg(a1).arg(a2), except that the strings
    > a1 and a2 are replaced in one pass. This can make a difference if
    > a1 contains e.g. %1:
    
    ```
    QString str;
    str = "%1 %2";
    
    str.arg("%1f", "Hello");        // returns "%1f Hello"
    str.arg("%1f").arg("Hello");    // returns "Hellof %2"
    ```
    
    Suggested-by:
    
    Clazy: Use multi-arg instead
Code owners
Assign users and groups as approvers for specific file changes. Learn more.