mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
move private QLibrary::did_load to QLibraryPrivate
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
63637580c9
commit
6291fe3be8
3 changed files with 16 additions and 15 deletions
|
@ -386,8 +386,9 @@ static LibraryMap *libraryMap()
|
||||||
}
|
}
|
||||||
|
|
||||||
QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString &version)
|
QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString &version)
|
||||||
:pHnd(0), fileName(canonicalFileName), fullVersion(version), instance(0), qt_version(0),
|
: did_load(false), pHnd(0), fileName(canonicalFileName), fullVersion(version),
|
||||||
libraryRefCount(1), libraryUnloadCount(0), pluginState(MightBeAPlugin)
|
instance(0), qt_version(0), libraryRefCount(1), libraryUnloadCount(0),
|
||||||
|
pluginState(MightBeAPlugin)
|
||||||
{ libraryMap()->insert(canonicalFileName, this); }
|
{ libraryMap()->insert(canonicalFileName, this); }
|
||||||
|
|
||||||
QLibraryPrivate *QLibraryPrivate::findOrCreate(const QString &fileName, const QString &version)
|
QLibraryPrivate *QLibraryPrivate::findOrCreate(const QString &fileName, const QString &version)
|
||||||
|
@ -698,9 +699,9 @@ bool QLibrary::load()
|
||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
return false;
|
return false;
|
||||||
if (did_load)
|
if (d->did_load)
|
||||||
return d->pHnd;
|
return d->pHnd;
|
||||||
did_load = true;
|
d->did_load = true;
|
||||||
return d->load();
|
return d->load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -719,8 +720,8 @@ bool QLibrary::load()
|
||||||
*/
|
*/
|
||||||
bool QLibrary::unload()
|
bool QLibrary::unload()
|
||||||
{
|
{
|
||||||
if (did_load) {
|
if (d->did_load) {
|
||||||
did_load = false;
|
d->did_load = false;
|
||||||
return d->unload();
|
return d->unload();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -741,7 +742,7 @@ bool QLibrary::isLoaded() const
|
||||||
Constructs a library with the given \a parent.
|
Constructs a library with the given \a parent.
|
||||||
*/
|
*/
|
||||||
QLibrary::QLibrary(QObject *parent)
|
QLibrary::QLibrary(QObject *parent)
|
||||||
:QObject(parent), d(0), did_load(false)
|
:QObject(parent), d(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,7 +758,7 @@ QLibrary::QLibrary(QObject *parent)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
QLibrary::QLibrary(const QString& fileName, QObject *parent)
|
QLibrary::QLibrary(const QString& fileName, QObject *parent)
|
||||||
:QObject(parent), d(0), did_load(false)
|
:QObject(parent), d(0)
|
||||||
{
|
{
|
||||||
setFileName(fileName);
|
setFileName(fileName);
|
||||||
}
|
}
|
||||||
|
@ -774,7 +775,7 @@ QLibrary::QLibrary(const QString& fileName, QObject *parent)
|
||||||
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
|
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
|
||||||
*/
|
*/
|
||||||
QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
|
QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
|
||||||
:QObject(parent), d(0), did_load(false)
|
:QObject(parent), d(0)
|
||||||
{
|
{
|
||||||
setFileNameAndVersion(fileName, verNum);
|
setFileNameAndVersion(fileName, verNum);
|
||||||
}
|
}
|
||||||
|
@ -790,7 +791,7 @@ QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
|
||||||
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
|
".dylib" on Mac OS X, and ".dll" on Windows. (See \l{fileName}.)
|
||||||
*/
|
*/
|
||||||
QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)
|
QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)
|
||||||
:QObject(parent), d(0), did_load(false)
|
:QObject(parent), d(0)
|
||||||
{
|
{
|
||||||
setFileNameAndVersion(fileName, version);
|
setFileNameAndVersion(fileName, version);
|
||||||
}
|
}
|
||||||
|
@ -838,10 +839,10 @@ void QLibrary::setFileName(const QString &fileName)
|
||||||
lh = d->loadHints;
|
lh = d->loadHints;
|
||||||
d->release();
|
d->release();
|
||||||
d = 0;
|
d = 0;
|
||||||
did_load = false;
|
|
||||||
}
|
}
|
||||||
d = QLibraryPrivate::findOrCreate(fileName);
|
d = QLibraryPrivate::findOrCreate(fileName);
|
||||||
d->loadHints = lh;
|
d->loadHints = lh;
|
||||||
|
d->did_load = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QLibrary::fileName() const
|
QString QLibrary::fileName() const
|
||||||
|
@ -867,10 +868,10 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, int verNum)
|
||||||
lh = d->loadHints;
|
lh = d->loadHints;
|
||||||
d->release();
|
d->release();
|
||||||
d = 0;
|
d = 0;
|
||||||
did_load = false;
|
|
||||||
}
|
}
|
||||||
d = QLibraryPrivate::findOrCreate(fileName, verNum >= 0 ? QString::number(verNum) : QString());
|
d = QLibraryPrivate::findOrCreate(fileName, verNum >= 0 ? QString::number(verNum) : QString());
|
||||||
d->loadHints = lh;
|
d->loadHints = lh;
|
||||||
|
d->did_load = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -889,10 +890,10 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
|
||||||
lh = d->loadHints;
|
lh = d->loadHints;
|
||||||
d->release();
|
d->release();
|
||||||
d = 0;
|
d = 0;
|
||||||
did_load = false;
|
|
||||||
}
|
}
|
||||||
d = QLibraryPrivate::findOrCreate(fileName, version);
|
d = QLibraryPrivate::findOrCreate(fileName, version);
|
||||||
d->loadHints = lh;
|
d->loadHints = lh;
|
||||||
|
d->did_load = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -87,7 +87,6 @@ public:
|
||||||
LoadHints loadHints() const;
|
LoadHints loadHints() const;
|
||||||
private:
|
private:
|
||||||
QLibraryPrivate *d;
|
QLibraryPrivate *d;
|
||||||
bool did_load;
|
|
||||||
Q_DISABLE_COPY(QLibrary)
|
Q_DISABLE_COPY(QLibrary)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ class QSettings;
|
||||||
class QLibraryPrivate
|
class QLibraryPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
bool did_load;
|
||||||
|
|
||||||
void *pHnd;
|
void *pHnd;
|
||||||
|
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
@ -83,7 +85,6 @@ public:
|
||||||
|
|
||||||
bool isPlugin(QSettings *settings = 0);
|
bool isPlugin(QSettings *settings = 0);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version);
|
explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version);
|
||||||
~QLibraryPrivate();
|
~QLibraryPrivate();
|
||||||
|
|
Loading…
Add table
Reference in a new issue