Skip to content

Inconsistent backslashes in Windows files #735

Closed

Description

@chrisjlocke

Details for the issue

When opening files on the C drive, backslashes are changed to forward slashes, but on the D drive, backslashes are maintained.

After using DB4S for a while now, I've kinda gotten used to files having forward slashes - guessed it was part of the 'cross OS' style-ness of the program. However, tonight I realised it was only doing it for certain files?

image

image

image

Just wondered if this 'inconsistency' was a bug more than a quirk....
It is only a cosmetic thing, and has no impact on the program.

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows
  • Linux: ( distro: ___ )
  • Mac OS
  • Other: ___

I'm using DB4S version:

  • 3.9.0 beta1
  • 3.8.0
  • Other: 3.8.99 (nightlies)___

I have also:

Activity

  1. chrisjlocke commented on Aug 18, 2016

    @chrisjlocke
    MemberAuthor

    Actually, just thought and realised the ones on the C drive have been created and opened, while the ones on the D drive have been created previously, so just opened. Its still a bug/issue ... albeit a very very minor cosmetic one! 😉

  2. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Aug 18, 2016
  3. justinclift commented on Aug 18, 2016

    @justinclift
    Member

    With the back and forward slashes, is that just in the "Recent Files" list thing?

  4. chrisjlocke commented on Aug 19, 2016

    @chrisjlocke
    MemberAuthor

    And in the main caption of the window (as per the 2nd and 3rd screenshots...)
    It has no performance/program knock-on affects, but is just 'odd' when you look at it. I guess its just some parsing done in one part thats squiffy. (Thats a technical term just below 'bug', but I don't think you have a label for that!)

  5. justinclift commented on Aug 19, 2016

    @justinclift
    Member

    Heh Heh Heh

    Ahhh yeah, I use "wonky". Same kind of thing. 😁

    With the first screenshot, it should be fairly trivial to fix. If we throw in a regex or similar to replace slashes in the filename string with the correct one for the platform, I think that would do the trick:

        https://github.com/sqlitebrowser/sqlitebrowser/blob/master/src/MainWindow.cpp#L1240-L1241

    Updating the window title will probably use the same regex, applying it to the filename here:

        https://github.com/sqlitebrowser/sqlitebrowser/blob/master/src/MainWindow.cpp#L1257-L1262

  6. chrisjlocke commented on Aug 19, 2016

    @chrisjlocke
    MemberAuthor

    Interesting snippet of code there.

    // Add shortcut for opening the file using the keyboard. However, if the
    application is configured to store
    // more than nine recently opened files don't set shortcuts for the later
    ones which wouldn't be single digit anymore.
    if(i < 9)
    recentFileActs[i]->setShortcut(QKeySequence(Qt::CTRL + (Qt::Key_1+i)));

    ... surely that should be if(i<10).... or if(i<=9)....... as the
    ninth entry isn't being shortcutted.

    I can't test it, as my proggy only goes up to 5.

    [image: Inline image 1]

    Unsure how to set that higher....

  7. justinclift commented on Aug 19, 2016

    @justinclift
    Member

    That's a good first thought. 😄

    Looking at the initialisation for i though, it's starting out at 0. So<=9 would be 10 values, which would be too many.

  8. chrisjlocke commented on Aug 19, 2016

    @chrisjlocke
    MemberAuthor

    Doh. Didn't look at that. Oops.

  9. justinclift commented on Aug 19, 2016

    @justinclift
    Member

    You're trying, that's the important thing. 😄

  10. chrisjlocke commented on Aug 20, 2016

    @chrisjlocke
    MemberAuthor

    Thats what my wife says. I'm very trying... I'm not too sure its a compliment when she says it... 😉

  11. justinclift commented on Apr 11, 2017

    @justinclift
    Member

    @MKleusberg Do you have a few moments to knock together a quick patch to use the correct platform specific slashes?

    Pretty sure this'll be super easy. 😄

  12. MKleusberg commented on May 3, 2017

    @MKleusberg
    Member

    @justinclift I can try 😃

    @chrisjlocke Can you try the new commit I have just pushed? It's completely untested because I don't have a Windows system, so I'm wondering if it does the job 😉

  13. justinclift commented on May 4, 2017

    @justinclift
    Member

    @chrisjlocke Ping? 😁

  14. chrisjlocke commented on May 5, 2017

    @chrisjlocke
    MemberAuthor

    The file list history now has the correct backslashes (didn't before), but the window caption doesn't.

    image

  15. MKleusberg commented on May 5, 2017

    @MKleusberg
    Member

    Thanks! Should be fixed with the last commit 😃

  16. MKleusberg commented on May 8, 2017

    @MKleusberg
    Member

    @chrisjlocke Is it working for you? 😃

  17. chrisjlocke commented on May 8, 2017

    @chrisjlocke
    MemberAuthor

    Working brilliantly now, thank you! 🍨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs or reports that are very likely to be bugs.windows

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions