public
Description: Real-time web-server visualization using OpenGL and a force directed layout
Homepage: http://www.fudgie.org/gltrail.html
Clone URL: git://github.com/Fudge/gltrail.git
Add auto_purge option, defaults to false
Fudge (author)
Fri Mar 07 06:38:32 -0800 2008
commit  28744565b891d05cb943cfbeb0bfc2e32c3b0bf6
tree    2a6ac12fceb20acf6f1648486395d3e0c2441282
parent  23af35c21ccd35f036a1517bfcffa32b2b64a3a1
...
11
12
13
 
14
15
...
11
12
13
14
15
16
0
@@ -11,5 +11,6 @@ replace_:id=/\\d+$
0
 replace_:md5=/[a-zA-Z0-9]{32}
0
 ignore=\\.(jpg|png|jpeg|gif|swf|js|css|jar|ico|mp3)$
0
 ignore_url_params=true
0
+auto_purge=true
0
 color=#FF4444
0
 
...
225
226
227
228
 
229
230
231
...
225
226
227
 
228
229
230
231
0
@@ -225,7 +225,7 @@ void GLWidget::paintGL()
0
 
0
     e->render(this);
0
 
0
- if( e->expired() ) {
0
+ if( e->expired() && e->host->doPurge() ) {
0
       cout << "Expired[" << e->name().toStdString() << "][" << e->rate << "]" << endl;
0
 
0
       for(iter2 = nodes.begin(); iter2 != nodes.end(); ++iter2) {
...
25
26
27
28
 
29
30
 
31
32
33
...
43
44
45
46
 
 
47
48
49
...
70
71
72
 
 
73
74
75
...
25
26
27
 
28
29
30
31
32
33
34
...
44
45
46
 
47
48
49
50
51
...
72
73
74
75
76
77
78
79
0
@@ -25,9 +25,10 @@ class Host : public QObject {
0
   void setCommand(const QString &c) { command = c; };
0
   void setArgs(const QString &a) { args = a; };
0
   void setPattern(const QString &p) { pattern = p; };
0
- void setIgnore(const QString &i) { ignore = i; };
0
+ void setIgnore(const QString &i) { ignore = i; };
0
   void setColor(const QString &c) { color = QColor(c); };
0
   void setIgnoreQueryParameters(bool p) { ignoreParams = p; };
0
+ void setAutoPurge(bool p) {autoPurge = p; };
0
 
0
   void addReplacement(const QString &p, const QString &s) {
0
     replacementPatterns << p;
0
@@ -43,7 +44,8 @@ class Host : public QObject {
0
   bool ignoreQueryParameters( void ) { return ignoreParams; };
0
 
0
   QString getDomain( void ) const { return domain; };
0
- QColor getColor( void ) const { return color; };
0
+ QColor getColor( void ) const { return color; };
0
+ bool doPurge( void ) const { return autoPurge; };
0
 
0
   void start();
0
   void end();
0
@@ -70,6 +72,8 @@ public slots:
0
   QString pattern;
0
   QColor color;
0
 
0
+ bool autoPurge;
0
+
0
   QStringList replacementPatterns;
0
   QStringList replacementStrings;
0
 
...
53
54
55
56
 
57
58
59
...
87
88
89
 
90
91
92
93
94
95
96
97
98
99
 
 
 
 
 
 
100
101
102
...
53
54
55
 
56
57
58
59
...
87
88
89
90
91
92
93
94
 
 
 
 
 
 
95
96
97
98
99
100
101
102
103
0
@@ -53,7 +53,7 @@ Window::~Window()
0
 void Window::readSettings(GLWidget *gl) {
0
 
0
   QString configFile("gltrail.ini");
0
-
0
+
0
   if( QCoreApplication::arguments().size() > 1 ) {
0
     configFile = QCoreApplication::arguments().at(1);
0
   }
0
@@ -87,16 +87,17 @@ void Window::readSettings(GLWidget *gl) {
0
     h->setIgnore( settings.value("ignore").toString() );
0
     h->setColor( settings.value("color").toString() );
0
     h->setIgnoreQueryParameters( settings.value("ignore_url_params").toBool() );
0
+ h->setAutoPurge( settings.value("auto_purge").toBool() );
0
 
0
     QStringList keys = settings.childKeys();
0
     for( int i = 0; i < keys.size(); i++ ) {
0
       if( keys[i].startsWith("replace_") ) {
0
- QString pattern = settings.value(keys[i]).toString();
0
- QString str = keys[i];
0
- str.replace("replace_", "");
0
- if( pattern.startsWith("/") )
0
- str = "/" + str;
0
- h->addReplacement( pattern,str );
0
+ QString pattern = settings.value(keys[i]).toString();
0
+ QString str = keys[i];
0
+ str.replace("replace_", "");
0
+ if( pattern.startsWith("/") )
0
+ str = "/" + str;
0
+ h->addReplacement( pattern,str );
0
       }
0
     }
0
 
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
...
39
40
41
 
 
 
 
 
 
 
 
 
 
42
43
44
0
@@ -39,16 +39,6 @@ public:
0
 private:
0
    GLWidget *glWidget;
0
    QProcess *proc;
0
-
0
-
0
-
0
- QString host;
0
- QString user;
0
- QString port;
0
- QString command;
0
- QString args;
0
- QString pattern;
0
-
0
 };
0
 
0
 #endif

Comments

    No one has commented yet.