diff options
author | Morten Sorvig <morten.sorvig@nokia.com> | 2010-01-24 23:17:40 -0600 |
---|---|---|
committer | Morten Sorvig <morten.sorvig@nokia.com> | 2010-01-24 23:17:40 -0600 |
commit | 87faa52b7a9d8ccb1ffbe86b02ecab7169c61f36 (patch) | |
tree | 0d00e0fb5972a9ad00b1c73b890247f22357c00f | |
parent | edf9e7e4f27986d399c53cda53fc618792048941 (diff) |
Use relative paths.
-rw-r--r-- | tools/nacldemoserver/httpserver.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/nacldemoserver/httpserver.cpp b/tools/nacldemoserver/httpserver.cpp index 3e318e37e7..d0500930b0 100644 --- a/tools/nacldemoserver/httpserver.cpp +++ b/tools/nacldemoserver/httpserver.cpp @@ -220,7 +220,7 @@ QByteArray Server::htmlForPath(QString path) foreach (const QString &rootPath, rootPaths) { QDir dir(rootPath); QString name = dir.dirName(); - html.append("<a href=\"http://localhost:3001/" + name + "/\">" + name + "</a><br>"); + html.append("<a href=./" + name + "/>" + name + "</a><br>"); } return html; @@ -299,8 +299,10 @@ QString Server::findCanonicalPath(QString path) qDebug() << "rootPathCandidate" << rootPathCandidate; qDebug() << "subPath" << subPath; foreach (const QString &rootPath, rootPaths) { + qDebug() << "test" << rootPath << QDir(rootPath).dirName() << rootPathCandidate ; if (QDir(rootPath).dirName() == rootPathCandidate){ QString canonicalPathCandidate = QDir(rootPath + subPath).canonicalPath(); + qDebug() << "canonicalPathCandidate" << canonicalPathCandidate; if (QDir().exists(canonicalPathCandidate)) canonicalPath = canonicalPathCandidate; } @@ -319,7 +321,8 @@ QByteArray Server::htmlLinksForPath(QString canonicalPath, QString path) if (path.endsWith('/') == false) path.append("/"); - html.append("<a href=\"http://localhost:3001/" + path + "../\">..</a><br>"); + qDebug() << "link path is" << path; + html.append("<a href=../>..</a><br>"); QDirIterator it(canonicalPath); while (it.hasNext()) { @@ -335,7 +338,8 @@ QByteArray Server::htmlLinksForPath(QString canonicalPath, QString path) ) { QDir dir(it.filePath()); QString name = dir.dirName(); - html.append("<a href=\"http://localhost:3001/" + path + name + "\">" + name + "</a><br>"); + qDebug() << "payh is" << path; + html.append("<a href=" + name + "/>" + name + "</a><br>"); } } |