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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add case sensitive option #151

Open
slackuser0xae34 opened this issue Aug 19, 2019 · 3 comments
Open

Feature Request: Add case sensitive option #151

slackuser0xae34 opened this issue Aug 19, 2019 · 3 comments

Comments

@slackuser0xae34
Copy link

slackuser0xae34 commented Aug 19, 2019

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
Copy link
Owner

rodlie commented Aug 19, 2019

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
Copy link
Author

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();
  • modelTree->setDynamicSortFilter(true); // New 2019/08/20
    modelTree->setSourceModel(modelList);
    modelTree->setSortCaseSensitivity(Qt::CaseInsensitive);

    tree->setHeaderHidden(true);
    tree->setUniformRowHeights(true);
    tree->setModel(modelTree);

  • tree->setSortingEnabled(true); // New 2019/08/20

  • tree->sortByColumn(0, Qt::AscendingOrder); // New 2019/08/20
    tree->hideColumn(1);
    tree->hideColumn(2);
    tree->hideColumn(3);
    tree->hideColumn(4);

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

  • modelView->setDynamicSortFilter(true); // New 2019/08/20
    modelView->setSourceModel(modelList);
    modelView->setSortCaseSensitivity(Qt::CaseInsensitive);

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

  • detailTree->setSortingEnabled(true); // New 2019/08/20

  • detailTree->sortByColumn(0, Qt::AscendingOrder); // New 2019/08/20
    detailTree->setSelectionModel(listSelectionModel);

    pathEdit = new QComboBox();
    @@ -529,6 +536,15 @@
    // '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); // for Tree pane

  • modelView->setSortCaseSensitivity(Qt::CaseSensitive); // for Listing window

  •                                                         //    both details & icon modes
    
  • }

}

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

  • bool caseSensitive;

  • bool ignoreReload;

    QVector progressQueue;
    diff -Naur qtfm-6.2.0/share/qtfm.pri qtfm-6.2.0.2/share/qtfm.pri
    --- qtfm-6.2.0/share/qtfm.pri 2019-06-04 01:47:00.000000000 -0400
    +++ qtfm-6.2.0.2/share/qtfm.pri 2019-08-19 17:31:36.852004735 -0400
    @@ -2,7 +2,7 @@
    QTFM_TARGET_NAME = "QtFM"
    QTFM_MAJOR = 6
    QTFM_MINOR = 2
    -QTFM_PATCH = 0
    +QTFM_PATCH = 0.2

QMAKE_TARGET_COMPANY = "$${QTFM_TARGET_NAME}"
QMAKE_TARGET_PRODUCT = "$${QTFM_TARGET_NAME}"

END PATCH

@slackuser0xae34
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants