MCPcopy Create free account
hub / github.com/cxasm/notepad-- / tranInputKeyword

Method tranInputKeyword

src/batchfindreplace.cpp:99–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outputKeyWordList)
100{
101 //�ѿհ��ַ����ո����\t \r\n ���ַ������滻Ϊ�ո�
102 QRegExp re("\\s");
103 findKeyWord.replace(re, QString(" "));
104
105 //�ٽ��пո�ָ�����
106 outputKeyWordList = findKeyWord.split(" ");
107
108 if (outputKeyWordList.size() > 20000)
109 {
110 ui.statusBar->showMessage(tr("Max find key word 20000 !"), 10000);
111 return false;
112 }
113
114 //ɾ��ÿһ���յ�Ԫ��
115 for (int i = outputKeyWordList.size() - 1; i >= 0; --i)
116 {
117 if (outputKeyWordList[i].trimmed().isEmpty())
118 {
119 outputKeyWordList.removeAt(i);
120 }
121 }
122
123 if (outputKeyWordList.isEmpty())
124 {
125 return false;
126 }
127
128 return true;
129}
130
131void BatchFindReplace::on_freshBtClick()
132{

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
replaceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected