[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Kivio: char string to a QString
From:       Jon de =?iso-8859-1?q?Andr=E9s?= <jondeandres () terra ! es>
Date:       2007-02-19 23:46:58
Message-ID: 200702200046.58573.jondeandres () terra ! es
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi!
We can read in http://www.englishbreakfastnetwork.org/krazy/reports/bundled-apps/koffice/kivio/index.html \
: "Adding single characters to a QString is faster if the characters are QChars and \
not QStrings. For example: QString path = oldpath + "/" + base is better written as \
QString path = oldpath + '/' + base" Is that correct? It's better  + "/" than + '/'   \
?. I thought that + operator used a QString for "/" and a QChar for '/'. Anyway, i've \
"fixed", or perhaps not, those "/" with '/' and I send the patch, I don't really know \
if it is good fixed...

Bye.
-- Jon de Andr閟 Fr韆s


[Attachment #5 (text/html)]

<html><head><meta name="qrichtext" content="1" /></head><body \
style="font-size:7pt;font-family:Sans Serif"> <p>Hi!</p>
<p>We can read in http://www.englishbreakfastnetwork.org/krazy/reports/bundled-apps/koffice/kivio/index.html \
:</p> <p>&quot;Adding single characters to a QString is faster if the characters are \
QChars and not QStrings. For example: QString path = oldpath + &quot;/&quot; + base \
is better written as QString path = oldpath + '/' + base&quot;</p> <p>Is that \
correct? It's better  <span style="font-style:italic">+ &quot;/&quot;</span> than \
<span style="font-style:italic">+ '/'   </span>?. I thought that + operator used a \
QString for &quot;/&quot; and a QChar for '/'.</p> <p>Anyway, i've &quot;fixed&quot;, \
or perhaps not, those &quot;/&quot; with '/' and I send the patch, I don't really \
know if it is good fixed...</p> <p></p>
<p>Bye.</p>
<p>-- Jon de Andr閟 Fr韆s</p>
<p></p>
</body></html>


["SingleCharstringToQStringInKivio.patch" (text/x-diff)]

Index: kivio/kiviopart/kiviostencilsetaction.cpp
===================================================================
--- kivio/kiviopart/kiviostencilsetaction.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/kiviostencilsetaction.cpp	(copia de trabajo)
@@ -227,7 +227,7 @@ void KivioStencilSetAction::loadCollecti
         ch = m_collectionMenuList[index];
       }
     
-      loadSet( ch, rootDirStr + "/" + colFInfo->fileName() );
+      loadSet( ch, rootDirStr + '/' + colFInfo->fileName() );
     }
     
     ++colIt;
@@ -251,7 +251,7 @@ void KivioStencilSetAction::loadSet( KMe
     {
       menu->insertItem(QIcon(dirtPixmap(setFInfo->absoluteFilePath())),
         KivioStencilSpawnerSet::readTitle(setFInfo->absoluteFilePath()),m_ssId);
-      m_pathList.insert( m_ssId, new QString(rootDirStr + "/" + setFInfo->fileName()) );
+      m_pathList.insert( m_ssId, new QString(rootDirStr + '/' + setFInfo->fileName()) );
       m_ssId++;
     }
     ++setIt;
Index: kivio/kiviopart/kivio_doc.cpp
===================================================================
--- kivio/kiviopart/kivio_doc.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/kivio_doc.cpp	(copia de trabajo)
@@ -205,7 +205,7 @@ bool KivioDoc::initDoc(InitDocFlags flag
     return ok;
   } else if ( ret == KoTemplateChooseDia::Template ) {
     QFileInfo fileInfo( f );
-    QString fileName( fileInfo.dirPath(true) + "/" + fileInfo.baseName() + ".kft" );
+    QString fileName( fileInfo.dirPath(true) + '/' + fileInfo.baseName() + ".kft" );
     resetURL();
     bool ok = loadNativeFormat( fileName );
     if ( !ok )
@@ -791,7 +791,7 @@ void KivioDoc::addSpawnerSetDuringLoad(c
   QStringList files = set->files();
 
   for(it = files.begin(); it != files.end(); ++it) {
-    QString fileName = set->dir() + "/" + (*it);
+    QString fileName = set->dir() + '/' + (*it);
     set->loadFile(fileName);
   }
 
@@ -1001,7 +1001,7 @@ void KivioDoc::updateProtectPanelCheckBo
 void KivioDoc::loadStencil()
 {
   KivioStencilSpawnerSet* set = m_stencilSetLoadQueue.first();
-  QString fileName = set->dir() + "/" + set->files()[m_currentFile];
+  QString fileName = set->dir() + '/' + set->files()[m_currentFile];
   set->loadFile(fileName);
   m_currentFile++;
   emit progress(qRound(((float)m_currentFile / (float)set->files().count()) * 100.0));
Index: kivio/kiviopart/kiviostencilsetinstaller.cpp
===================================================================
--- kivio/kiviopart/kiviostencilsetinstaller.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/kiviostencilsetinstaller.cpp	(copia de trabajo)
@@ -140,7 +140,7 @@ namespace Kivio {
         continue;
       }
 
-      currentDir->copyTo(installDir + "/" + currentDir->name());
+      currentDir->copyTo(installDir + '/' + currentDir->name());
     }
 
     return ok;
Index: kivio/kiviopart/kivio_spawner_drag.cpp
===================================================================
--- kivio/kiviopart/kivio_spawner_drag.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/kivio_spawner_drag.cpp	(copia de trabajo)
@@ -76,7 +76,7 @@ void KivioSpawnerDrag::append( const QIc
 {
     QIconDrag::append( item, pr, tr );
 
-    QString full = spawner.set()->dir() + "/" + spawner.info()->title();
+    QString full = spawner.set()->dir() + '/' + spawner.info()->title();
     
     kDebug(43000) << "KivioSpawnerDrag::append() - Adding " << full << endl;
 
Index: kivio/kiviopart/kivio_icon_view.cpp
===================================================================
--- kivio/kiviopart/kivio_icon_view.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/kivio_icon_view.cpp	(copia de trabajo)
@@ -156,7 +156,7 @@ QDragObject *KivioIconView::dragObject()
 
   QIconDragItem id;
   QString full;
-  full = item->spawner()->set()->dir() + "/" + item->spawner()->info()->title();
+  full = item->spawner()->set()->dir() + '/' + item->spawner()->info()->title();
   id.setData( QCString(full.ascii()));
 
   drag->append( id,
Index: kivio/kiviopart/ui/kiviooptionsdialog.cpp
===================================================================
--- kivio/kiviopart/ui/kiviooptionsdialog.cpp	(revisi贸n: 635309)
+++ kivio/kiviopart/ui/kiviooptionsdialog.cpp	(copia de trabajo)
@@ -324,7 +324,7 @@ void KivioOptionsDialog::setMaxVertSnap(
 
 void KivioOptionsDialog::setFontText(const QFont& f)
 {
-  QString txt = f.family() + " " + QString::number(f.pointSize());
+  QString txt = f.family() + ' ' + QString::number(f.pointSize());
   m_fontTxtLbl->setText(txt);
 }
 


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic