diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp
index 51fb45b54d37aed4d743ab39d2fe8f9c5a323a31..cb12e6ea42054e93af1db38d8f563f754164f391 100644
--- a/src/qdoc/location.cpp
+++ b/src/qdoc/location.cpp
@@ -463,11 +463,8 @@ QString Location::toString() const
 
 QString Location::top() const
 {
-    QString str = filePath();
-    if (!QDir::isAbsolutePath(str)) {
-        QDir path(str);
-        str = path.absolutePath();
-    }
+    QDir path(filePath());
+    QString str = path.absolutePath();
     if (lineNo() >= 1) {
         str += QLatin1Char(':');
         str += QString::number(lineNo());