Add libraryPaths array to Project element (.qmlproject format)

Will be passed to qmlviewer with the "-L" option. Storing this in
the .qmlproject file format itself (and not in the .user file) is useful
in case the libraries are relative/part of the checkout that is shared
between users/computers.
This commit is contained in:
Kai Koehne
2010-02-03 08:59:38 +01:00
parent fbee8695d7
commit 8577347446
4 changed files with 55 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ class QmlProjectItemPrivate : public QObject {
public:
QString sourceDirectory;
QStringList libraryPaths;
QList<QmlFileFilterItem*> qmlFileFilters() const;
@@ -78,6 +79,23 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath)
emit sourceDirectoryChanged();
}
QStringList QmlProjectItem::libraryPaths() const
{
const Q_D(QmlProjectItem);
return d->libraryPaths;
}
void QmlProjectItem::setLibraryPaths(const QStringList &libraryPaths)
{
Q_D(QmlProjectItem);
if (d->libraryPaths == libraryPaths)
return;
d->libraryPaths = libraryPaths;
emit libraryPathsChanged();
}
/* Returns list of absolute paths */
QStringList QmlProjectItem::files() const
{

View File

@@ -23,6 +23,7 @@ class QmlProjectItem : public QObject {
Q_PROPERTY(QmlList<QmlProjectManager::QmlProjectContentItem*> *content READ content DESIGNABLE false)
Q_PROPERTY(QString sourceDirectory READ sourceDirectory NOTIFY sourceDirectoryChanged)
Q_PROPERTY(QStringList libraryPaths READ libraryPaths WRITE setLibraryPaths NOTIFY libraryPathsChanged)
Q_CLASSINFO("DefaultProperty", "content");
@@ -35,11 +36,15 @@ public:
QString sourceDirectory() const;
void setSourceDirectory(const QString &directoryPath);
QStringList libraryPaths() const;
void setLibraryPaths(const QStringList &paths);
QStringList files() const;
signals:
void qmlFilesChanged();
void sourceDirectoryChanged();
void libraryPathsChanged();
protected:
QmlProjectItemPrivate *d_ptr;