1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Expand folders when filtering files. Closes #1076.

This commit is contained in:
sledgehammer999 2013-11-10 03:59:53 +02:00
parent 68cc35e3fd
commit 60a1937bf9
2 changed files with 14 additions and 1 deletions

View File

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

View File

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