Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 27, 2025

Qt's QFileDialog on Linux treats file patterns case-sensitively. A filter with *.bin won't match .BIN files, preventing plugins from loading files with uppercase extensions.

Changes

  • Modified file dialog filter generation in MainWindow::on_buttonLoadDatafile_clicked() to include both lowercase and uppercase variants of each extension
  • Internal file matching logic unchanged - continues using toLower() for case-insensitive comparison

Example

Before:

file_extension_filter = "*.bin *.csv *.log"
// Shows: test.bin ✓
// Hides: test.BIN ✗

After:

for (const auto& it : extensions)
{
  file_extension_filter.append(QString(" *.") + it);
  file_extension_filter.append(QString(" *.") + it.toUpper());
}
// Result: "*.bin *.BIN *.csv *.CSV *.log *.LOG"
// Shows: test.bin ✓, test.BIN ✓, test.Bin ✓

Enables loading ArduPilot dataflash logs (.BIN) and other files with uppercase extensions without renaming.

Original prompt

This section details on the original issue you should resolve

<issue_title>Cannot open .BIN file because of toLower()</issue_title>
<issue_description># Problem description

Would it be possible to remove the use of toLower here?
https://github.com/facontidavide/PlotJuggler/blob/main/plotjuggler_app/mainwindow.cpp#L1460

It prevents our plugin from readings logs ending with .BIN. Instead, they need to be renamed to end with .bin.

Answer these questions (or I will ignore your issue)

  1. Describe your platform / Operative System and the version of PlotJuggler you are using.
    Ubuntu 22.04; PlotJuggler 3.9.1
  2. Compile and try the latest version in the main branch and check if the problem persists.
    Didn't do it, but I checked main and the line of code is still there.
  3. Check if the problem can be reproduced using the dummy data created by the command line argument "-t" or one of the files in the folder "datasamples".
    This check is not applicable to our custom .BIN file.
  4. If it can't be reproduced with the dummy data, please share the CSV file or the rosbag that can be used to reproduce the problem.
    Any Ardupilot dataflash log will do, but you'll need the plugin to open them.
    If you still need to try it, let me know.
    </issue_description>

<agent_instructions>is there a way to allow the Qt File dialog to be case insensitive?</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 27, 2025 15:08
Add both lowercase and uppercase variants of file extensions to the
QFileDialog filter to support case-insensitive matching on platforms
where the file dialog is case-sensitive (e.g., Linux).

This allows files with uppercase extensions like .BIN to be opened
alongside lowercase .bin files, resolving the issue where plugins
supporting "bin" extension couldn't open ".BIN" files.

The internal file matching logic remains unchanged and continues to
use toLower() for case-insensitive comparison.

Fixes issue where ArduPilot dataflash logs ending with .BIN couldn't
be opened without renaming to lowercase .bin extension.

Co-authored-by: facontidavide <2822888+facontidavide@users.noreply.github.com>
Co-authored-by: facontidavide <2822888+facontidavide@users.noreply.github.com>
Co-authored-by: facontidavide <2822888+facontidavide@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove usage of toLower() for .BIN file handling Dec 27, 2025
Copilot AI requested a review from facontidavide December 27, 2025 15:11
@facontidavide facontidavide deleted the copilot/remove-tolower-in-file-handling branch December 27, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants