Ignore:
Timestamp:
Nov 28, 2009, 8:49:40 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Make the Qt library portable on OS/2 by replacing hard-coded paths with paths relative to the QtCore DLL (or the application executable if Qt is built as a static library). Add two new locations to search for qt.conf/qtsys.conf for providing more portability and easier system integration. See #78 for more details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/global/qlibraryinfo.cpp

    r2 r357  
    4141
    4242#include "qdir.h"
    43 #include "qfile.h"   
     43#include "qfile.h"
    4444#include "qconfig.h"
    4545#include "qsettings.h"
     
    5858#  include "private/qcore_mac_p.h"
    5959#endif
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
    6082
    6183#include "qconfig.cpp"
     
    137159                qtconfig = pwd.filePath(QLatin1String("qt.conf"));
    138160            }
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
    139181    }
    140182#endif
     
    296338        }
    297339
    298         if (path)
     340        if (path)
    299341            ret = QString::fromLocal8Bit(path);
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
    300354    } else {
    301355        QString key;
     
    431485            // we make the prefix path absolute to the executable's directory
    432486#ifdef QT_BUILD_QMAKE
    433             return QFileInfo(qmake_libraryInfoFile()).absolutePath();
     487            QFileInfo fi(qmake_libraryInfoFile());
     488            return QDir::cleanPath(QDir(fi.absolutePath()).absoluteFilePath(ret));
    434489#else
     490
     491
     492
     493
     494
     495
     496
     497
     498
     499
    435500            if (QCoreApplication::instance()) {
    436501#ifdef Q_OS_MAC
     
    444509                }
    445510#endif
    446                 return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret);
     511                return QDir);
    447512            } else {
    448513                return QDir::current().absoluteFilePath(ret);
     
    451516        } else {
    452517            // we make any other path absolute to the prefix directory
    453             return QDir(location(PrefixPath)).absoluteFilePath(ret);
     518            return QDir);
    454519        }
    455520    }
    456     return ret;
     521    return ;
    457522}
    458523
Note: See TracChangeset for help on using the changeset viewer.