Commit 575e1faa authored by Kåre Särs's avatar Kåre Särs

Search plugin: combobox usage + saving options

Fix saving of the search terms in session data
Fix saving search folders in session data
Fix load current folder button
Fix starting search from folder combo and filter combo
parent faf02886
This diff is collapsed.
......@@ -63,7 +63,8 @@ private Q_SLOTS:
void searchPlaceChanged();
void searchPatternChanged();
void setCurrentFolder();
void matchFound(const QString &fileName, int line, int column, const QString &lineContent);
void searchDone();
......
......@@ -15,12 +15,12 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="KComboBox" name="searchCombo">
<widget class="KHistoryComboBox" name="searchCombo">
<property name="editable">
<bool>true</bool>
</property>
<property name="autoCompletion">
<bool>false</bool>
<bool>true</bool>
</property>
</widget>
</item>
......@@ -113,19 +113,6 @@
<property name="margin">
<number>0</number>
</property>
<item row="7" column="1">
<widget class="QLabel" name="folderLabel">
<property name="text">
<string>Folder</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>searchFolder</cstring>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="filterLabel">
<property name="text">
......@@ -167,13 +154,6 @@
</property>
</spacer>
</item>
<item row="7" column="2" colspan="5">
<widget class="KUrlRequester" name="searchFolder">
<property name="mode">
<set>KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly</set>
</property>
</widget>
</item>
<item row="1" column="1" colspan="6">
<widget class="Line" name="line">
<property name="orientation">
......@@ -218,6 +198,36 @@
</property>
</spacer>
</item>
<item row="8" column="6">
<widget class="QToolButton" name="currentFolderButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="folderLabel">
<property name="text">
<string>Folder</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>folderRequester</cstring>
</property>
</widget>
</item>
<item row="8" column="2" colspan="4">
<widget class="KUrlComboRequester" name="folderRequester">
<property name="mode">
<set>KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
......@@ -233,7 +243,7 @@
</widget>
</item>
<item row="0" column="2">
<widget class="QStackedWidget" name="locationStop">
<widget class="QStackedWidget" name="locationAndStop">
<property name="currentIndex">
<number>0</number>
</property>
......@@ -244,6 +254,12 @@
</property>
<item>
<widget class="KComboBox" name="searchPlaceCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>in Open files</string>
......@@ -265,6 +281,12 @@
</property>
<item>
<widget class="KPushButton" name="stopButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stop</string>
</property>
......@@ -287,11 +309,21 @@
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
</customwidget>
<customwidget>
<class>KUrlComboRequester</class>
<extends>KUrlRequester</extends>
<header>kurlrequester.h</header>
</customwidget>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KHistoryComboBox</class>
<extends>KComboBox</extends>
<header>khistorycombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>searchCombo</tabstop>
......@@ -299,7 +331,8 @@
<tabstop>searchPlaceCombo</tabstop>
<tabstop>optionsButton</tabstop>
<tabstop>displayOptions</tabstop>
<tabstop>searchFolder</tabstop>
<tabstop>folderRequester</tabstop>
<tabstop>currentFolderButton</tabstop>
<tabstop>filterCombo</tabstop>
<tabstop>recursiveCheckBox</tabstop>
<tabstop>hiddenCheckBox</tabstop>
......@@ -308,22 +341,5 @@
<tabstop>stopButton</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>searchCombo</sender>
<signal>returnPressed()</signal>
<receiver>searchButton</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel">
<x>121</x>
<y>15</y>
</hint>
<hint type="destinationlabel">
<x>260</x>
<y>16</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
......@@ -105,6 +105,8 @@ void SearchFolder::searchFile(const QFileInfo &item)
if (m_cancelSearch) return;
column = m_regExp.indexIn(line);
if (column != -1) {
// limit line length
if (line.length() > 512) line = line.left(512);
emit matchFound(item.canonicalFilePath(), i, column, line);
}
i++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment