This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b641f2b873d55f8ba7b99db906fe6a780a910369 (commit)
       via  4164078c8540bbf75b47afd5c1bee0acbbd5b253 (commit)
      from  f14f4875429bcc4445ec06328f42d3243bd36892 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b641f2b873d55f8ba7b99db906fe6a780a910369
commit b641f2b873d55f8ba7b99db906fe6a780a910369
Merge: f14f487 4164078
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Jan 10 09:28:37 2017 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Tue Jan 10 09:28:37 2017 -0500

    Merge topic '16204-regex-explorer-match-all' into next
    
    4164078c cmake-gui: Add MATCHALL option to Regex Explorer


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4164078c8540bbf75b47afd5c1bee0acbbd5b253
commit 4164078c8540bbf75b47afd5c1bee0acbbd5b253
Author:     Gregor Jasny <gja...@googlemail.com>
AuthorDate: Tue Dec 27 16:38:09 2016 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Tue Jan 10 09:28:13 2017 -0500

    cmake-gui: Add MATCHALL option to Regex Explorer
    
    Closes: #16204

diff --git a/Source/QtDialog/RegexExplorer.cxx 
b/Source/QtDialog/RegexExplorer.cxx
index 1512166..abed70e 100644
--- a/Source/QtDialog/RegexExplorer.cxx
+++ b/Source/QtDialog/RegexExplorer.cxx
@@ -64,10 +64,32 @@ void RegexExplorer::on_inputText_textChanged()
     return;
   }
 
+  std::string matchingText;
+
+  if (matchAll->isChecked()) {
+    const char* p = m_text.c_str();
+    while (m_regexParser.find(p)) {
+      std::string::size_type l = m_regexParser.start();
+      std::string::size_type r = m_regexParser.end();
+      if (r - l == 0) {
+        // matched empty string
+        clearMatch();
+        return;
+      }
+      if (!matchingText.empty()) {
+        matchingText += ";";
+      }
+      matchingText += std::string(p + l, r - l);
+      p += r;
+    }
+  } else {
+    matchingText = m_regexParser.match(0);
+  }
+
 #ifdef QT_NO_STL
-  QString matchText = m_regexParser.match(0).c_str();
+  QString matchText = matchingText.c_str();
 #else
-  QString matchText = QString::fromStdString(m_regexParser.match(0));
+  QString matchText = QString::fromStdString(matchingText);
 #endif
   match0->setPlainText(matchText);
 
@@ -95,8 +117,16 @@ void RegexExplorer::on_matchNumber_currentIndexChanged(int 
index)
   matchN->setPlainText(match);
 }
 
+void RegexExplorer::on_matchAll_toggled(bool checked)
+{
+  Q_UNUSED(checked);
+
+  on_inputText_textChanged();
+}
+
 void RegexExplorer::clearMatch()
 {
+  m_matched = false;
   match0->clear();
   matchN->clear();
 }
diff --git a/Source/QtDialog/RegexExplorer.h b/Source/QtDialog/RegexExplorer.h
index f1c1e5f..caef975 100644
--- a/Source/QtDialog/RegexExplorer.h
+++ b/Source/QtDialog/RegexExplorer.h
@@ -22,6 +22,7 @@ private slots:
   void on_regularExpression_textChanged(const QString& text);
   void on_inputText_textChanged();
   void on_matchNumber_currentIndexChanged(int index);
+  void on_matchAll_toggled(bool checked);
 
 private:
   static void setStatusColor(QWidget* widget, bool successful);
diff --git a/Source/QtDialog/RegexExplorer.ui b/Source/QtDialog/RegexExplorer.ui
index 2c2d761..0af69999 100644
--- a/Source/QtDialog/RegexExplorer.ui
+++ b/Source/QtDialog/RegexExplorer.ui
@@ -104,11 +104,38 @@
     <widget class="QLineEdit" name="regularExpression"/>
    </item>
    <item>
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Complete Match</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Complete Match</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_5">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="matchAll">
+       <property name="text">
+        <string>Match All</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <widget class="QPlainTextEdit" name="match0">

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to