Skip to content
Snippets Groups Projects
Commit 66615cfd authored by jonymt's avatar jonymt
Browse files

[*] adapted for Linux systems
parent fd0f0851
No related branches found
No related tags found
1 merge request!11Cellframe clone
...@@ -32,8 +32,16 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>& ...@@ -32,8 +32,16 @@ void DapChainHistoryHandler::onRequestNewHistory(const QMap<QString, QVariant>&
if(!result.isEmpty()) if(!result.isEmpty())
{ {
// TODO: error with "\r\n" // TODO: error with "\r\n"
QRegExp rx("(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\r\\n" QString reg_str;
"\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)"); #ifdef Q_OS_LINUX
reg_str = "(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\n"
"\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)";
#elif Q_OS_WIN
reg_str = "(\\w{3}\\s\\w{3}\\s\\d+\\s\\d{1,2}:\\d{2}:\\d{2}\\s\\d{4})\\r\\n"
"\\s(\\w+)\\s(\\d+)\\s(\\w+)\\s\\w+\\s+(\\w+)";
#endif
QRegExp rx(reg_str);
int pos = 0; int pos = 0;
while ((pos = rx.indexIn(result, pos)) != -1) while ((pos = rx.indexIn(result, pos)) != -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment