rodlie / qtfm

Qt File Manager
https://qtfm.eu
GNU General Public License v2.0
156 stars 43 forks source link

Feature Request: Add case sensitive option #151

Open slackuser0xae34 opened 5 years ago

slackuser0xae34 commented 5 years ago

Please add a case sensitive option for file/tree listings, when convenient. Some of us compare file listings between Qtfm and Bash shell (which is case sensitive).

I've coded a preliminary patch that allows the qtfm6.conf file to provide for case sensitive file listings. The config file would need a line: "caseSensitive=true" to enable case sensitive listings. The line must be manually added to the qtfm6.conf file. If the line is either missing or something other than "true" then the current default action is used.

I've tested this with file listing but not the tree listing option. I only use the file listing display. Thanks for a great file manager and the consideration of my request.

Best Regards, slackuser0xae34

Edit, 2020/02/25: Sorry I forgot, I license the following code under the GPL V2 (or later at the user's discretion).

 # Patch to add case sensitive:
 diff -Naur qtfm-6.2.0a/fm/src/mainwindow.cpp qtfm-6.2.0b/fm/src/mainwindow.cpp
 --- qtfm-6.2.0a/fm/src/mainwindow.cpp  2019-06-04 01:47:00.000000000 -0400
 +++ qtfm-6.2.0b/fm/src/mainwindow.cpp  2019-08-12 21:17:02.833464614 -0400
 @@ -529,6 +529,14 @@
    // 'copy of' filename
    copyXof = settings->value("copyXof", COPY_X_OF).toString();
    copyXofTS = settings->value("copyXofTS", COPY_X_TS).toString();
 +
 +  // Case Sensitive/Insensitive, 2019/08/12
 +  caseSensitive = settings->value("caseSensitive", false).toBool();
 +  if ( caseSensitive ) {
 +    modelTree->setSortCaseSensitivity(Qt::CaseSensitive);
 +    modelView->setSortCaseSensitivity(Qt::CaseSensitive);
 +  }   
 +
  }

  void MainWindow::firstRunBookmarks(bool isFirstRun)
 diff -Naur qtfm-6.2.0a/fm/src/mainwindow.h qtfm-6.2.0b/fm/src/mainwindow.h
 --- qtfm-6.2.0a/fm/src/mainwindow.h    2019-06-04 01:47:00.000000000 -0400
 +++ qtfm-6.2.0b/fm/src/mainwindow.h    2019-08-12 21:17:02.833464614 -0400
 @@ -329,6 +329,8 @@
      // custom timestamp for copy of
      QString copyXofTS;

 +    bool caseSensitive;
 +
      bool ignoreReload;

      QVector<QString> progressQueue;

 # End Patch
rodlie commented 5 years ago

Thanks for the patch. Sadly I have been very busy for a couple of months, but I will try to get a new version out this month.

slackuser0xae34 commented 5 years ago

I've done further testing and the earlier patch doesn't make the tree view case sensitive. I've updated the patch to make the tree view case sensitive. However, this patch does not make the configuration screens case sensitive. This is only a patch to make the display files/directories case sensitive.

Thanks again. slackuser0xae34

Sorry for including the patch in this text. The GitHub file selector didn't work, neither a text nor zip file could be attached.

Start Patch:

diff -Naur qtfm-6.2.0/fm/src/mainwindow.cpp qtfm-6.2.0.2/fm/src/mainwindow.cpp --- qtfm-6.2.0/fm/src/mainwindow.cpp 2019-06-04 01:47:00.000000000 -0400 +++ qtfm-6.2.0.2/fm/src/mainwindow.cpp 2019-08-20 18:36:13.242322657 -0400 @@ -181,18 +181,23 @@ setCentralWidget(main);

 modelTree = new mainTreeFilterProxyModel();

+// For the listings pane in both details & icon mode modelView = new viewsSortProxyModel();

@@ -208,6 +213,8 @@ detailTree->setItemsExpandable(false); detailTree->setUniformRowHeights(true); detailTree->setModel(modelView);

END PATCH

slackuser0xae34 commented 5 years ago

Opps, closed by accident. Still trying to figure out GitHub stuff. S.