1103 @param other reference to item to compare against (BrowserItem) |
1103 @param other reference to item to compare against (BrowserItem) |
1104 @param column column number to use for the comparison (integer) |
1104 @param column column number to use for the comparison (integer) |
1105 @param order sort order (Qt.SortOrder) (for special sorting) |
1105 @param order sort order (Qt.SortOrder) (for special sorting) |
1106 @return true, if this item is less than other (boolean) |
1106 @return true, if this item is less than other (boolean) |
1107 """ |
1107 """ |
1108 if issubclass(other.__class__, BrowserFileItem): |
1108 if ( |
1109 if Preferences.getUI("BrowsersListFoldersFirst"): |
1109 issubclass(other.__class__, BrowserFileItem) and |
1110 return order == Qt.SortOrder.AscendingOrder |
1110 Preferences.getUI("BrowsersListFoldersFirst") |
|
1111 ): |
|
1112 return order == Qt.SortOrder.AscendingOrder |
1111 |
1113 |
1112 return BrowserItem.lessThan(self, other, column, order) |
1114 return BrowserItem.lessThan(self, other, column, order) |
1113 |
1115 |
1114 |
1116 |
1115 class BrowserSysPathItem(BrowserItem): |
1117 class BrowserSysPathItem(BrowserItem): |
1412 @param other reference to item to compare against (BrowserItem) |
1414 @param other reference to item to compare against (BrowserItem) |
1413 @param column column number to use for the comparison (integer) |
1415 @param column column number to use for the comparison (integer) |
1414 @param order sort order (Qt.SortOrder) (for special sorting) |
1416 @param order sort order (Qt.SortOrder) (for special sorting) |
1415 @return true, if this item is less than other (boolean) |
1417 @return true, if this item is less than other (boolean) |
1416 """ |
1418 """ |
1417 if not issubclass(other.__class__, BrowserFileItem): |
1419 if ( |
1418 if Preferences.getUI("BrowsersListFoldersFirst"): |
1420 not issubclass(other.__class__, BrowserFileItem) and |
1419 return order == Qt.SortOrder.DescendingOrder |
1421 Preferences.getUI("BrowsersListFoldersFirst") |
|
1422 ): |
|
1423 return order == Qt.SortOrder.DescendingOrder |
1420 |
1424 |
1421 if issubclass(other.__class__, BrowserFileItem): |
1425 if issubclass(other.__class__, BrowserFileItem): |
1422 sinit = os.path.basename(self._filename).startswith('__init__.py') |
1426 sinit = os.path.basename(self._filename).startswith('__init__.py') |
1423 oinit = os.path.basename(other.fileName()).startswith( |
1427 oinit = os.path.basename(other.fileName()).startswith( |
1424 '__init__.py') |
1428 '__init__.py') |