[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed Sep 15 18:59:19 CEST 2004


CVS commit by arwalker: 

Correctly load the ELOG settings into an event monitor entry.


  M +3 -1      kst.cpp   1.232
  M +26 -20    ksteventmonitorentry.cpp   1.24


--- kdeextragear-2/kst/kst/kst.cpp  #1.231:1.232
@@ -250,5 +250,7 @@ void KstApp::customEvent(QCustomEvent *p
   } else if (pEvent->type() == KstELOGConfigureEvent) {
     QTextStream *pTextStream = (QTextStream*)pEvent->data();
+    if (document()) {
     document()->saveDocument(*pTextStream);
+    }
   } else if (pEvent->type() == KstELOGCaptureEvent) {
     KstELOGCaptureStruct* pCapture = (KstELOGCaptureStruct*)pEvent->data();

--- kdeextragear-2/kst/kst/ksteventmonitorentry.cpp  #1.23:1.24
@@ -40,4 +40,9 @@ const QString EventMonitorEntry::OUTYVEC
 
 EventMonitorEntry::EventMonitorEntry(const QString &in_tag) : KstDataObject() {
+  _level = KstDebug::Warning;
+  _bLogKstDebug = true;
+  _bLogEMail = false;
+  _bLogELOG = false;
+
   commonConstructor( in_tag );
 }
@@ -46,4 +51,9 @@ EventMonitorEntry::EventMonitorEntry(QDo
   QString strTag;
 
+  _level = KstDebug::Warning;
+  _bLogKstDebug = true;
+  _bLogEMail = false;
+  _bLogELOG = false;
+
   QDomNode n = e.firstChild();
   while( !n.isNull() ) {
@@ -83,11 +93,7 @@ void EventMonitorEntry::commonConstructo
   int NS = 1;
 
-  _level = KstDebug::Warning;
-  _pExpression = 0L;
-  _bLogKstDebug = true;
-  _bLogEMail = false;
-  _bLogELOG = false;
-  _bIsValid = false;
   _iNumDone = 0;
+  _bIsValid = false;
+  _pExpression = 0L;
 
   _typeString = i18n("Event");
@@ -241,23 +247,17 @@ void EventMonitorEntry::logImmediately( 
   if( iSize > 0 ) {
           QString str;
-    if( _strDescription.isEmpty( ) ) {
-      str = _strEvent;
-    } else {
-      str = _strDescription;
-    }
+    QString strRange;
 
-    // FIXME: i18n completely broken here for RTL.
-    str = i18n("Event Monitor: %1: ").arg( str );
     for( i=0; i<iSize; i++ ) {
       iIndex = *(_indexArray.at(i));
       if( i == 0 ) {
-        str += i18n("%1").arg( iIndex );
+        strRange += i18n("%1").arg( iIndex );
       } else if( !bRange && iIndex == iIndexOld+1 ) {
         bRange = true;
       } else if( bRange && iIndex != iIndexOld+1 ) {
-        str += i18n("-%1,%2").arg( iIndexOld ).arg( iIndex );
+        strRange += i18n("-%1,%2").arg( iIndexOld ).arg( iIndex );
         bRange = false;
       } else if( iIndex != iIndexOld+1 ) {
-        str += i18n(",%1").arg( iIndex );
+        strRange += i18n(",%1").arg( iIndex );
       }
       iIndexOld = iIndex;
@@ -265,5 +265,11 @@ void EventMonitorEntry::logImmediately( 
 
     if( bRange ) {
-      str += i18n("-%1").arg( iIndex );
+      strRange += i18n("-%1").arg( iIndex );
+    }
+
+    if( _strDescription.isEmpty( ) ) {
+      str = i18n("Event Monitor: %1: %2").arg( _strEvent ).arg( strRange );
+    } else {
+      str = i18n("Event Monitor: %1: %2").arg( _strDescription ).arg( strRange );
     }
 





More information about the Kst mailing list