Browse Source

Expand folders when filtering files. Closes #1076.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
60a1937bf9
  1. 12
      src/properties/propertieswidget.cpp
  2. 3
      src/properties/propertieswidget.h

12
src/properties/propertieswidget.cpp

@ -79,7 +79,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra @@ -79,7 +79,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
filesList->setSortingEnabled(true);
// Torrent content filtering
m_contentFilerLine = new LineEdit(this);
connect(m_contentFilerLine, SIGNAL(textChanged(QString)), PropListModel, SLOT(setFilterFixedString(QString)));
connect(m_contentFilerLine, SIGNAL(textChanged(QString)), this, SLOT(filterText(QString)));
contentFilterLayout->insertWidget(1, m_contentFilerLine);
// SIGNAL/SLOTS
@ -732,3 +732,13 @@ void PropertiesWidget::filteredFilesChanged() { @@ -732,3 +732,13 @@ void PropertiesWidget::filteredFilesChanged() {
applyPriorities();
}
}
void PropertiesWidget::filterText(const QString& filter) {
PropListModel->setFilterFixedString(filter);
if (filter.isEmpty()) {
filesList->collapseAll();
filesList->expand(PropListModel->index(0, 0));
}
else
filesList->expandAll();
}

3
src/properties/propertieswidget.h

@ -116,6 +116,9 @@ private: @@ -116,6 +116,9 @@ private:
QShortcut *editHotkeyFile;
QShortcut *editHotkeyWeb;
QShortcut *deleteHotkeyWeb;
private slots:
void filterText(const QString& filter);
};
#endif // PROPERTIESWIDGET_H

Loading…
Cancel
Save