[Uml-devel] KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser

Andi Fischer andi.fischer at hispeed.ch
Mon Apr 13 11:27:17 UTC 2009


SVN commit 953088 by fischer:

Compiler warning fixed in urlutil by replacing the old method with QDir::canonocalPath.

 M  +2 -1      cpptree2uml.cpp  
 M  +0 -18     urlutil.cpp  
 M  +0 -6      urlutil.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp #953087:953088
@@ -35,7 +35,8 @@
 CppTree2Uml::CppTree2Uml( const QString& fileName)
     : m_anon( 0 ), m_nsCnt( 0 ), m_clsCnt( 0 )
 {
-    m_fileName = URLUtil::canonicalPath(fileName);
+    QDir dir(fileName);
+    m_fileName = dir.canonicalPath();
 }
 
 CppTree2Uml::~CppTree2Uml()
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp #953087:953088
@@ -244,24 +244,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-// code from qt-3.1.2 version of QDir::canonicalPath()
-QString URLUtil::canonicalPath(const QString & path)
-{
-    QString r;
-    char cur[PATH_MAX+1];
-    if (::getcwd(cur, PATH_MAX)) {
-        char tmp[PATH_MAX+1];
-        if (::realpath(QFile::encodeName(path), tmp)) {
-            r = QFile::decodeName(tmp);
-        }
-        //always make sure we go back to the current dir
-        ::chdir(cur);
-    }
-    return r;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
 //written by "Dawit A." <adawit at kde.org>
 //borrowed from his patch to KShell
 QString URLUtil::envExpand(const QString& str)
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/urlutil.h #953087:953088
@@ -120,12 +120,6 @@
 void dump(const KUrl::List &urls, const QString &aMessage = QString());
 
 /**
- * Same as QDir::canonicalPath in later versions of QT. Earlier versions of QT
- * had this broken, so it's reproduced here.
- */
-QString canonicalPath(const QString & path);
-
-/**
  * Performs environment variable expansion on @p variable.
  *
  * @param variable the string with the environment variable to expand.




More information about the umbrello-devel mailing list