summaryrefslogtreecommitdiff
path: root/src/ClientPattern.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientPattern.cc')
-rw-r--r--src/ClientPattern.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index 7ad3a54..76151aa 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -20,16 +20,16 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ClientPattern.cc,v 1.1 2003/06/12 15:12:19 rathnor Exp $ 23// $Id: ClientPattern.cc,v 1.2 2003/06/13 12:01:06 fluxgen Exp $
24 24
25#include "ClientPattern.hh" 25#include "ClientPattern.hh"
26#include "RegExp.hh" 26#include "RegExp.hh"
27#include "StringUtil.hh" 27#include "StringUtil.hh"
28#include "WinClient.hh" 28#include "WinClient.hh"
29 29
30//use GNU extensions 30// use GNU extensions
31#ifndef _GNU_SOURCE 31#ifndef _GNU_SOURCE
32#define _GNU_SOURCE 32#define _GNU_SOURCE
33#endif // _GNU_SOURCE 33#endif // _GNU_SOURCE
34 34
35 35
@@ -41,10 +41,6 @@
41 41
42using namespace std; 42using namespace std;
43 43
44/********************************************************
45 * ClientPattern *
46 ***********/
47
48ClientPattern::ClientPattern(): 44ClientPattern::ClientPattern():
49 m_matchlimit(0), 45 m_matchlimit(0),
50 m_nummatches(0) {} 46 m_nummatches(0) {}
@@ -161,17 +157,19 @@ std::string ClientPattern::toString() const {
161 Terms::const_iterator it_end = m_terms.end(); 157 Terms::const_iterator it_end = m_terms.end();
162 for (; it != it_end; ++it) { 158 for (; it != it_end; ++it) {
163 pat.append(" ("); 159 pat.append(" (");
164 if ((*it)->prop == NAME) { 160
161 switch ((*it)->prop) {
162 case NAME:
165 // do nothing -> this is the default 163 // do nothing -> this is the default
166 } else if ((*it)->prop == CLASS) { 164 break;
165 case CLASS:
167 pat.append("class="); 166 pat.append("class=");
168 } else if ((*it)->prop == TITLE) { 167 break;
168 case TITLE:
169 pat.append("title="); 169 pat.append("title=");
170 } else { 170 break;
171#ifdef DEBUG
172 cerr<<"WARNING: unknown window property, can't save properly"<<endl;
173#endif //DEBUG
174 } 171 }
172
175 pat.append((*it)->orig); 173 pat.append((*it)->orig);
176 pat.append(")"); 174 pat.append(")");
177 } 175 }
@@ -228,8 +226,8 @@ std::string ClientPattern::getProperty(WinProperty prop, const WinClient &client
228 return client.getWMClassClass(); 226 return client.getWMClassClass();
229 break; 227 break;
230 case NAME: 228 case NAME:
231 default:
232 return client.getWMClassName(); 229 return client.getWMClassName();
233 break; 230 break;
234 } 231 }
232 return client.getWMClassName();
235} 233}