equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
8 ** |
8 ** |
553 } |
553 } |
554 |
554 |
555 /*! |
555 /*! |
556 \obsolete |
556 \obsolete |
557 |
557 |
|
558 Use QDir::addSearchPath() with a prefix instead. |
|
559 |
558 Adds \a path to the search paths searched in to find resources that are |
560 Adds \a path to the search paths searched in to find resources that are |
559 not specified with an absolute path. The \a path must be an absolute |
561 not specified with an absolute path. The \a path must be an absolute |
560 path (start with \c{/}). |
562 path (start with \c{/}). |
561 |
563 |
562 The default search path is to search only in the root (\c{:/}). The last |
564 The default search path is to search only in the root (\c{:/}). The last |
563 path added will be consulted first upon next QResource creation. |
565 path added will be consulted first upon next QResource creation. |
564 |
566 */ |
565 Use QDir::addSearchPath() with a prefix instead. |
|
566 */ |
|
567 |
|
568 void |
567 void |
569 QResource::addSearchPath(const QString &path) |
568 QResource::addSearchPath(const QString &path) |
570 { |
569 { |
571 if (!path.startsWith(QLatin1Char('/'))) { |
570 if (!path.startsWith(QLatin1Char('/'))) { |
572 qWarning("QResource::addResourceSearchPath: Search paths must be absolute (start with /) [%s]", |
571 qWarning("QResource::addResourceSearchPath: Search paths must be absolute (start with /) [%s]", |
576 QMutexLocker lock(resourceMutex()); |
575 QMutexLocker lock(resourceMutex()); |
577 resourceSearchPaths()->prepend(path); |
576 resourceSearchPaths()->prepend(path); |
578 } |
577 } |
579 |
578 |
580 /*! |
579 /*! |
|
580 \obsolete |
|
581 |
|
582 Use QDir::searchPaths() instead. |
|
583 |
581 Returns the current search path list. This list is consulted when |
584 Returns the current search path list. This list is consulted when |
582 creating a relative resource. |
585 creating a relative resource. |
583 |
586 |
584 \sa QDir::addSearchPath() QDir::setSearchPaths() |
587 \sa QDir::addSearchPath() QDir::setSearchPaths() |
585 */ |
588 */ |
1283 return true; |
1286 return true; |
1284 } |
1287 } |
1285 |
1288 |
1286 bool QResourceFileEngine::flush() |
1289 bool QResourceFileEngine::flush() |
1287 { |
1290 { |
1288 return false; |
1291 return true; |
1289 } |
1292 } |
1290 |
1293 |
1291 qint64 QResourceFileEngine::read(char *data, qint64 len) |
1294 qint64 QResourceFileEngine::read(char *data, qint64 len) |
1292 { |
1295 { |
1293 Q_D(QResourceFileEngine); |
1296 Q_D(QResourceFileEngine); |