Fix static template error

This commit is contained in:
alqualos 2012-02-26 07:14:34 +00:00
parent c7f28c19c0
commit ca51382269
2 changed files with 9 additions and 11 deletions

View file

@ -477,10 +477,10 @@ bool QuaZip::isDataDescriptorWritingEnabled() const
}
template<typename TFileInfo>
static TFileInfo getFileInfo(QuaZip *zip, bool *ok);
TFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok);
template<>
static QuaZipFileInfo getFileInfo(QuaZip *zip, bool *ok)
QuaZipFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok)
{
QuaZipFileInfo info;
*ok = zip->getCurrentFileInfo(&info);
@ -488,7 +488,7 @@ static QuaZipFileInfo getFileInfo(QuaZip *zip, bool *ok)
}
template<>
static QString getFileInfo(QuaZip *zip, bool *ok)
QString QuaZip_getFileInfo(QuaZip *zip, bool *ok)
{
QString name = zip->getCurrentFileName();
*ok = !name.isEmpty();
@ -512,7 +512,7 @@ bool QuaZipPrivate::getFileInfoList(QList<TFileInfo> *result) const
if (q->goToFirstFile()) {
do {
bool ok;
result->append(getFileInfo<TFileInfo>(q, &ok));
result->append(QuaZip_getFileInfo<TFileInfo>(q, &ok));
if (!ok)
return false;
} while (q->goToNextFile());

View file

@ -79,15 +79,13 @@ QString QuaZipDir::dirName() const
return QDir(d->dir).dirName();
}
// copied from quazip.cpp
template<typename TFileInfo>
static TFileInfo getFileInfo(QuaZip *zip, bool *ok,
TFileInfo QuaZipDir_getFileInfo(QuaZip *zip, bool *ok,
const QString &relativeName,
bool isReal);
template<>
static QuaZipFileInfo getFileInfo(QuaZip *zip, bool *ok,
QuaZipFileInfo QuaZipDir_getFileInfo(QuaZip *zip, bool *ok,
const QString &relativeName,
bool isReal)
{
@ -110,9 +108,9 @@ static QuaZipFileInfo getFileInfo(QuaZip *zip, bool *ok,
}
template<>
static QString getFileInfo(QuaZip *zip, bool *ok,
QString QuaZipDir_getFileInfo(QuaZip *, bool *ok,
const QString &relativeName,
bool isReal)
bool)
{
*ok = true;
return relativeName;
@ -178,7 +176,7 @@ bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters,
if (!nmfltr.isEmpty() && QDir::match(nmfltr, relativeName))
continue;
bool ok;
TFileInfo info = getFileInfo<TFileInfo>(zip, &ok, relativeName,
TFileInfo info = QuaZipDir_getFileInfo<TFileInfo>(zip, &ok, relativeName,
isReal);
if (!ok) {
return false;