Skip to content

Commit dc09d39

Browse files
committed
Bye bye genericitems.*!
1 parent 5628c88 commit dc09d39

5 files changed

Lines changed: 43 additions & 317 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ set(qtedit4_sources
9999
src/plugins/ProjectManager/BuildRunOutput.ui
100100
src/plugins/ProjectManager/CompilerOutputDecoders.cpp
101101
src/plugins/ProjectManager/CompilerOutputDecoders.h
102-
src/plugins/ProjectManager/GenericItems.cpp
103-
src/plugins/ProjectManager/GenericItems.h
104102
src/plugins/ProjectManager/kitdefinitions.h
105103
src/plugins/ProjectManager/kitdefinitions.cpp
106104
src/plugins/ProjectManager/kitdefinitionmodel.h

src/plugins/ProjectManager/GenericItems.cpp

Lines changed: 0 additions & 241 deletions
This file was deleted.

src/plugins/ProjectManager/GenericItems.h

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/plugins/ProjectManager/ProjectManagerPlg.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <qmditabwidget.h>
3434

3535
#include "AnsiToHTML.hpp"
36-
#include "GenericItems.h"
3736
#include "GlobalCommands.hpp"
3837
#include "ProjectBuildConfig.h"
3938
#include "ProjectIssuesWidget.h"

src/plugins/ProjectManager/ProjectSearch.cpp

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,54 @@
1313
#include <qmdihost.h>
1414

1515
#include "AnsiToHTML.hpp"
16-
#include "GenericItems.h"
1716
#include "ProjectBuildConfig.h"
1817
#include "ProjectManagerPlg.h"
1918
#include "ProjectSearch.h"
2019
#include "ui_ProjectSearchGUI.h"
2120

21+
bool FilenameMatches(const QString &fileName, const QString &goodList, const QString &badList) {
22+
if (!badList.isEmpty()) {
23+
auto list = badList.split(";");
24+
for (const auto &rule : std::as_const(list)) {
25+
if (rule.length() < 3) {
26+
continue;
27+
}
28+
auto clean_rule = rule.trimmed();
29+
if (clean_rule.isEmpty()) {
30+
continue;
31+
}
32+
auto options = QRegularExpression::UnanchoredWildcardConversion;
33+
auto pattern = QRegularExpression::wildcardToRegularExpression(rule, options);
34+
auto regex = QRegularExpression(pattern);
35+
auto matches = regex.match(fileName).hasMatch();
36+
if (matches) {
37+
return false;
38+
}
39+
}
40+
}
41+
42+
bool filterMatchFound = true;
43+
if (!goodList.isEmpty()) {
44+
filterMatchFound = false;
45+
auto list = goodList.split(";");
46+
for (const auto &rule : std::as_const(list)) {
47+
auto clean_rule = rule.trimmed();
48+
if (clean_rule.isEmpty()) {
49+
continue;
50+
}
51+
auto options = QRegularExpression::UnanchoredWildcardConversion;
52+
auto pattern = QRegularExpression::wildcardToRegularExpression(rule, options);
53+
auto regex = QRegularExpression(pattern);
54+
auto matches = regex.match(fileName).hasMatch();
55+
if (matches) {
56+
filterMatchFound = true;
57+
break;
58+
}
59+
}
60+
}
61+
return filterMatchFound;
62+
}
63+
2264
void searchTextFile(std::ifstream &file, const std::string &searchString,
2365
std::function<void(const std::string &, size_t)> callback) {
2466
auto line = std::string();

0 commit comments

Comments
 (0)