Changeset 363


Ignore:
Timestamp:
Nov 30, 2009, 6:52:30 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

global: Reverted r355, r356, r361, r362 (see #78).

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/cachekeys.h

    r362 r363  
    4848#include <qfile.h>
    4949#include <qfileinfo.h>
    50 #include <qdir.h>
    5150#include <qhash.h>
    5251
     
    108107            return true;
    109108
    110 #ifdef Q_OS_OS2
    111         return QDir::isRelativePath(file);
    112 #else
    113109        const QChar c0 = file.at(0);
    114110        const QChar c1 = length >= 2 ? file.at(1) : QChar(0);
     
    118114                || (c0 == QLatin1Char('/') && c1 == QLatin1Char('/'))
    119115                || (c0 == QLatin1Char('\\') && c1 == QLatin1Char('\\')));
    120 #endif   
    121116    }
    122117};
  • trunk/qmake/generators/makefile.cpp

    r362 r363  
    125125    }
    126126    bool ret = true;
    127 #if defined(Q_OS_WIN)
     127#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    128128    bool driveExists = true;
    129129    if(!QDir::isRelativePath(path)) {
     
    138138    }
    139139    if(driveExists)
    140 #elif defined(Q_OS_OS2)
    141     path = QFileInfo(path).absoluteFilePath();
    142     QString drv = path.left(3);
    143     if (!QFile::exists(drv))
    144         warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
    145                  drv.toLocal8Bit().data(), path.toLocal8Bit().data());
    146     else
    147140#endif
    148141    {
     
    348341                        vpath += Option::output_dir;
    349342                }
    350                 foreach(const QString &vp, vpath) {
    351                     QString real_val = QDir(vp).absoluteFilePath(val);
    352                     if (exists(real_val)) {
    353                         val = real_val;
     343                for(QStringList::Iterator vpath_it = vpath.begin();
     344                    vpath_it != vpath.end(); ++vpath_it) {
     345                    QString real_dir = Option::fixPathToLocalOS((*vpath_it));
     346                    if(exists(real_dir + QDir::separator() + val)) {
     347                        QString dir = (*vpath_it);
     348                        if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
     349                            dir += Option::dir_sep;
     350                        val = dir + val;
    354351                        if(!(flags & VPATH_NoFixify))
    355352                            val = fileFixify(val);
     
    853850                    file = libinfo.first("QMAKE_PRL_TARGET");
    854851                    if(QDir::isRelativePath(file))
    855                         file = QDir(dir).absoluteFilePath(file);
     852                        file.prepend(dir);
    856853                }
    857854            }
     
    27372734}
    27382735
    2739 inline static bool pathEquals(const QString &path1, const QString &path2)
    2740 {
    2741 #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    2742     return path1.compare(path2, Qt::CaseInsensitive) == 0;
    2743 #else
    2744     return path1 == path2;
    2745 #endif
    2746 }
    2747 
    2748 inline static bool pathStartsWith(const QString &path1, const QString &path2)
    2749 {
    2750 #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
    2751     return path1.toLower().startsWith(path2.toLower());
    2752 #else
    2753     return path1.startsWith(path2);
    2754 #endif
    2755 }
    2756 
    27572736QString
    27582737MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const QString &in_d,
     
    27852764    if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
    27862765        if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute
    2787             ret = QDir(pwd).absoluteFilePath(ret);
     2766            ret.prepend(pwd);
    27882767        ret = Option::fixPathToTargetOS(ret, false, canon);
    27892768    } else { //fix it..
     
    28032782        if(out_dir != in_dir || !qfileinfo.isRelative()) {
    28042783            if(qfileinfo.isRelative()) {
    2805                 ret = QDir(in_dir).absoluteFilePath(qfile);
     2784                ret = in_dir + "/" + qfile;
    28062785                qfileinfo.setFile(ret);
    28072786            }
    28082787            ret = Option::fixPathToTargetOS(ret, false, canon);
    28092788            if(canon && qfileinfo.exists() &&
    2810                pathEquals(file, Option::fixPathToTargetOS(ret, true, canon)))
     2789               file == Option::fixPathToTargetOS(ret, true, canon))
    28112790                ret = Option::fixPathToTargetOS(qfileinfo.canonicalFilePath());
    28122791            QString match_dir = Option::fixPathToTargetOS(out_dir, false, canon);
    2813             if(pathEquals(ret, match_dir)) {
     2792            if(ret == match_dir) {
    28142793                ret = "";
    2815             } else if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
     2794            } else if(ret.startsWith(match_dir + Option::dir_sep)) {
    28162795                ret = ret.mid(match_dir.length() + Option::dir_sep.length());
    28172796            } else {
     
    28342813                    if(match_dir.isEmpty())
    28352814                        break;
    2836                     if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
     2815                    if(ret.startsWith(match_dir + Option::dir_sep)) {
    28372816                        //concat
    28382817                        int remlen = ret.length() - (match_dir.length() + 1);
     
    30253004        if(!file.fileName().isEmpty()) {
    30263005            if(QDir::isRelativePath(file.fileName()))
    3027                 file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
     3006                file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
    30283007            QFileInfo fi(fileInfo(file.fileName()));
    30293008            if(fi.isDir())
     
    30383017    }
    30393018    if(QDir::isRelativePath(file.fileName())) {
    3040         file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
     3019        QString fname = Option::output_dir;  //pwd when qmake was run
     3020        if(!fname.endsWith("/"))
     3021            fname += "/";
     3022        fname += file.fileName();
     3023        file.setFileName(fname);
    30413024    }
    30423025    if(!build.isEmpty())
     
    30563039        od = Option::fixPathToTargetOS(od);
    30573040        if(QDir::isRelativePath(od))
    3058             od = QDir(Option::output_dir).absoluteFilePath(od);
     3041            od.prepend(Option::output_dir);
    30593042        Option::output_dir = od;
    30603043        return true;
  • trunk/qmake/generators/makefiledeps.cpp

    r362 r363  
    625625                    if(try_local) {
    626626                        QString dir = findFileInfo(file->file).path();
    627                         QMakeLocalFileName f(QDir(dir).absoluteFilePath(lfn.local()));
     627                        if(QDir::isRelativePath(dir))
     628                            dir.prepend(qmake_getpwd() + "/");
     629                        if(!dir.endsWith("/"))
     630                            dir += "/";
     631                        QMakeLocalFileName f(dir + lfn.local());
    628632                        if(findFileInfo(f).exists()) {
    629633                            lfn = fixPathForFile(f);
     
    632636                    }
    633637                    if(!exists) { //path lookup
    634                         foreach(const QMakeLocalFileName &dd, depdirs) {
    635                             QMakeLocalFileName f(QDir(dd.real()).absoluteFilePath(lfn.real()));
     638                        for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
     639                            QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
    636640                            QFileInfo fi(findFileInfo(f));
    637641                            if(fi.exists() && !fi.isDir()) {
  • trunk/qmake/generators/metamakefile.cpp

    r362 r363  
    325325            sub->input_dir = subdir.absolutePath();
    326326            if(subdir.isRelative() && old_output_dir != oldpwd) {
    327                 sub->output_dir = QDir(old_output_dir).absoluteFilePath(subdir.path());
     327                sub->output_dir = old_output_dir + "/" + subdir.path();
    328328                printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
    329329            } else { //what about shadow builds?
  • trunk/qmake/generators/win32/winmakefile.cpp

    r362 r363  
    246246                        tmp = opt;
    247247                    for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
    248                         QString prl = QDir((*it).local()).absoluteFilePath(tmp);
     248                        QString prl = (*it).local() + Option::dir_sep + tmp;
    249249                        // the original is used as the key
    250250                        QString orgprl = prl;
  • trunk/qmake/main.cpp

    r362 r363  
    127127            Option::output_dir = dir;
    128128        if(QDir::isRelativePath(Option::output_dir))
    129             Option::output_dir = QDir(oldpwd).absoluteFilePath(Option::output_dir);
     129            Option::output_dir.prepend(oldpwd);
    130130        Option::output_dir = QDir::cleanPath(Option::output_dir);
    131131    }
  • trunk/qmake/meta.cpp

    r362 r363  
    163163                        QString targ = dirs[i] + (*lst_it);
    164164                        if(QDir::isRelativePath(targ))
    165                             targ = QDir(qmake_getpwd()).absoluteFilePath(targ);
     165                            targ.prepend(qmake_getpwd() + QDir::separator());
    166166                        vars["QMAKE_PRL_TARGET"] << targ;
    167167                        found = true;
  • trunk/qmake/project.cpp

    r362 r363  
    14571457                if (QFile::exists(qmakespec+"/qmake.conf")) {
    14581458                    Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath();
     1459                } else if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) {
     1460                    qmakespec = Option::mkfile::qmakespec = QFileInfo(Option::output_dir+"/"+qmakespec).absoluteFilePath();
    14591461                } else {
    1460                     QString tmp = QDir(Option::output_dir).absoluteFilePath(qmakespec);
    1461                     if (QFile::exists(tmp+"/qmake.conf"))
    1462                         qmakespec = Option::mkfile::qmakespec = tmp;
    1463                     else {
    1464                         bool found_mkspec = false;
    1465                         foreach(const QString &root, mkspec_roots) {
    1466                             QString mkspec = QDir(root).absoluteFilePath(qmakespec);
    1467                             if(QFile::exists(mkspec)) {
    1468                                 found_mkspec = true;
    1469                                 Option::mkfile::qmakespec = qmakespec = mkspec;
    1470                                 break;
    1471                             }
     1462                    bool found_mkspec = false;
     1463                    for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) {
     1464                        QString mkspec = (*it) + QDir::separator() + qmakespec;
     1465                        if(QFile::exists(mkspec)) {
     1466                            found_mkspec = true;
     1467                            Option::mkfile::qmakespec = qmakespec = mkspec;
     1468                            break;
    14721469                        }
    1473                         if(!found_mkspec) {
    1474                             fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
    1475                                     qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
    1476                             return false;
    1477                         }
     1470                    }
     1471                    if(!found_mkspec) {
     1472                        fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
     1473                                qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
     1474                        return false;
    14781475                    }
    14791476                }
     
    17781775            include_roots << qmake_getpwd();
    17791776        include_roots << Option::output_dir;
    1780         foreach(const QString &root, include_roots) {
    1781             QString testName = QDir(root).absoluteFilePath(file);
     1777        for(int root = 0; root < include_roots.size(); ++root) {
     1778            QString testName = QDir::toNativeSeparators(include_roots[root]);
     1779            if (!testName.endsWith(QString(QDir::separator())))
     1780                testName += QDir::separator();
     1781            testName += file;
    17821782            if(QFile::exists(testName)) {
    17831783                file = testName;
  • trunk/src/corelib/io/qdir.cpp

    r355 r363  
    732732{
    733733    Q_D(const QDir);
    734 
    735 #ifdef Q_OS_OS2
    736 
    737     if (isAbsolutePath(fileName) || !d->data->fileEngine)
    738         return QDir::fromNativeSeparators(fileName);
    739 
    740     // On OS/2, paths like "A:bbb.txt" and "\ccc.dat" are not absolute and
    741     // therefore require special processing here
    742     QString ret;
    743     if (isRelativePath(d->data->path)) {
    744         if (d->data->path.startsWith(QLatin1Char('/')) ||
    745             (d->data->path.length() >= 2 &&
    746              d->data->path.at(0).isLetter() && d->data->path.at(1) == QLatin1Char(':'))) {
    747             ret = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
    748         } else {
    749 #ifndef QT_NO_FSFILEENGINE
    750             //get pwd
    751             ret = QFSFileEngine::currentPath(fileName);
    752 #endif
    753             if(!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {
    754                 if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
    755                     ret += QLatin1Char('/');
    756                 ret += d->data->path;
    757             }
    758         }
    759     } else {
    760         ret = d->data->path;
    761     }
    762     if (!fileName.isEmpty()) {
    763         QString fn = QDir::fromNativeSeparators(fileName);
    764         if (fn.length() >= 2 &&
    765             fn.at(0).isLetter() && fn.at(1) == QLatin1Char(':')) {
    766             ret = QFileInfo(fn).absoluteFilePath();
    767         } else {
    768             if (fn.startsWith(QLatin1Char('/')) && !ret.isEmpty())
    769                 ret = ret.left(2); // take the drive name
    770             else if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
    771                 ret += QLatin1Char('/'); // append the missing slash
    772             ret += fn;
    773         }
    774     }
    775     return ret;
    776 
    777 #else // #ifdef Q_OS_OS2
    778 
    779734    if (isAbsolutePath(fileName))
    780735        return fileName;
     
    798753    }
    799754    return ret;
    800 
    801 #endif // #ifdef Q_OS_OS2
    802755}
    803756
  • trunk/src/corelib/io/qfileinfo.cpp

    r355 r363  
    586586    drive letter, except for network shares that are not mapped to a
    587587    drive letter, in which case the path will begin '//sharename/'.
    588     QFileInfo will uppercase drive letters. Note that QDir does not
    589     normally do this. The code snippet below shows this.
     588    QFileInfo will uppercase drive letters. Note that QDir does not do
     589    this. The code snippet below shows this.
    590590
    591591    \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp newstuff
  • trunk/src/corelib/io/qfsfileengine_os2.cpp

    r361 r363  
    650650static bool isRelativePath(const QString &path)
    651651{
    652         // On OS/2, "A:bbb.txt" and "/ccc.dat" are relative paths
    653     return !(path.startsWith(QLatin1String("//")) ||
    654              (path.length() >= 2 && path.at(0).isLetter() &&
    655               path.at(1) == QLatin1Char(':') &&
    656               // we treat "D:" as absolute while "D:aaa" as relative
    657               (path.length() == 2 || path.at(2) == QLatin1Char('/'))));
     652    return !(path.startsWith(QLatin1Char('/'))
     653        || (path.length() >= 2
     654        && ((path.at(0).isLetter() && path.at(1) == QLatin1Char(':'))
     655        || (path.at(0) == QLatin1Char('/') && path.at(1) == QLatin1Char('/')))));                // drive, e.g. a:
    658656}
    659657
     
    688686    } else if(file == AbsoluteName || file == AbsolutePathName) {
    689687        QString ret;
    690         if (isRelativePath()) {
    691             if ((d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':') &&
    692                  d->filePath.at(2) != QLatin1Char('/')) ||    // path relative to the current dir of the given drive, so Z:a.txt -> Z:\currentpath\a.txt
    693                 (d->filePath.startsWith(QLatin1Char('/')))) { // path relative to the root of the current drive, so \a.txt -> Z:\a.txt
     688
     689        if (!isRelativePath()) {
     690            if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':')
     691                && d->filePath.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
     692                d->filePath.startsWith(QLatin1Char('/'))    // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
     693                ) {
    694694                char buf[PATH_MAX+1];
    695695                strcpy(buf, QFile::encodeName(d->filePath).constData());
    696696                _abspath(buf, buf, sizeof(buf));
    697                 ret = QDir::cleanPath(QFile::decodeName(buf));
    698                 if (::isRelativePath(ret)) {
    699                     // still relative, this means we have "Z:aaa" but there is no such drive Z:
    700                     // just assume root is the current dir on Z:
    701                     Q_ASSERT(ret.at(1) == QLatin1Char(':'));
    702                     ret.insert(2, QLatin1Char('/'));
    703                 }
     697                ret = QFile::decodeName(buf);
    704698            } else {
    705                 ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
     699                ret = d->filePath;
    706700            }
    707701        } else {
    708             ret = d->filePath;
     702            ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
    709703        }
    710704
    711705        // The path should be absolute at this point.
    712         // On OS/2, the absolute path always contains a "X:/" at the begining
    713         // where X is the drive letter, or "//" if it's a network share
    714         if (!ret.startsWith(QLatin1String("//"))) {
     706        // From the docs :
     707        // Absolute paths begin with the directory separator "/"
     708        // (optionally preceded by a drive specification under Windows).
     709        if (ret.at(0) != QLatin1Char('/')) {
    715710            Q_ASSERT(ret.length() >= 2);
    716711            Q_ASSERT(ret.at(0).isLetter());
    717712            Q_ASSERT(ret.at(1) == QLatin1Char(':'));
    718             if (ret.length() == 2) {
    719                 // we are missing the slash in the "drive root dir" case, append it
    720                 ret += QLatin1Char('/');
    721             } else {
    722                 Q_ASSERT(ret.at(2) == QLatin1Char('/'));
    723             }
    724713
    725714            // Force uppercase drive letters.
     
    729718        if (file == AbsolutePathName) {
    730719            int slash = ret.lastIndexOf(QLatin1Char('/'));
    731             if (!ret.startsWith(QLatin1String("//"))) {
    732                 Q_ASSERT(slash >= 2);
    733                 if (slash == 2)
    734                     ret = ret.left(3);  // include the slash if it's "X:/"
    735                 else
    736                     ret = ret.left(slash);
    737             } else {
    738                 Q_ASSERT(slash >= 1);
    739                 if (slash == 1)
    740                     ret = ret.left(3);  // include the slash if it's "//"
    741                 else
    742                     ret = ret.left(slash);
    743             }
     720            if (slash < 0)
     721                return ret;
     722            else if (ret.at(0) != QLatin1Char('/') && slash == 2)
     723                return ret.left(3);      // include the slash
     724            else
     725                return ret.left(slash > 0 ? slash : 1);
    744726        }
    745727        return ret;
     
    751733        if (!ret.isEmpty() && file == CanonicalPathName) {
    752734            int slash = ret.lastIndexOf(QLatin1Char('/'));
    753             if (!ret.startsWith(QLatin1String("//"))) {
    754                 Q_ASSERT(slash >= 2);
    755                 if (slash == 2)
    756                     ret = ret.left(3);  // include the slash if it's "X:/"
    757                 else
    758                     ret = ret.left(slash);
    759             } else {
    760                 Q_ASSERT(slash >= 1);
    761                 if (slash == 1)
    762                     ret = ret.left(3);  // include the slash if it's "//"
    763                 else
    764                     ret = ret.left(slash);
    765             }
     735            if (slash == -1)
     736                ret = QDir::currentPath();
     737            else if (slash == 0)
     738                ret = QLatin1String("/");
     739            ret = ret.left(slash);
    766740        }
    767741        return ret;
     
    774748                QString target = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(buf)));
    775749                QString ret;
    776                 if (::isRelativePath(target)) {
    777                     if ((target.size() > 2 && target.at(1) == QLatin1Char(':') &&
    778                          target.at(2) != QLatin1Char('/')) ||    // path relative to the current dir of the given drive, so Z:a.txt -> Z:\currentpath\a.txt
    779                         (target.startsWith(QLatin1Char('/')))) { // path relative to the root of the current drive, so \a.txt -> Z:\a.txt
     750                if (!::isRelativePath(target)) {
     751                    if (target.size() > 2 && target.at(1) == QLatin1Char(':')
     752                        && target.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
     753                        target.startsWith(QLatin1Char('/'))    // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
     754                        ) {
    780755                        char buf[PATH_MAX+1];
    781756                        strcpy(buf, QFile::encodeName(target).constData());
    782757                        _abspath(buf, buf, sizeof(buf));
    783                         ret = QDir::cleanPath(QFile::decodeName(buf));
    784                         if (::isRelativePath(ret)) {
    785                             // still relative, this means we have "Z:aaa" but there is no such drive Z:
    786                             // just assume root is the current dir on Z:
    787                             Q_ASSERT(ret.at(1) == QLatin1Char(':'));
    788                             ret.insert(2, QLatin1Char('/'));
    789                         }
     758                        ret = QFile::decodeName(buf);
    790759                    } else {
    791                         if (S_ISDIR(d->st.st_mode)) {
    792                             QDir parent(d->filePath);
    793                             parent.cdUp();
    794                             ret = parent.path();
    795                             if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
    796                                 ret += QLatin1Char('/');
    797                         }
    798                         ret += target;
    799 
    800                         if (::isRelativePath(ret)) {
    801                             if (!isRelativePath()) {
    802                                 ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
    803                                             + QLatin1Char('/'));
    804                             } else {
    805                                 ret.prepend(QDir::currentPath() + QLatin1Char('/'));
    806                             }
    807                         }
    808                         ret = QDir::cleanPath(ret);
    809                         if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
    810                             ret.chop(1);
     760                        ret = target;
    811761                    }
    812762                } else {
    813                     ret = target;
     763                    if (S_ISDIR(d->st.st_mode)) {
     764                        QDir parent(d->filePath);
     765                        parent.cdUp();
     766                        ret = parent.path();
     767                        if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
     768                            ret += QLatin1Char('/');
     769                    }
     770                    ret += target;
     771
     772                    if (::isRelativePath(ret)) {
     773                        if (!isRelativePath()) {
     774                            ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
     775                                        + QLatin1Char('/'));
     776                        } else {
     777                            ret.prepend(QDir::currentPath() + QLatin1Char('/'));
     778                        }
     779                    }
     780                    ret = QDir::cleanPath(ret);
     781                    if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
     782                        ret.chop(1);
    814783                }
    815784
    816 
    817785                // The path should be absolute at this point.
    818                 // On OS/2, the absolute path always contains a "X:/" at the begining
    819                 // where X is the drive letter, or "//" if it's a network share
    820                 if (!ret.startsWith(QLatin1String("//"))) {
     786                // From the docs :
     787                // Absolute paths begin with the directory separator "/"
     788                // (optionally preceded by a drive specification under Windows).
     789                if (ret.at(0) != QLatin1Char('/')) {
    821790                    Q_ASSERT(ret.length() >= 2);
    822791                    Q_ASSERT(ret.at(0).isLetter());
    823792                    Q_ASSERT(ret.at(1) == QLatin1Char(':'));
    824                     if (ret.length() == 2) {
    825                         // we are missing the slash in the "drive root dir" case, append it
    826                         ret += QLatin1Char('/');
    827                     } else {
    828                         Q_ASSERT(ret.at(2) == QLatin1Char('/'));
    829                     }
    830793
    831794                    // Force uppercase drive letters.
Note: See TracChangeset for help on using the changeset viewer.