Qt 4.8
Static Public Functions | List of all members
QLibraryInfoPrivate Class Reference

Static Public Functions

static void cleanup ()
 
static QSettingsconfiguration ()
 
static QSettingsfindConfiguration ()
 

Detailed Description

Definition at line 84 of file qlibraryinfo.cpp.

Functions

◆ cleanup()

static void QLibraryInfoPrivate::cleanup ( )
inlinestatic

Definition at line 88 of file qlibraryinfo.cpp.

Referenced by QLibrarySettings::QLibrarySettings().

89  {
90  QLibrarySettings *ls = qt_library_settings();
91  if (ls)
92  ls->settings.reset(0);
93  }
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QScopedPointer< QSettings > settings

◆ configuration()

static QSettings* QLibraryInfoPrivate::configuration ( )
inlinestatic

Definition at line 94 of file qlibraryinfo.cpp.

Referenced by QLibraryInfo::location().

95  {
96  QLibrarySettings *ls = qt_library_settings();
97  return ls ? ls->settings.data() : 0;
98  }
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QSettings > settings

◆ findConfiguration()

QSettings * QLibraryInfoPrivate::findConfiguration ( )
static

Definition at line 109 of file qlibraryinfo.cpp.

110 {
111  QString qtconfig = QLatin1String(":/qt/etc/qt.conf");
112 #ifdef BOOTSTRAPPING
113  if(!QFile::exists(qtconfig))
114  qtconfig = qmake_libraryInfoFile();
115 #else
116  if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
117 #ifdef Q_OS_MAC
118  CFBundleRef bundleRef = CFBundleGetMainBundle();
119  if (bundleRef) {
120  QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
121  QCFString(QLatin1String("qt.conf")),
122  0,
123  0);
124  if (urlRef) {
125  QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
126  qtconfig = QDir::cleanPath(path);
127  }
128  }
129  if (qtconfig.isEmpty())
130 #endif
131  {
133  qtconfig = pwd.filePath(QLatin1String("qt.conf"));
134  }
135  }
136 #endif
137  if (QFile::exists(qtconfig))
138  return new QSettings(qtconfig, QSettings::IniFormat);
139  return 0; //no luck
140 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
Definition: qfile.cpp:626
static QString applicationDirPath()
Returns the directory that contains the application executable.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static QString cleanPath(const QString &path)
Removes all multiple directory separators "/" and resolves any "."s or ".."s found in the path...
Definition: qdir.cpp:2082
static QCoreApplication * instance()
Returns a pointer to the application&#39;s QCoreApplication (or QApplication) instance.

The documentation for this class was generated from the following file: