[Kst] branches/work/kst/portto4/kst/src/libkst

George Staikos staikos at kde.org
Wed Feb 28 03:39:43 CET 2007


SVN commit 637887 by staikos:

some KDE4 fixes, especially i18n related


 M  +4 -4      kstdataplugin.h  
 M  +3 -3      kstdatasource.cpp  
 M  +2 -2      kstdebug.cpp  
 M  +1 -3      kstmatrix.cpp  
 M  +2 -2      kstrmatrix.cpp  
 M  +3 -3      kstrvector.cpp  
 M  +1 -3      kstscalar.cpp  
 M  +1 -3      kststring.cpp  
 M  +2 -6      kstvector.cpp  


--- branches/work/kst/portto4/kst/src/libkst/kstdataplugin.h #637886:637887
@@ -93,13 +93,13 @@
         QString libname = QFile::encodeName((!isDataObject ? QString("kstdata_") : QString()) + _plugLib);
         _lib = KLibLoader::self()->library(libname.toLatin1().constData());
         if (!_lib) {
-          KstDebug::self()->log(i18n("Error loading data plugin [%1]: %2").arg(libname).arg(KLibLoader::self()->lastErrorMessage()), KstDebug::Error);
+          KstDebug::self()->log(i18n("Error loading data plugin [%1]: %2", libname, KLibLoader::self()->lastErrorMessage()), KstDebug::Error);
           return false;
         }
 
         if (key() != (isDataObject ? KST_CURRENT_DATAOBJECT_KEY : KST_CURRENT_DATASOURCE_KEY)) {
-          KstDebug::self()->log(i18n("Error loading data plugin [%1]: %2").arg(libname).arg(i18n("Plugin is too old and needs to be recompiled.")), KstDebug::Error);
-          KstDebug::self()->log(i18n("Error loading data plugin key = [%1]: %2").arg(key()).arg(QString(QFile::encodeName("key_" + _plugLib))), KstDebug::Error);
+          KstDebug::self()->log(i18n("Error loading data plugin [%1]: %2", libname, i18n("Plugin is too old and needs to be recompiled.")), KstDebug::Error);
+          KstDebug::self()->log(i18n("Error loading data plugin key = [%1]: %2", key(), QString(QFile::encodeName("key_" + _plugLib))), KstDebug::Error);
           return false;
         }
         return true;
@@ -248,7 +248,7 @@
             return cw;
           }
           if (rc) {
-            KstDebug::self()->log(i18n("Error in plugin %1: Configuration widget is of the wrong type.").arg(service->property("Name").toString()), KstDebug::Error);
+            KstDebug::self()->log(i18n("Error in plugin %1: Configuration widget is of the wrong type.", service->property("Name").toString()), KstDebug::Error);
             delete rc;
           }
         }
--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.cpp #637886:637887
@@ -295,7 +295,7 @@
     return w;
   }
 
-  KstDebug::self()->log(i18n("Could not find a datasource for '%1'(%2), but we found one just prior.  Something is wrong with Kst.").arg(filename).arg(type), KstDebug::Error);
+  KstDebug::self()->log(i18n("Could not find a datasource for '%1'(%2), but we found one just prior.  Something is wrong with Kst.", filename, type), KstDebug::Error);
   return 0L;
 }
 
@@ -420,12 +420,12 @@
     shortFilename.truncate(shortFilename.length() - 1);
   }
   shortFilename = shortFilename.section('/', -1);
-  QString tn = i18n("DS-%1").arg(shortFilename);
+  QString tn = i18n("DS-%1", shortFilename);
   int count = 1;
 
   KstObject::setTagName(KstObjectTag(tn, KstObjectTag::globalTagContext));  // are DataSources always top-level?
   while (KstData::self()->dataSourceTagNameNotUnique(tagName(), false)) {
-    KstObject::setTagName(KstObjectTag(tn + QString("-%1").arg(count++), KstObjectTag::globalTagContext));  // are DataSources always top-level?
+    KstObject::setTagName(KstObjectTag(tn + QString::number(-(count++)), KstObjectTag::globalTagContext));  // are DataSources always top-level?
   }
 
   _numFramesScalar = new KstScalar(KstObjectTag("frames", tag()));
--- branches/work/kst/portto4/kst/src/libkst/kstdebug.cpp #637886:637887
@@ -133,10 +133,10 @@
 
 QString KstDebug::text() {
   QMutexLocker ml(&_lock);
-  QString body = i18n("Kst version %1\n\n\nKst log:\n").arg(KSTVERSION);
+  QString body = i18n("Kst version %1\n\n\nKst log:\n", QString::fromLatin1(KSTVERSION));
 
   for (int i = 0; i < _messages.count(); i++ ) {
-    body += i18nc("date leveltext: message", "%1 %2: %3\n").arg(KGlobal::locale()->formatDateTime(_messages[i].date)).arg(label(_messages[i].level)).arg(_messages[i].msg);
+    body += i18nc("date leveltext: message", "%1 %2: %3\n", KGlobal::locale()->formatDateTime(_messages[i].date), label(_messages[i].level), _messages[i].msg);
   }
 
   body += i18n("\n\nData-source plugins:");
--- branches/work/kst/portto4/kst/src/libkst/kstmatrix.cpp #637886:637887
@@ -52,10 +52,8 @@
 
   QString _tag = in_tag.tag();
   if (!in_tag.isValid()) {
-    QString nt = i18n("Anonymous Matrix %1");
-
     do {
-      _tag = nt.arg(anonymousMatrixCounter++);
+      _tag = i18n("Anonymous Matrix %1", anonymousMatrixCounter++);
     } while (KstData::self()->matrixTagNameNotUnique(_tag, false));
     KstObject::setTagName(KstObjectTag(_tag, in_tag.context()));
   } else {
--- branches/work/kst/portto4/kst/src/libkst/kstrmatrix.cpp #637886:637887
@@ -539,7 +539,7 @@
   _editable = true;
 
   if (!_file) {
-    KstDebug::self()->log(i18n("Data file for matrix %1 was not opened.").arg(tagName()), KstDebug::Warning);
+    KstDebug::self()->log(i18n("Data file for matrix %1 was not opened.", tagName()), KstDebug::Warning);
   } else {
     _samplesPerFrameCache = _file->samplesPerFrame(_field);
   }
@@ -589,7 +589,7 @@
   Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);
 
   if (!file) {
-    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.").arg(tagName()), KstDebug::Warning);
+    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.", tagName()), KstDebug::Warning);
   }
   _file = file;
   if (_file) {
--- branches/work/kst/portto4/kst/src/libkst/kstrvector.cpp #637886:637887
@@ -168,7 +168,7 @@
   _dirty = true;
 
   if (!in_file) {
-    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.").arg(tagName()), KstDebug::Warning);
+    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.", tagName()), KstDebug::Warning);
   }
 }
 
@@ -215,7 +215,7 @@
   Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);
 
   if (!in_file) {
-    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.").arg(tagName()), KstDebug::Warning);
+    KstDebug::self()->log(i18n("Data file for vector %1 was not opened.", tagName()), KstDebug::Warning);
   }
   _file = in_file;
   if (_file) {
@@ -383,7 +383,7 @@
   if (ok && _file) {
     _file->readLock();
     if (_file->fileType() == "ASCII") {
-      label = i18n("Column %1").arg(_field);
+      label = i18n("Column %1", _field);
     } else {
       label = _field;
     }
--- branches/work/kst/portto4/kst/src/libkst/kstscalar.cpp #637886:637887
@@ -45,10 +45,8 @@
 : KstPrimitive(provider), _value(val), _orphan(orphan), _displayable(displayable), _editable(editable) {
   QString _tag = in_tag.tag();
   if (_tag.isEmpty()) {
-    QString nt = i18n("Anonymous Scalar %1");
-
     do {
-      _tag = nt.arg(iAnonymousScalarCounter++);
+      _tag = i18n("Anonymous Scalar %1", iAnonymousScalarCounter++);
     } while (KstData::self()->vectorTagNameNotUniqueInternal(_tag));  // FIXME: why vector?
     KstObject::setTagName(KstObjectTag(_tag, in_tag.context()));
   } else {
--- branches/work/kst/portto4/kst/src/libkst/kststring.cpp #637886:637887
@@ -28,10 +28,8 @@
 : KstPrimitive(provider), _value(val), _orphan(orphan), _editable(false) {
   QString _tag = in_tag.tag();
   if (!in_tag.isValid()) {
-    QString nt = i18n("Anonymous String %1");
-
     do {
-      _tag = nt.arg(anonymousStringCounter++);
+      _tag = i18n("Anonymous String %1", anonymousStringCounter++);
     } while (KstData::self()->vectorTagNameNotUniqueInternal(_tag));  // FIXME: why vector?
     KstObject::setTagName(KstObjectTag(_tag, in_tag.context()));
   } else {
--- branches/work/kst/portto4/kst/src/libkst/kstvector.cpp #637886:637887
@@ -58,10 +58,8 @@
   }
 
   if (!in_tag.isValid()) {
-    QString nt = i18n("Anonymous Vector %1");
-
     do {
-      KstObject::setTagName(KstObjectTag(nt.arg(anonymousVectorCounter++), in_tag.context()));
+      KstObject::setTagName(KstObjectTag(i18n("Anonymous Vector %1", anonymousVectorCounter++), in_tag.context()));
     } while (KstData::self()->vectorTagNameNotUnique(tagName(), false));
   } else {
     KstObject::setTagName(KST::suggestUniqueVectorTag(in_tag));
@@ -118,10 +116,8 @@
   }
 
   if (!in_tag.isValid()) {
-    QString nt = i18n("Anonymous Vector %1");
-
     do {
-      KstObject::setTagName(KstObjectTag(nt.arg(anonymousVectorCounter++), in_tag.context()));
+      KstObject::setTagName(KstObjectTag(i18n("Anonymous Vector %1", anonymousVectorCounter++), in_tag.context()));
     } while (KstData::self()->vectorTagNameNotUnique(tagName(), false));
   } else {
     KstObject::setTagName(KST::suggestUniqueVectorTag(in_tag));


More information about the Kst mailing list