Changeset View
Changeset View
Standalone View
Standalone View
addons/search/plugin_search.cpp
Show First 20 Lines • Show All 1089 Lines • ▼ Show 20 Line(s) | 1010 | { | |||
---|---|---|---|---|---|
1090 | 1090 | | |||
1091 | const bool inCurrentProject = m_ui.searchPlaceCombo->currentIndex() == Project; | 1091 | const bool inCurrentProject = m_ui.searchPlaceCombo->currentIndex() == Project; | ||
1092 | const bool inAllOpenProjects = m_ui.searchPlaceCombo->currentIndex() == AllProjects; | 1092 | const bool inAllOpenProjects = m_ui.searchPlaceCombo->currentIndex() == AllProjects; | ||
1093 | 1093 | | |||
1094 | if (m_ui.searchPlaceCombo->currentIndex() == CurrentFile) { | 1094 | if (m_ui.searchPlaceCombo->currentIndex() == CurrentFile) { | ||
1095 | m_searchDiskFilesDone = true; | 1095 | m_searchDiskFilesDone = true; | ||
1096 | m_resultBaseDir.clear(); | 1096 | m_resultBaseDir.clear(); | ||
1097 | QList<KTextEditor::Document *> documents; | 1097 | QList<KTextEditor::Document *> documents; | ||
1098 | documents << m_mainWindow->activeView()->document(); | 1098 | KTextEditor::View *activeView = m_mainWindow->activeView(); | ||
1099 | if (activeView) { | ||||
sars: I would format the "if" like this even if it is only one line.
if () {
foo;
}
It is easier… | |||||
1100 | documents << activeView->document(); | ||||
1101 | } | ||||
1099 | addHeaderItem(); | 1102 | addHeaderItem(); | ||
1100 | m_searchOpenFiles.startSearch(documents, reg); | 1103 | m_searchOpenFiles.startSearch(documents, reg); | ||
1101 | } else if (m_ui.searchPlaceCombo->currentIndex() == OpenFiles) { | 1104 | } else if (m_ui.searchPlaceCombo->currentIndex() == OpenFiles) { | ||
1102 | m_searchDiskFilesDone = true; | 1105 | m_searchDiskFilesDone = true; | ||
1103 | m_resultBaseDir.clear(); | 1106 | m_resultBaseDir.clear(); | ||
1104 | const QList<KTextEditor::Document *> documents = m_kateApp->documents(); | 1107 | const QList<KTextEditor::Document *> documents = m_kateApp->documents(); | ||
1105 | addHeaderItem(); | 1108 | addHeaderItem(); | ||
1106 | m_searchOpenFiles.startSearch(documents, reg); | 1109 | m_searchOpenFiles.startSearch(documents, reg); | ||
▲ Show 20 Lines • Show All 1218 Lines • Show Last 20 Lines |
I would format the "if" like this even if it is only one line.
if () {
}
It is easier to set a breakpoint in a debugger...