remove QT3_SUPPORT in corelib/io
Change-Id: Ia9ad0bebacc538a7392afb0fdcca40e8a2bb687b Reviewed-on: http://codereview.qt.nokia.com/865 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
This commit is contained in:
parent
369696dc23
commit
6fa1bbdce0
@ -294,31 +294,6 @@ QDataStream::QDataStream(QIODevice *d)
|
|||||||
q_status = Ok;
|
q_status = Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
/*!
|
|
||||||
\fn QDataStream::QDataStream(QByteArray *array, int mode)
|
|
||||||
\compat
|
|
||||||
|
|
||||||
Constructs a data stream that operates on the given \a array. The
|
|
||||||
\a mode specifies how the byte array is to be used, and is
|
|
||||||
usually either QIODevice::ReadOnly or QIODevice::WriteOnly.
|
|
||||||
*/
|
|
||||||
QDataStream::QDataStream(QByteArray *a, int mode)
|
|
||||||
{
|
|
||||||
QBuffer *buf = new QBuffer(a);
|
|
||||||
#ifndef QT_NO_QOBJECT
|
|
||||||
buf->blockSignals(true);
|
|
||||||
#endif
|
|
||||||
buf->open(QIODevice::OpenMode(mode));
|
|
||||||
dev = buf;
|
|
||||||
owndev = true;
|
|
||||||
byteorder = BigEndian;
|
|
||||||
ver = DefaultStreamVersion;
|
|
||||||
noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian;
|
|
||||||
q_status = Ok;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode mode)
|
\fn QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode mode)
|
||||||
|
|
||||||
@ -1307,20 +1282,6 @@ int QDataStream::skipRawData(int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
/*!
|
|
||||||
\fn QDataStream &QDataStream::readRawBytes(char *str, uint len)
|
|
||||||
|
|
||||||
Use readRawData() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QDataStream &QDataStream::writeRawBytes(const char *str, uint len)
|
|
||||||
|
|
||||||
Use writeRawData() instead.
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_DATASTREAM
|
#endif // QT_NO_DATASTREAM
|
||||||
|
@ -113,9 +113,6 @@ public:
|
|||||||
|
|
||||||
QDataStream();
|
QDataStream();
|
||||||
explicit QDataStream(QIODevice *);
|
explicit QDataStream(QIODevice *);
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
QDataStream(QByteArray *, int mode);
|
|
||||||
#endif
|
|
||||||
QDataStream(QByteArray *, QIODevice::OpenMode flags);
|
QDataStream(QByteArray *, QIODevice::OpenMode flags);
|
||||||
QDataStream(const QByteArray &);
|
QDataStream(const QByteArray &);
|
||||||
virtual ~QDataStream();
|
virtual ~QDataStream();
|
||||||
@ -125,9 +122,6 @@ public:
|
|||||||
void unsetDevice();
|
void unsetDevice();
|
||||||
|
|
||||||
bool atEnd() const;
|
bool atEnd() const;
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
inline QT3_SUPPORT bool eof() const { return atEnd(); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Status status() const;
|
Status status() const;
|
||||||
void setStatus(Status status);
|
void setStatus(Status status);
|
||||||
@ -177,15 +171,6 @@ public:
|
|||||||
|
|
||||||
int skipRawData(int len);
|
int skipRawData(int len);
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
inline QT3_SUPPORT QDataStream &readRawBytes(char *str, uint len)
|
|
||||||
{ readRawData(str, static_cast<int>(len)); return *this; }
|
|
||||||
inline QT3_SUPPORT QDataStream &writeRawBytes(const char *str, uint len)
|
|
||||||
{ writeRawData(str, static_cast<int>(len)); return *this; }
|
|
||||||
inline QT3_SUPPORT bool isPrintableData() const { return false; }
|
|
||||||
inline QT3_SUPPORT void setPrintableData(bool) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(QDataStream)
|
Q_DISABLE_COPY(QDataStream)
|
||||||
|
|
||||||
|
@ -91,10 +91,6 @@ QDirPrivate::QDirPrivate(const QString &path, const QStringList &nameFilters_, Q
|
|||||||
, nameFilters(nameFilters_)
|
, nameFilters(nameFilters_)
|
||||||
, sort(sort_)
|
, sort(sort_)
|
||||||
, filters(filters_)
|
, filters(filters_)
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
, filterSepChar(0)
|
|
||||||
, matchAllDirs(false)
|
|
||||||
#endif
|
|
||||||
, fileListsInitialized(false)
|
, fileListsInitialized(false)
|
||||||
{
|
{
|
||||||
setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
|
setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
|
||||||
@ -118,10 +114,6 @@ QDirPrivate::QDirPrivate(const QDirPrivate ©)
|
|||||||
, nameFilters(copy.nameFilters)
|
, nameFilters(copy.nameFilters)
|
||||||
, sort(copy.sort)
|
, sort(copy.sort)
|
||||||
, filters(copy.filters)
|
, filters(copy.filters)
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
, filterSepChar(copy.filterSepChar)
|
|
||||||
, matchAllDirs(copy.matchAllDirs)
|
|
||||||
#endif
|
|
||||||
, fileListsInitialized(false)
|
, fileListsInitialized(false)
|
||||||
, dirEntry(copy.dirEntry)
|
, dirEntry(copy.dirEntry)
|
||||||
, metaData(copy.metaData)
|
, metaData(copy.metaData)
|
||||||
@ -1288,10 +1280,6 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
|
|||||||
|
|
||||||
if (filters == NoFilter)
|
if (filters == NoFilter)
|
||||||
filters = d->filters;
|
filters = d->filters;
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
if (d->matchAllDirs)
|
|
||||||
filters |= AllDirs;
|
|
||||||
#endif
|
|
||||||
if (sort == NoSort)
|
if (sort == NoSort)
|
||||||
sort = d->sort;
|
sort = d->sort;
|
||||||
|
|
||||||
@ -1334,10 +1322,6 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
|
|||||||
|
|
||||||
if (filters == NoFilter)
|
if (filters == NoFilter)
|
||||||
filters = d->filters;
|
filters = d->filters;
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
if (d->matchAllDirs)
|
|
||||||
filters |= AllDirs;
|
|
||||||
#endif
|
|
||||||
if (sort == NoSort)
|
if (sort == NoSort)
|
||||||
sort = d->sort;
|
sort = d->sort;
|
||||||
|
|
||||||
@ -2177,145 +2161,6 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter)
|
|||||||
\sa Q_INIT_RESOURCE(), {The Qt Resource System}
|
\sa Q_INIT_RESOURCE(), {The Qt Resource System}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool QDir::matchAllDirs() const
|
|
||||||
|
|
||||||
Use filter() & AllDirs instead.
|
|
||||||
*/
|
|
||||||
bool QDir::matchAllDirs() const
|
|
||||||
{
|
|
||||||
const QDirPrivate* d = d_ptr.constData();
|
|
||||||
return d->matchAllDirs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void QDir::setMatchAllDirs(bool on)
|
|
||||||
|
|
||||||
Use setFilter() instead.
|
|
||||||
*/
|
|
||||||
void QDir::setMatchAllDirs(bool on)
|
|
||||||
{
|
|
||||||
QDirPrivate* d = d_ptr.data();
|
|
||||||
d->initFileEngine();
|
|
||||||
d->clearFileLists();
|
|
||||||
|
|
||||||
d->matchAllDirs = on;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Use nameFilters() instead.
|
|
||||||
*/
|
|
||||||
QString QDir::nameFilter() const
|
|
||||||
{
|
|
||||||
const QDirPrivate* d = d_ptr.constData();
|
|
||||||
return nameFilters().join(QString(d->filterSepChar));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Use setNameFilters() instead.
|
|
||||||
|
|
||||||
The \a nameFilter is a wildcard (globbing) filter that understands
|
|
||||||
"*" and "?" wildcards. (See \l{QRegExp wildcard matching}.) You may
|
|
||||||
specify several filter entries, each separated by spaces or by
|
|
||||||
semicolons.
|
|
||||||
|
|
||||||
For example, if you want entryList() and entryInfoList() to list
|
|
||||||
all files ending with either ".cpp" or ".h", you would use either
|
|
||||||
dir.setNameFilters("*.cpp *.h") or dir.setNameFilters("*.cpp;*.h").
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
QString filter = "*.cpp *.cxx *.cc";
|
|
||||||
dir.setNameFilter(filter);
|
|
||||||
\newcode
|
|
||||||
QString filter = "*.cpp *.cxx *.cc";
|
|
||||||
dir.setNameFilters(filter.split(' '));
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
void QDir::setNameFilter(const QString &nameFilter)
|
|
||||||
{
|
|
||||||
QDirPrivate* d = d_ptr.data();
|
|
||||||
d->initFileEngine();
|
|
||||||
d->clearFileLists();
|
|
||||||
|
|
||||||
d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter);
|
|
||||||
d->nameFilters = QDirPrivate::splitFilters(nameFilter, d->filterSepChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QString QDir::absPath() const
|
|
||||||
|
|
||||||
Use absolutePath() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QString QDir::absFilePath(const QString &fileName, bool acceptAbsPath) const
|
|
||||||
|
|
||||||
Use absoluteFilePath(\a fileName) instead.
|
|
||||||
|
|
||||||
The \a acceptAbsPath parameter is ignored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool QDir::mkdir(const QString &dirName, bool acceptAbsPath) const
|
|
||||||
|
|
||||||
Use mkdir(\a dirName) instead.
|
|
||||||
|
|
||||||
The \a acceptAbsPath parameter is ignored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn bool QDir::rmdir(const QString &dirName, bool acceptAbsPath) const
|
|
||||||
|
|
||||||
Use rmdir(\a dirName) instead.
|
|
||||||
|
|
||||||
The \a acceptAbsPath parameter is ignored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QStringList QDir::entryList(const QString &nameFilter, Filters filters,
|
|
||||||
SortFlags sort) const
|
|
||||||
\overload
|
|
||||||
|
|
||||||
Use the overload that takes a name filter string list as first
|
|
||||||
argument instead of a combination of attribute filter flags.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QFileInfoList QDir::entryInfoList(const QString &nameFilter, Filters filters,
|
|
||||||
SortFlags sort) const
|
|
||||||
\overload
|
|
||||||
|
|
||||||
Use the overload that takes a name filter string list as first
|
|
||||||
argument instead of a combination of attribute filter flags.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void QDir::convertToAbs()
|
|
||||||
|
|
||||||
Use makeAbsolute() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QString QDir::cleanDirPath(const QString &name)
|
|
||||||
|
|
||||||
Use cleanPath() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\typedef QDir::FilterSpec
|
|
||||||
|
|
||||||
Use QDir::Filters instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\typedef QDir::SortSpec
|
|
||||||
|
|
||||||
Use QDir::SortFlags instead.
|
|
||||||
*/
|
|
||||||
#endif // QT3_SUPPORT
|
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
QDebug operator<<(QDebug debug, QDir::Filters filters)
|
QDebug operator<<(QDebug debug, QDir::Filters filters)
|
||||||
|
@ -67,17 +67,11 @@ public:
|
|||||||
NoSymLinks = 0x008,
|
NoSymLinks = 0x008,
|
||||||
AllEntries = Dirs | Files | Drives,
|
AllEntries = Dirs | Files | Drives,
|
||||||
TypeMask = 0x00f,
|
TypeMask = 0x00f,
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
All = AllEntries,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Readable = 0x010,
|
Readable = 0x010,
|
||||||
Writable = 0x020,
|
Writable = 0x020,
|
||||||
Executable = 0x040,
|
Executable = 0x040,
|
||||||
PermissionMask = 0x070,
|
PermissionMask = 0x070,
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
RWEMask = 0x070,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Modified = 0x080,
|
Modified = 0x080,
|
||||||
Hidden = 0x100,
|
Hidden = 0x100,
|
||||||
@ -92,14 +86,8 @@ public:
|
|||||||
NoDotDot = 0x4000,
|
NoDotDot = 0x4000,
|
||||||
|
|
||||||
NoFilter = -1
|
NoFilter = -1
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
,DefaultFilter = NoFilter
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(Filters, Filter)
|
Q_DECLARE_FLAGS(Filters, Filter)
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
typedef Filters FilterSpec;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum SortFlag { Name = 0x00,
|
enum SortFlag { Name = 0x00,
|
||||||
Time = 0x01,
|
Time = 0x01,
|
||||||
@ -114,9 +102,6 @@ public:
|
|||||||
LocaleAware = 0x40,
|
LocaleAware = 0x40,
|
||||||
Type = 0x80,
|
Type = 0x80,
|
||||||
NoSort = -1
|
NoSort = -1
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
,DefaultSort = NoSort
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(SortFlags, SortFlag)
|
Q_DECLARE_FLAGS(SortFlags, SortFlag)
|
||||||
|
|
||||||
@ -223,36 +208,6 @@ public:
|
|||||||
|
|
||||||
static QString cleanPath(const QString &path);
|
static QString cleanPath(const QString &path);
|
||||||
void refresh() const;
|
void refresh() const;
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
typedef SortFlags SortSpec;
|
|
||||||
inline QT3_SUPPORT QString absPath() const { return absolutePath(); }
|
|
||||||
inline QT3_SUPPORT QString absFilePath(const QString &fileName, bool acceptAbsPath = true) const
|
|
||||||
{ Q_UNUSED(acceptAbsPath); return absoluteFilePath(fileName); }
|
|
||||||
QT3_SUPPORT bool matchAllDirs() const;
|
|
||||||
QT3_SUPPORT void setMatchAllDirs(bool on);
|
|
||||||
inline QT3_SUPPORT QStringList entryList(const QString &nameFilter, Filters filters = NoFilter,
|
|
||||||
SortFlags sort = NoSort) const
|
|
||||||
{ return entryList(nameFiltersFromString(nameFilter), filters, sort); }
|
|
||||||
inline QT3_SUPPORT QFileInfoList entryInfoList(const QString &nameFilter,
|
|
||||||
Filters filters = NoFilter,
|
|
||||||
SortFlags sort = NoSort) const
|
|
||||||
{ return entryInfoList(nameFiltersFromString(nameFilter), filters, sort); }
|
|
||||||
|
|
||||||
QT3_SUPPORT QString nameFilter() const;
|
|
||||||
QT3_SUPPORT void setNameFilter(const QString &nameFilter);
|
|
||||||
|
|
||||||
inline QT3_SUPPORT bool mkdir(const QString &dirName, bool acceptAbsPath) const
|
|
||||||
{ Q_UNUSED(acceptAbsPath); return mkdir(dirName); }
|
|
||||||
inline QT3_SUPPORT bool rmdir(const QString &dirName, bool acceptAbsPath) const
|
|
||||||
{ Q_UNUSED(acceptAbsPath); return rmdir(dirName); }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT void convertToAbs() { makeAbsolute(); }
|
|
||||||
inline QT3_SUPPORT static QString currentDirPath() { return currentPath(); }
|
|
||||||
inline QT3_SUPPORT static QString homeDirPath() { return homePath(); }
|
|
||||||
inline QT3_SUPPORT static QString rootDirPath() { return rootPath(); }
|
|
||||||
inline QT3_SUPPORT static QString cleanDirPath(const QString &name) { return cleanPath(name); }
|
|
||||||
#endif // QT3_SUPPORT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters)
|
||||||
|
@ -77,11 +77,6 @@ public:
|
|||||||
QDir::SortFlags sort;
|
QDir::SortFlags sort;
|
||||||
QDir::Filters filters;
|
QDir::Filters filters;
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
QChar filterSepChar;
|
|
||||||
bool matchAllDirs;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QScopedPointer<QAbstractFileEngine> fileEngine;
|
QScopedPointer<QAbstractFileEngine> fileEngine;
|
||||||
|
|
||||||
mutable bool fileListsInitialized;
|
mutable bool fileListsInitialized;
|
||||||
|
@ -370,14 +370,6 @@ QFilePrivate::setError(QFile::FileError err, int errNum)
|
|||||||
file handle and must close it.
|
file handle and must close it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
/*!
|
|
||||||
\typedef QFile::PermissionSpec
|
|
||||||
|
|
||||||
Use QFile::Permission instead.
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef QT_NO_QOBJECT
|
#ifdef QT_NO_QOBJECT
|
||||||
QFile::QFile()
|
QFile::QFile()
|
||||||
: QIODevice(*new QFilePrivate)
|
: QIODevice(*new QFilePrivate)
|
||||||
|
@ -87,9 +87,6 @@ public:
|
|||||||
ResizeError = 12,
|
ResizeError = 12,
|
||||||
PermissionsError = 13,
|
PermissionsError = 13,
|
||||||
CopyError = 14
|
CopyError = 14
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
, ConnectError = 30
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Permission {
|
enum Permission {
|
||||||
@ -186,14 +183,6 @@ public:
|
|||||||
|
|
||||||
virtual QAbstractFileEngine *fileEngine() const;
|
virtual QAbstractFileEngine *fileEngine() const;
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
typedef Permission PermissionSpec;
|
|
||||||
inline QT3_SUPPORT QString name() const { return fileName(); }
|
|
||||||
inline QT3_SUPPORT void setName(const QString &aName) { setFileName(aName); }
|
|
||||||
inline QT3_SUPPORT bool open(OpenMode aFlags, FILE *f) { return open(f, aFlags); }
|
|
||||||
inline QT3_SUPPORT bool open(OpenMode aFlags, int fd) { return open(fd, aFlags); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef QT_NO_QOBJECT
|
#ifdef QT_NO_QOBJECT
|
||||||
QFile(QFilePrivate &dd);
|
QFile(QFilePrivate &dd);
|
||||||
|
@ -851,19 +851,6 @@ QDir QFileInfo::absoluteDir() const
|
|||||||
return QDir(absolutePath());
|
return QDir(absolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
/*!
|
|
||||||
Use absoluteDir() or the dir() overload that takes no parameters
|
|
||||||
instead.
|
|
||||||
*/
|
|
||||||
QDir QFileInfo::dir(bool absPath) const
|
|
||||||
{
|
|
||||||
if (absPath)
|
|
||||||
return absoluteDir();
|
|
||||||
return dir();
|
|
||||||
}
|
|
||||||
#endif //QT3_SUPPORT
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns true if the user can read the file; otherwise returns false.
|
Returns true if the user can read the file; otherwise returns false.
|
||||||
|
|
||||||
|
@ -139,40 +139,6 @@ public:
|
|||||||
bool caching() const;
|
bool caching() const;
|
||||||
void setCaching(bool on);
|
void setCaching(bool on);
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
enum Permission {
|
|
||||||
ReadOwner = QFile::ReadOwner, WriteOwner = QFile::WriteOwner, ExeOwner = QFile::ExeOwner,
|
|
||||||
ReadUser = QFile::ReadUser, WriteUser = QFile::WriteUser, ExeUser = QFile::ExeUser,
|
|
||||||
ReadGroup = QFile::ReadGroup, WriteGroup = QFile::WriteGroup, ExeGroup = QFile::ExeGroup,
|
|
||||||
ReadOther = QFile::ReadOther, WriteOther = QFile::WriteOther, ExeOther = QFile::ExeOther
|
|
||||||
};
|
|
||||||
Q_DECLARE_FLAGS(PermissionSpec, Permission)
|
|
||||||
|
|
||||||
inline QT3_SUPPORT QString baseName(bool complete) {
|
|
||||||
if(complete)
|
|
||||||
return completeBaseName();
|
|
||||||
return baseName();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QString extension(bool complete = true) const {
|
|
||||||
if(complete)
|
|
||||||
return completeSuffix();
|
|
||||||
return suffix();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QString absFilePath() const { return absoluteFilePath(); }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT QString dirPath(bool absPath = false) const {
|
|
||||||
if(absPath)
|
|
||||||
return absolutePath();
|
|
||||||
return path();
|
|
||||||
}
|
|
||||||
QT3_SUPPORT QDir dir(bool absPath) const;
|
|
||||||
inline QT3_SUPPORT bool convertToAbs() { return makeAbsolute(); }
|
|
||||||
#if !defined(Q_NO_TYPESAFE_FLAGS)
|
|
||||||
inline QT3_SUPPORT bool permission(PermissionSpec permissions) const
|
|
||||||
{ return permission(QFile::Permissions(static_cast<int>(permissions))); }
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QSharedDataPointer<QFileInfoPrivate> d_ptr;
|
QSharedDataPointer<QFileInfoPrivate> d_ptr;
|
||||||
private:
|
private:
|
||||||
@ -190,14 +156,7 @@ private:
|
|||||||
|
|
||||||
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
|
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileInfo::PermissionSpec)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef QList<QFileInfo> QFileInfoList;
|
typedef QList<QFileInfo> QFileInfoList;
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
typedef QList<QFileInfo>::Iterator QFileInfoListIterator;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
@ -1790,31 +1790,6 @@ QString QIODevice::errorString() const
|
|||||||
Use write(\a data) instead.
|
Use write(\a data) instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined QT3_SUPPORT
|
|
||||||
QIODevice::Status QIODevice::status() const
|
|
||||||
{
|
|
||||||
#if !defined(QT_NO_QOBJECT)
|
|
||||||
const QFile *f = qobject_cast<const QFile *>(this);
|
|
||||||
if (f) return (int) f->error();
|
|
||||||
#endif
|
|
||||||
return isOpen() ? 0 /* IO_Ok */ : 8 /* IO_UnspecifiedError */;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
For device specific error handling, please refer to the
|
|
||||||
individual device documentation.
|
|
||||||
|
|
||||||
\sa qobject_cast()
|
|
||||||
*/
|
|
||||||
void QIODevice::resetStatus()
|
|
||||||
{
|
|
||||||
#if !defined(QT_NO_QOBJECT)
|
|
||||||
QFile *f = qobject_cast<QFile *>(this);
|
|
||||||
if (f) f->unsetError();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(QT_NO_DEBUG_STREAM)
|
#if !defined(QT_NO_DEBUG_STREAM)
|
||||||
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
|
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
|
||||||
{
|
{
|
||||||
|
@ -167,81 +167,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
Q_DECLARE_PRIVATE(QIODevice)
|
Q_DECLARE_PRIVATE(QIODevice)
|
||||||
Q_DISABLE_COPY(QIODevice)
|
Q_DISABLE_COPY(QIODevice)
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
public:
|
|
||||||
typedef qint64 Offset;
|
|
||||||
|
|
||||||
inline QT3_SUPPORT int flags() const { return static_cast<int>(openMode()); }
|
|
||||||
inline QT3_SUPPORT int mode() const { return static_cast<int>(openMode()); }
|
|
||||||
inline QT3_SUPPORT int state() const;
|
|
||||||
|
|
||||||
inline QT3_SUPPORT bool isDirectAccess() const { return !isSequential(); }
|
|
||||||
inline QT3_SUPPORT bool isSequentialAccess() const { return isSequential(); }
|
|
||||||
inline QT3_SUPPORT bool isCombinedAccess() const { return false; }
|
|
||||||
inline QT3_SUPPORT bool isBuffered() const { return true; }
|
|
||||||
inline QT3_SUPPORT bool isRaw() const { return false; }
|
|
||||||
inline QT3_SUPPORT bool isSynchronous() const { return true; }
|
|
||||||
inline QT3_SUPPORT bool isAsynchronous() const { return false; }
|
|
||||||
inline QT3_SUPPORT bool isTranslated() const { return (openMode() & Text) != 0; }
|
|
||||||
inline QT3_SUPPORT bool isInactive() const { return !isOpen(); }
|
|
||||||
|
|
||||||
typedef int Status;
|
|
||||||
QT3_SUPPORT Status status() const;
|
|
||||||
QT3_SUPPORT void resetStatus();
|
|
||||||
|
|
||||||
inline QT3_SUPPORT Offset at() const { return pos(); }
|
|
||||||
inline QT3_SUPPORT bool at(Offset offset) { return seek(offset); }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
|
||||||
inline QT3_SUPPORT qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
|
||||||
inline QT3_SUPPORT qint64 writeBlock(const QByteArray &data) { return write(data); }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT int getch() { char c; return getChar(&c) ? int(uchar(c)) : -1; }
|
|
||||||
inline QT3_SUPPORT int putch(int c) { return putChar(char(c)) ? int(uchar(c)) : -1; }
|
|
||||||
inline QT3_SUPPORT int ungetch(int c) { ungetChar(uchar(c)); return c; }
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QIODevice::OpenMode)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QIODevice::OpenMode)
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Direct = 0x0100;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Sequential = 0x0200;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Combined = 0x0300;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_TypeMask = 0x0300;
|
|
||||||
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Raw = 0x0000;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Async = 0x0000;
|
|
||||||
|
|
||||||
#define IO_ReadOnly QIODevice::ReadOnly
|
|
||||||
#define IO_WriteOnly QIODevice::WriteOnly
|
|
||||||
#define IO_ReadWrite QIODevice::ReadWrite
|
|
||||||
#define IO_Append QIODevice::Append
|
|
||||||
#define IO_Truncate QIODevice::Truncate
|
|
||||||
#define IO_Translate QIODevice::Text
|
|
||||||
#define IO_ModeMask 0x00ff
|
|
||||||
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Open = 0x1000;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_StateMask = 0xf000;
|
|
||||||
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_Ok = 0;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_ReadError = 1;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_WriteError = 2;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_FatalError = 3;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_ResourceError = 4;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_OpenError = 5;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_ConnectError = 5;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_AbortError = 6;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_TimeOutError = 7;
|
|
||||||
static QT3_SUPPORT_VARIABLE const uint IO_UnspecifiedError = 8;
|
|
||||||
|
|
||||||
inline QT3_SUPPORT int QIODevice::state() const
|
|
||||||
{
|
|
||||||
return isOpen() ? 0x1000 : 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(QT_NO_DEBUG_STREAM)
|
#if !defined(QT_NO_DEBUG_STREAM)
|
||||||
class QDebug;
|
class QDebug;
|
||||||
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
|
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
|
||||||
|
@ -3547,278 +3547,6 @@ QSettings::Format QSettings::registerFormat(const QString &extension, ReadFunc r
|
|||||||
return QSettings::Format((int)QSettings::CustomFormat1 + index);
|
return QSettings::Format((int)QSettings::CustomFormat1 + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
void QSettings::setPath_helper(Scope scope, const QString &organization, const QString &application)
|
|
||||||
{
|
|
||||||
Q_D(QSettings);
|
|
||||||
if (d->pendingChanges)
|
|
||||||
d->flush();
|
|
||||||
QSettingsPrivate *oldPriv = d;
|
|
||||||
QSettingsPrivate *newPriv = QSettingsPrivate::create(oldPriv->format, scope, organization, application);
|
|
||||||
static_cast<QObjectPrivate &>(*newPriv) = static_cast<QObjectPrivate &>(*oldPriv); // copy the QObject stuff over (hack)
|
|
||||||
d_ptr.reset(newPriv);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, bool value)
|
|
||||||
|
|
||||||
Sets the value of setting \a key to \a value.
|
|
||||||
|
|
||||||
Use setValue() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, double value)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, int value)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, const char *value)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, const QString &value)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, const QStringList &value)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::writeEntry(const QString &key, const QStringList &value, QChar separator)
|
|
||||||
|
|
||||||
\overload
|
|
||||||
|
|
||||||
Use setValue(\a key, \a value) instead. You don't need \a separator.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn QStringList QSettings::readListEntry(const QString &key, bool *ok = 0)
|
|
||||||
|
|
||||||
Returns the value of setting \a key converted to a QStringList.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
QStringList list = settings.readListEntry("recentFiles", &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("recentFiles");
|
|
||||||
QStringList list = settings.value("recentFiles").toStringList();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn QStringList QSettings::readListEntry(const QString &key, QChar separator, bool *ok)
|
|
||||||
|
|
||||||
Returns the value of setting \a key converted to a QStringList.
|
|
||||||
\a separator is ignored.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
QStringList list = settings.readListEntry("recentFiles", ":", &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("recentFiles");
|
|
||||||
QStringList list = settings.value("recentFiles").toStringList();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn QString QSettings::readEntry(const QString &key, const QString &defaultValue, bool *ok)
|
|
||||||
|
|
||||||
Returns the value for setting \a key converted to a QString. If
|
|
||||||
the setting doesn't exist, returns \a defaultValue.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
QString str = settings.readEntry("userName", "administrator", &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("userName");
|
|
||||||
QString str = settings.value("userName", "administrator").toString();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn int QSettings::readNumEntry(const QString &key, int defaultValue, bool *ok)
|
|
||||||
|
|
||||||
Returns the value for setting \a key converted to an \c int. If
|
|
||||||
the setting doesn't exist, returns \a defaultValue.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
int max = settings.readNumEntry("maxConnections", 30, &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("maxConnections");
|
|
||||||
int max = settings.value("maxConnections", 30).toInt();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn double QSettings::readDoubleEntry(const QString &key, double defaultValue, bool *ok)
|
|
||||||
|
|
||||||
Returns the value for setting \a key converted to a \c double. If
|
|
||||||
the setting doesn't exist, returns \a defaultValue.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
double pi = settings.readDoubleEntry("pi", 3.141592, &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("pi");
|
|
||||||
double pi = settings.value("pi", 3.141592).toDouble();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::readBoolEntry(const QString &key, bool defaultValue, bool *ok)
|
|
||||||
|
|
||||||
Returns the value for setting \a key converted to a \c bool. If
|
|
||||||
the setting doesn't exist, returns \a defaultValue.
|
|
||||||
|
|
||||||
If \a ok is not 0, *\a{ok} is set to true if the key exists,
|
|
||||||
otherwise *\a{ok} is set to false.
|
|
||||||
|
|
||||||
Use value() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
bool ok;
|
|
||||||
bool grid = settings.readBoolEntry("showGrid", true, &ok);
|
|
||||||
\newcode
|
|
||||||
bool ok = settings.contains("showGrid");
|
|
||||||
bool grid = settings.value("showGrid", true).toBool();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn bool QSettings::removeEntry(const QString &key)
|
|
||||||
|
|
||||||
Use remove() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \enum QSettings::System
|
|
||||||
\compat
|
|
||||||
|
|
||||||
\value Unix Unix systems (X11 and Embedded Linux)
|
|
||||||
\value Windows Microsoft Windows systems
|
|
||||||
\value Mac Mac OS X systems
|
|
||||||
|
|
||||||
\sa insertSearchPath(), removeSearchPath()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn void QSettings::insertSearchPath(System system, const QString &path)
|
|
||||||
|
|
||||||
This function is implemented as a no-op. It is provided for
|
|
||||||
source compatibility with Qt 3. The new QSettings class has no
|
|
||||||
concept of "search path".
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn void QSettings::removeSearchPath(System system, const QString &path)
|
|
||||||
|
|
||||||
This function is implemented as a no-op. It is provided for
|
|
||||||
source compatibility with Qt 3. The new QSettings class has no
|
|
||||||
concept of "search path".
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn void QSettings::setPath(const QString &organization, const QString &application, \
|
|
||||||
Scope scope)
|
|
||||||
|
|
||||||
Specifies the \a organization, \a application, and \a scope to
|
|
||||||
use by the QSettings object.
|
|
||||||
|
|
||||||
Use the appropriate constructor instead, with QSettings::UserScope
|
|
||||||
instead of QSettings::User and QSettings::SystemScope instead of
|
|
||||||
QSettings::Global.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
QSettings settings;
|
|
||||||
settings.setPath("twikimaster.com", "Kanooth", QSettings::Global);
|
|
||||||
\newcode
|
|
||||||
QSettings settings(QSettings::SystemScope, "twikimaster.com", "Kanooth");
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn void QSettings::resetGroup()
|
|
||||||
|
|
||||||
Sets the current group to be the empty string.
|
|
||||||
|
|
||||||
Use endGroup() instead (possibly multiple times).
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("mainWindow");
|
|
||||||
settings.beginGroup("leftPanel");
|
|
||||||
...
|
|
||||||
settings.resetGroup();
|
|
||||||
\newcode
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("mainWindow");
|
|
||||||
settings.beginGroup("leftPanel");
|
|
||||||
...
|
|
||||||
settings.endGroup();
|
|
||||||
settings.endGroup();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn QStringList QSettings::entryList(const QString &key) const
|
|
||||||
|
|
||||||
Returns a list of all sub-keys of \a key.
|
|
||||||
|
|
||||||
Use childKeys() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
QSettings settings;
|
|
||||||
QStringList keys = settings.entryList("cities");
|
|
||||||
...
|
|
||||||
\newcode
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("cities");
|
|
||||||
QStringList keys = settings.childKeys();
|
|
||||||
...
|
|
||||||
settings.endGroup();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \fn QStringList QSettings::subkeyList(const QString &key) const
|
|
||||||
|
|
||||||
Returns a list of all sub-keys of \a key.
|
|
||||||
|
|
||||||
Use childGroups() instead.
|
|
||||||
|
|
||||||
\oldcode
|
|
||||||
QSettings settings;
|
|
||||||
QStringList groups = settings.entryList("cities");
|
|
||||||
...
|
|
||||||
\newcode
|
|
||||||
QSettings settings;
|
|
||||||
settings.beginGroup("cities");
|
|
||||||
QStringList groups = settings.childKeys();
|
|
||||||
...
|
|
||||||
settings.endGroup();
|
|
||||||
\endcode
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_SETTINGS
|
#endif // QT_NO_SETTINGS
|
||||||
|
@ -54,10 +54,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
#ifndef QT_NO_SETTINGS
|
#ifndef QT_NO_SETTINGS
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
#include <QtCore/qstringlist.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -115,11 +111,6 @@ public:
|
|||||||
enum Scope {
|
enum Scope {
|
||||||
UserScope,
|
UserScope,
|
||||||
SystemScope
|
SystemScope
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
,
|
|
||||||
User = UserScope,
|
|
||||||
Global = SystemScope
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QT_NO_QOBJECT
|
#ifndef QT_NO_QOBJECT
|
||||||
@ -194,113 +185,12 @@ public:
|
|||||||
static Format registerFormat(const QString &extension, ReadFunc readFunc, WriteFunc writeFunc,
|
static Format registerFormat(const QString &extension, ReadFunc readFunc, WriteFunc writeFunc,
|
||||||
Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive);
|
Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive);
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, bool value)
|
|
||||||
{ setValue(key, value); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, double value)
|
|
||||||
{ setValue(key, value); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, int value)
|
|
||||||
{ setValue(key, value); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, const char *value)
|
|
||||||
{ setValue(key, QString::fromAscii(value)); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, const QString &value)
|
|
||||||
{ setValue(key, value); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, const QStringList &value)
|
|
||||||
{ setValue(key, value); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT bool writeEntry(const QString &key, const QStringList &value, QChar separator)
|
|
||||||
{ setValue(key, value.join(QString(separator))); return isWritable(); }
|
|
||||||
inline QT3_SUPPORT QStringList readListEntry(const QString &key, bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
return value(key).toStringList();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QStringList readListEntry(const QString &key, QChar separator, bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
QString str = value(key).toString();
|
|
||||||
if (str.isEmpty())
|
|
||||||
return QStringList();
|
|
||||||
return str.split(separator);
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QString readEntry(const QString &key, const QString &defaultValue = QString(),
|
|
||||||
bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
return value(key, defaultValue).toString();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT int readNumEntry(const QString &key, int defaultValue = 0, bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
return value(key, defaultValue).toInt();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT double readDoubleEntry(const QString &key, double defaultValue = 0,
|
|
||||||
bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
return value(key, defaultValue).toDouble();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT bool readBoolEntry(const QString &key, bool defaultValue = false,
|
|
||||||
bool *ok = 0)
|
|
||||||
{
|
|
||||||
if (ok)
|
|
||||||
*ok = contains(key);
|
|
||||||
return value(key, defaultValue).toBool();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT bool removeEntry(const QString &key)
|
|
||||||
{ remove(key); return true; }
|
|
||||||
|
|
||||||
enum System { Unix, Windows, Mac };
|
|
||||||
inline QT3_SUPPORT void insertSearchPath(System, const QString &) {}
|
|
||||||
inline QT3_SUPPORT void removeSearchPath(System, const QString &) {}
|
|
||||||
|
|
||||||
inline QT3_SUPPORT void setPath(const QString &organization, const QString &application,
|
|
||||||
Scope scope = Global)
|
|
||||||
{
|
|
||||||
setPath_helper(scope == Global ? QSettings::SystemScope : QSettings::UserScope,
|
|
||||||
organization, application);
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT void resetGroup()
|
|
||||||
{
|
|
||||||
while (!group().isEmpty())
|
|
||||||
endGroup();
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QStringList entryList(const QString &key) const
|
|
||||||
{
|
|
||||||
QSettings *that = const_cast<QSettings *>(this);
|
|
||||||
QStringList result;
|
|
||||||
|
|
||||||
that->beginGroup(key);
|
|
||||||
result = that->childKeys();
|
|
||||||
that->endGroup();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QStringList subkeyList(const QString &key) const
|
|
||||||
{
|
|
||||||
QSettings *that = const_cast<QSettings *>(this);
|
|
||||||
QStringList result;
|
|
||||||
|
|
||||||
that->beginGroup(key);
|
|
||||||
result = that->childGroups();
|
|
||||||
that->endGroup();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifndef QT_NO_QOBJECT
|
#ifndef QT_NO_QOBJECT
|
||||||
bool event(QEvent *event);
|
bool event(QEvent *event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
void setPath_helper(Scope scope, const QString &organization, const QString &application);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DISABLE_COPY(QSettings)
|
Q_DISABLE_COPY(QSettings)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3107,304 +3107,6 @@ QLocale QTextStream::locale() const
|
|||||||
return d->locale;
|
return d->locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
/*!
|
|
||||||
\class QTextIStream
|
|
||||||
\brief The QTextIStream class is a convenience class for input streams.
|
|
||||||
|
|
||||||
\compat
|
|
||||||
\reentrant
|
|
||||||
|
|
||||||
Use QTextStream instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QTextIStream::QTextIStream(const QString *string)
|
|
||||||
|
|
||||||
Use QTextStream(&\a{string}, QIODevice::ReadOnly) instead.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
\fn QTextIStream::QTextIStream(QByteArray *byteArray)
|
|
||||||
|
|
||||||
Use QTextStream(&\a{byteArray}, QIODevice::ReadOnly) instead.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
\fn QTextIStream::QTextIStream(FILE *file)
|
|
||||||
|
|
||||||
Use QTextStream(\a{file}, QIODevice::ReadOnly) instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class QTextOStream
|
|
||||||
\brief The QTextOStream class is a convenience class for output streams.
|
|
||||||
|
|
||||||
\compat
|
|
||||||
\reentrant
|
|
||||||
|
|
||||||
Use QTextStream instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn QTextOStream::QTextOStream(QString *string)
|
|
||||||
|
|
||||||
Use QTextStream(&\a{string}, QIODevice::WriteOnly) instead.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
\fn QTextOStream::QTextOStream(QByteArray *byteArray)
|
|
||||||
|
|
||||||
Use QTextStream(&\a{byteArray}, QIODevice::WriteOnly) instead.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
\fn QTextOStream::QTextOStream(FILE *file)
|
|
||||||
|
|
||||||
Use QTextStream(\a{file}, QIODevice::WriteOnly) instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! \internal
|
|
||||||
*/
|
|
||||||
int QTextStream::flagsInternal() const
|
|
||||||
{
|
|
||||||
Q_D(const QTextStream);
|
|
||||||
|
|
||||||
int f = 0;
|
|
||||||
switch (d->fieldAlignment) {
|
|
||||||
case AlignLeft: f |= left; break;
|
|
||||||
case AlignRight: f |= right; break;
|
|
||||||
case AlignCenter: f |= internal; break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
switch (d->integerBase) {
|
|
||||||
case 2: f |= bin; break;
|
|
||||||
case 8: f |= oct; break;
|
|
||||||
case 10: f |= dec; break;
|
|
||||||
case 16: f |= hex; break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
switch (d->realNumberNotation) {
|
|
||||||
case FixedNotation: f |= fixed; break;
|
|
||||||
case ScientificNotation: f |= scientific; break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (d->numberFlags & ShowBase)
|
|
||||||
f |= showbase;
|
|
||||||
if (d->numberFlags & ForcePoint)
|
|
||||||
f |= showpoint;
|
|
||||||
if (d->numberFlags & ForceSign)
|
|
||||||
f |= showpos;
|
|
||||||
if (d->numberFlags & UppercaseBase)
|
|
||||||
f |= uppercase;
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! \internal
|
|
||||||
*/
|
|
||||||
int QTextStream::flagsInternal(int newFlags)
|
|
||||||
{
|
|
||||||
int oldFlags = flagsInternal();
|
|
||||||
|
|
||||||
if (newFlags & left)
|
|
||||||
setFieldAlignment(AlignLeft);
|
|
||||||
else if (newFlags & right)
|
|
||||||
setFieldAlignment(AlignRight);
|
|
||||||
else if (newFlags & internal)
|
|
||||||
setFieldAlignment(AlignCenter);
|
|
||||||
|
|
||||||
if (newFlags & bin)
|
|
||||||
setIntegerBase(2);
|
|
||||||
else if (newFlags & oct)
|
|
||||||
setIntegerBase(8);
|
|
||||||
else if (newFlags & dec)
|
|
||||||
setIntegerBase(10);
|
|
||||||
else if (newFlags & hex)
|
|
||||||
setIntegerBase(16);
|
|
||||||
|
|
||||||
if (newFlags & showbase)
|
|
||||||
setNumberFlags(numberFlags() | ShowBase);
|
|
||||||
if (newFlags & showpos)
|
|
||||||
setNumberFlags(numberFlags() | ForceSign);
|
|
||||||
if (newFlags & showpoint)
|
|
||||||
setNumberFlags(numberFlags() | ForcePoint);
|
|
||||||
if (newFlags & uppercase)
|
|
||||||
setNumberFlags(numberFlags() | UppercaseBase);
|
|
||||||
|
|
||||||
if (newFlags & fixed)
|
|
||||||
setRealNumberNotation(FixedNotation);
|
|
||||||
else if (newFlags & scientific)
|
|
||||||
setRealNumberNotation(ScientificNotation);
|
|
||||||
|
|
||||||
return oldFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef QT_NO_TEXTCODEC
|
|
||||||
/*!
|
|
||||||
Use setCodec() and setAutoDetectUnicode() instead.
|
|
||||||
*/
|
|
||||||
void QTextStream::setEncoding(Encoding encoding)
|
|
||||||
{
|
|
||||||
Q_D(QTextStream);
|
|
||||||
resetCodecConverterStateHelper(&d->readConverterState);
|
|
||||||
resetCodecConverterStateHelper(&d->writeConverterState);
|
|
||||||
|
|
||||||
switch (encoding) {
|
|
||||||
case Locale:
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForLocale());
|
|
||||||
d->autoDetectUnicode = true;
|
|
||||||
break;
|
|
||||||
case Latin1:
|
|
||||||
d->readConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForName("ISO-8859-1"));
|
|
||||||
d->autoDetectUnicode = false;
|
|
||||||
break;
|
|
||||||
case Unicode:
|
|
||||||
setCodec(QTextCodec::codecForName("UTF-16"));
|
|
||||||
d->autoDetectUnicode = false;
|
|
||||||
break;
|
|
||||||
case RawUnicode:
|
|
||||||
d->readConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForName("UTF-16"));
|
|
||||||
d->autoDetectUnicode = false;
|
|
||||||
break;
|
|
||||||
case UnicodeNetworkOrder:
|
|
||||||
d->readConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForName("UTF-16BE"));
|
|
||||||
d->autoDetectUnicode = false;
|
|
||||||
break;
|
|
||||||
case UnicodeReverse:
|
|
||||||
d->readConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForName("UTF-16LE"));
|
|
||||||
d->autoDetectUnicode = false;
|
|
||||||
break;
|
|
||||||
case UnicodeUTF8:
|
|
||||||
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
|
|
||||||
setCodec(QTextCodec::codecForName("UTF-8"));
|
|
||||||
d->autoDetectUnicode = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\enum QTextStream::Encoding
|
|
||||||
\compat
|
|
||||||
|
|
||||||
\value Latin1 Use setCodec(QTextCodec::codecForName("ISO-8859-1")) instead.
|
|
||||||
\value Locale Use setCodec(QTextCodec::codecForLocale()) instead.
|
|
||||||
\value RawUnicode Use setCodec(QTextCodec::codecForName("UTF-16")) instead.
|
|
||||||
\value Unicode Use setCodec(QTextCodec::codecForName("UTF-16")) instead.
|
|
||||||
\value UnicodeNetworkOrder Use setCodec(QTextCodec::codecForName("UTF-16BE")) instead.
|
|
||||||
\value UnicodeReverse Use setCodec(QTextCodec::codecForName("UTF-16LE")) instead.
|
|
||||||
\value UnicodeUTF8 Use setCodec(QTextCodec::codecForName("UTF-8")) instead.
|
|
||||||
|
|
||||||
Also, for all encodings except QTextStream::Latin1 and
|
|
||||||
QTextStream::UTF8, you need to call setAutoDetectUnicode(false)
|
|
||||||
to obtain the Qt 3 behavior in addition to the setCodec() call.
|
|
||||||
|
|
||||||
\sa setCodec(), setAutoDetectUnicode()
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::flags() const
|
|
||||||
|
|
||||||
Use fieldAlignment(), padChar(), fieldWidth(), numberFlags(),
|
|
||||||
integerBase(), realNumberNotation(), and realNumberNotation
|
|
||||||
instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::flags(int)
|
|
||||||
|
|
||||||
Use setFieldAlignment(), setPadChar(), setFieldWidth(),
|
|
||||||
setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
|
|
||||||
setRealNumberNotation instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::setf(int)
|
|
||||||
|
|
||||||
Use setFieldAlignment(), setPadChar(), setFieldWidth(),
|
|
||||||
setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
|
|
||||||
setRealNumberNotation instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::setf(int, int)
|
|
||||||
|
|
||||||
Use setFieldAlignment(), setPadChar(), setFieldWidth(),
|
|
||||||
setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
|
|
||||||
setRealNumberNotation instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::unsetf(int)
|
|
||||||
|
|
||||||
Use setFieldAlignment(), setPadChar(), setFieldWidth(),
|
|
||||||
setNumberFlags(), setIntegerBase(), setRealNumberNotation(), and
|
|
||||||
setRealNumberNotation instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::width(int)
|
|
||||||
|
|
||||||
Use setFieldWidth() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::fill(int)
|
|
||||||
|
|
||||||
Use setPadChar() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::precision(int)
|
|
||||||
|
|
||||||
Use setRealNumberPrecision() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::read()
|
|
||||||
|
|
||||||
Use readAll() or readLine() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn int QTextStream::unsetDevice()
|
|
||||||
|
|
||||||
Use setDevice(0) instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\variable QTextStream::skipws
|
|
||||||
\variable QTextStream::left
|
|
||||||
\variable QTextStream::right
|
|
||||||
\variable QTextStream::internal
|
|
||||||
\variable QTextStream::bin
|
|
||||||
\variable QTextStream::oct
|
|
||||||
\variable QTextStream::dec
|
|
||||||
\variable QTextStream::hex
|
|
||||||
\variable QTextStream::showbase
|
|
||||||
\variable QTextStream::showpoint
|
|
||||||
\variable QTextStream::uppercase
|
|
||||||
\variable QTextStream::showpos
|
|
||||||
\variable QTextStream::scientific
|
|
||||||
\variable QTextStream::fixed
|
|
||||||
\variable QTextStream::basefield
|
|
||||||
\variable QTextStream::adjustfield
|
|
||||||
\variable QTextStream::floatfield
|
|
||||||
\compat
|
|
||||||
|
|
||||||
Use the new \l{QTextStream manipulators} instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_QOBJECT
|
#ifndef QT_NO_QOBJECT
|
||||||
|
@ -48,12 +48,6 @@
|
|||||||
#include <QtCore/qlocale.h>
|
#include <QtCore/qlocale.h>
|
||||||
#include <QtCore/qscopedpointer.h>
|
#include <QtCore/qscopedpointer.h>
|
||||||
|
|
||||||
#ifndef QT_NO_TEXTCODEC
|
|
||||||
# ifdef QT3_SUPPORT
|
|
||||||
# include <QtCore/qtextcodec.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef Status
|
#ifdef Status
|
||||||
@ -199,63 +193,7 @@ public:
|
|||||||
QTextStream &operator<<(const char *c);
|
QTextStream &operator<<(const char *c);
|
||||||
QTextStream &operator<<(const void *ptr);
|
QTextStream &operator<<(const void *ptr);
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
// not marked as QT3_SUPPORT to avoid double compiler warnings, as
|
|
||||||
// they are used in the QT3_SUPPORT functions below.
|
|
||||||
inline QT3_SUPPORT int flags() const { return flagsInternal(); }
|
|
||||||
inline QT3_SUPPORT int flags(int f) { return flagsInternal(f); }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT int setf(int bits)
|
|
||||||
{ int old = flagsInternal(); flagsInternal(flagsInternal() | bits); return old; }
|
|
||||||
inline QT3_SUPPORT int setf(int bits, int mask)
|
|
||||||
{ int old = flagsInternal(); flagsInternal(flagsInternal() | (bits & mask)); return old; }
|
|
||||||
inline QT3_SUPPORT int unsetf(int bits)
|
|
||||||
{ int old = flagsInternal(); flagsInternal(flagsInternal() & ~bits); return old; }
|
|
||||||
|
|
||||||
inline QT3_SUPPORT int width(int w)
|
|
||||||
{ int old = fieldWidth(); setFieldWidth(w); return old; }
|
|
||||||
inline QT3_SUPPORT int fill(int f)
|
|
||||||
{ QChar ch = padChar(); setPadChar(QChar(f)); return ch.unicode(); }
|
|
||||||
inline QT3_SUPPORT int precision(int p)
|
|
||||||
{ int old = realNumberPrecision(); setRealNumberPrecision(p); return old; }
|
|
||||||
|
|
||||||
enum {
|
|
||||||
skipws = 0x0001, // skip whitespace on input
|
|
||||||
left = 0x0002, // left-adjust output
|
|
||||||
right = 0x0004, // right-adjust output
|
|
||||||
internal = 0x0008, // pad after sign
|
|
||||||
bin = 0x0010, // binary format integer
|
|
||||||
oct = 0x0020, // octal format integer
|
|
||||||
dec = 0x0040, // decimal format integer
|
|
||||||
hex = 0x0080, // hex format integer
|
|
||||||
showbase = 0x0100, // show base indicator
|
|
||||||
showpoint = 0x0200, // force decimal point (float)
|
|
||||||
uppercase = 0x0400, // upper-case hex output
|
|
||||||
showpos = 0x0800, // add '+' to positive integers
|
|
||||||
scientific = 0x1000, // scientific float output
|
|
||||||
fixed = 0x2000 // fixed float output
|
|
||||||
};
|
|
||||||
enum {
|
|
||||||
basefield = bin | oct | dec | hex,
|
|
||||||
adjustfield = left | right | internal,
|
|
||||||
floatfield = scientific | fixed
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifndef QT_NO_TEXTCODEC
|
|
||||||
enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
|
|
||||||
UnicodeReverse, RawUnicode, UnicodeUTF8 };
|
|
||||||
QT3_SUPPORT void setEncoding(Encoding encoding);
|
|
||||||
#endif
|
|
||||||
inline QT3_SUPPORT QString read() { return readAll(); }
|
|
||||||
inline QT3_SUPPORT void unsetDevice() { setDevice(0); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
int flagsInternal() const;
|
|
||||||
int flagsInternal(int flags);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DISABLE_COPY(QTextStream)
|
Q_DISABLE_COPY(QTextStream)
|
||||||
|
|
||||||
QScopedPointer<QTextStreamPrivate> d_ptr;
|
QScopedPointer<QTextStreamPrivate> d_ptr;
|
||||||
@ -344,32 +282,6 @@ inline QTextStreamManipulator qSetRealNumberPrecision(int precision)
|
|||||||
return QTextStreamManipulator(func, precision);
|
return QTextStreamManipulator(func, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
typedef QTextStream QTS;
|
|
||||||
|
|
||||||
class Q_CORE_EXPORT QTextIStream : public QTextStream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
inline explicit QTextIStream(const QString *s) : QTextStream(const_cast<QString *>(s), QIODevice::ReadOnly) {}
|
|
||||||
inline explicit QTextIStream(QByteArray *a) : QTextStream(a, QIODevice::ReadOnly) {}
|
|
||||||
inline QTextIStream(FILE *f) : QTextStream(f, QIODevice::ReadOnly) {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Q_DISABLE_COPY(QTextIStream)
|
|
||||||
};
|
|
||||||
|
|
||||||
class Q_CORE_EXPORT QTextOStream : public QTextStream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
inline explicit QTextOStream(QString *s) : QTextStream(s, QIODevice::WriteOnly) {}
|
|
||||||
inline explicit QTextOStream(QByteArray *a) : QTextStream(a, QIODevice::WriteOnly) {}
|
|
||||||
inline QTextOStream(FILE *f) : QTextStream(f, QIODevice::WriteOnly) {}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Q_DISABLE_COPY(QTextOStream)
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
QT_END_HEADER
|
QT_END_HEADER
|
||||||
|
@ -189,9 +189,6 @@
|
|||||||
#include "qstack.h"
|
#include "qstack.h"
|
||||||
#include "qvarlengtharray.h"
|
#include "qvarlengtharray.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
#if defined QT3_SUPPORT
|
|
||||||
#include "qfileinfo.h"
|
|
||||||
#endif
|
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
#include "qtldurl_p.h"
|
#include "qtldurl_p.h"
|
||||||
#endif
|
#endif
|
||||||
@ -6363,35 +6360,6 @@ bool QUrl::isParentOf(const QUrl &childUrl) const
|
|||||||
Use QFileInfo(path()).absolutePath() or QFileInfo(path()) instead.
|
Use QFileInfo(path()).absolutePath() or QFileInfo(path()) instead.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef QT3_SUPPORT
|
|
||||||
void QUrl::setFileName(const QString &txt)
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path());
|
|
||||||
fileInfo.setFile(txt);
|
|
||||||
setPath(fileInfo.filePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QUrl::fileName() const
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path());
|
|
||||||
return fileInfo.fileName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QUrl::dirPath() const
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo(path());
|
|
||||||
if (fileInfo.isAbsolute()) {
|
|
||||||
QString absPath = fileInfo.absolutePath();
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
if (absPath.size() > 1 && absPath.at(1) == QLatin1Char(':'))
|
|
||||||
absPath = absPath.mid(2);
|
|
||||||
#endif
|
|
||||||
return absPath;
|
|
||||||
}
|
|
||||||
return fileInfo.path();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_DATASTREAM
|
#ifndef QT_NO_DATASTREAM
|
||||||
/*! \relates QUrl
|
/*! \relates QUrl
|
||||||
|
@ -221,58 +221,8 @@ public:
|
|||||||
static QStringList idnWhitelist();
|
static QStringList idnWhitelist();
|
||||||
static void setIdnWhitelist(const QStringList &);
|
static void setIdnWhitelist(const QStringList &);
|
||||||
|
|
||||||
#if defined QT3_SUPPORT
|
|
||||||
inline QT3_SUPPORT QString protocol() const { return scheme(); }
|
|
||||||
inline QT3_SUPPORT void setProtocol(const QString &s) { setScheme(s); }
|
|
||||||
inline QT3_SUPPORT void setUser(const QString &s) { setUserName(s); }
|
|
||||||
inline QT3_SUPPORT QString user() const { return userName(); }
|
|
||||||
inline QT3_SUPPORT bool hasUser() const { return !userName().isEmpty(); }
|
|
||||||
inline QT3_SUPPORT bool hasPassword() const { return !password().isEmpty(); }
|
|
||||||
inline QT3_SUPPORT bool hasHost() const { return !host().isEmpty(); }
|
|
||||||
inline QT3_SUPPORT bool hasPort() const { return port() != -1; }
|
|
||||||
inline QT3_SUPPORT bool hasPath() const { return !path().isEmpty(); }
|
|
||||||
inline QT3_SUPPORT void setQuery(const QString &txt)
|
|
||||||
{
|
|
||||||
setEncodedQuery(txt.toLatin1());
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QString query() const
|
|
||||||
{
|
|
||||||
return QString::fromLatin1(encodedQuery().constData());
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT QString ref() const { return fragment(); }
|
|
||||||
inline QT3_SUPPORT void setRef(const QString &txt) { setFragment(txt); }
|
|
||||||
inline QT3_SUPPORT bool hasRef() const { return !fragment().isEmpty(); }
|
|
||||||
inline QT3_SUPPORT void addPath(const QString &p) { setPath(path() + QLatin1Char('/') + p); }
|
|
||||||
QT3_SUPPORT void setFileName(const QString &txt);
|
|
||||||
QT3_SUPPORT QString fileName() const;
|
|
||||||
QT3_SUPPORT QString dirPath() const;
|
|
||||||
static inline QT3_SUPPORT void decode(QString &url)
|
|
||||||
{
|
|
||||||
url = QUrl::fromPercentEncoding(url.toLatin1());
|
|
||||||
}
|
|
||||||
static inline QT3_SUPPORT void encode(QString &url)
|
|
||||||
{
|
|
||||||
url = QString::fromLatin1(QUrl::toPercentEncoding(url).constData());
|
|
||||||
}
|
|
||||||
inline QT3_SUPPORT operator QString() const { return toString(); }
|
|
||||||
inline QT3_SUPPORT bool cdUp()
|
|
||||||
{
|
|
||||||
*this = resolved(QUrl(QLatin1String("..")));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
static inline QT3_SUPPORT bool isRelativeUrl(const QString &url)
|
|
||||||
{
|
|
||||||
return QUrl(url).isRelative();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
|
|
||||||
protected:
|
|
||||||
#if defined (QT3_SUPPORT)
|
|
||||||
inline QT3_SUPPORT void reset() { clear(); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUrlPrivate *d;
|
QUrlPrivate *d;
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user