Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes various small bugs with the quote and separator choices #611

Merged
merged 1 commit into from May 28, 2016
Merged

Fixes various small bugs with the quote and separator choices #611

merged 1 commit into from May 28, 2016

Conversation

justinclift
Copy link
Member

@justinclift justinclift commented May 26, 2016

Fixes #610.

Expanded out many of the functions so they can be single stepped
through easily by newbies (eg me), which allowed for identifying
(then fixing) a few minor bugs.

  • if setSeparatorChar() had an empty value passed to it the first
    time, then in subsequent calls it would silently use \0 instead,
    including using that in the output CSV data. Likely not great. 馃槈
  • the empty option for the quote separator is now correctly retained
    between runs of the dialog

@justinclift justinclift added the bug Confirmed bugs or reports that are very likely to be bugs. label May 26, 2016
@justinclift justinclift self-assigned this May 26, 2016
@revolter
Copy link
Member

A little off-topic regarding this PR, but, does this project have a coding style? I noticed that you put the brackets on the same line (I personally prefer this too), while in the rest of the project they are on a separate line. I think it would be a good idea to stick with a single coding style throughout the entire project. What do you think? Maybe we ca discuss this in more depth in #602.

@justinclift
Copy link
Member Author

Hmmm, I've seen both styles of bracket placement in the code already. (eg do a grep -r "else" from the main dir)

So, I just picked my preference. 馃槃

@justinclift
Copy link
Member Author

After sleeping on it, I kind of think the switch statement approach used in currentNewLineString() is super clear and without unwanted side effects: https://github.com/sqlitebrowser/sqlitebrowser/blob/master/src/ExportCsvDialog.cpp#L322-L334

So, I might try redoing some of the methods in this PR using that, and see if it's an improvement. 馃槃

@revolter
Copy link
Member

I personally indent the cases 馃槃

@revolter
Copy link
Member

My question wasn't necessarily about this PR, it was about the whole project and the future PRs. But it was just an idea 馃槃

@justinclift
Copy link
Member Author

Yeah, its a good idea. 馃槃

@justinclift
Copy link
Member Author

justinclift commented May 26, 2016

With indenting the cases... I actually remember my decision here. I went with the default that Qt Creator set them to when I first entered the switch keyword and hit return.

Personally, it's not something I care much about, so if we decide to have a defined coding style for them I'm happy to do whatever. 馃槃

Expanded out many of the functions so they can be single stepped
through easily by newbies (eg me), which allowed for identifying
(then fixing) a few minor bugs.

  * if setSeparatorChar() had an empty value passed to it the first
    time, then in subsequent calls it would silently use \0 instead,
    including using that in the output CSV data.  Likely not great. ;)
  * the empty option for the quote separator is now correctly retained
    between runs of the dialog
@justinclift
Copy link
Member Author

Rewrote the functions using a switch statement. Also fixed another minor-ish bug in the output, found when examining the csv output using hexedit.

Side note, that hexedit util is nifty. Nicely, it's available via Homebrew (brew install hexedit).

@justinclift justinclift merged commit 0ec0e6c into sqlitebrowser:master May 28, 2016
@justinclift justinclift deleted the issue610v2 branch May 28, 2016 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Third option in Quote character field of ExportCSV dialog isn't restored properly
2 participants