Commit c722282c authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlProjectManager: Rename 'libraryPaths' property to 'importPaths'

Suggested by Erik Verbruggen
parent bffeb830
...@@ -9,7 +9,7 @@ class QmlProjectItemPrivate : public QObject { ...@@ -9,7 +9,7 @@ class QmlProjectItemPrivate : public QObject {
public: public:
QString sourceDirectory; QString sourceDirectory;
QStringList libraryPaths; QStringList importPaths;
QList<QmlFileFilterItem*> qmlFileFilters() const; QList<QmlFileFilterItem*> qmlFileFilters() const;
...@@ -79,21 +79,21 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath) ...@@ -79,21 +79,21 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath)
emit sourceDirectoryChanged(); emit sourceDirectoryChanged();
} }
QStringList QmlProjectItem::libraryPaths() const QStringList QmlProjectItem::importPaths() const
{ {
Q_D(const QmlProjectItem); Q_D(const QmlProjectItem);
return d->libraryPaths; return d->importPaths;
} }
void QmlProjectItem::setLibraryPaths(const QStringList &libraryPaths) void QmlProjectItem::setImportPaths(const QStringList &libraryPaths)
{ {
Q_D(QmlProjectItem); Q_D(QmlProjectItem);
if (d->libraryPaths == libraryPaths) if (d->importPaths == libraryPaths)
return; return;
d->libraryPaths = libraryPaths; d->importPaths = libraryPaths;
emit libraryPathsChanged(); emit importPathsChanged();
} }
/* Returns list of absolute paths */ /* Returns list of absolute paths */
......
...@@ -24,7 +24,7 @@ class QmlProjectItem : public QObject { ...@@ -24,7 +24,7 @@ class QmlProjectItem : public QObject {
Q_PROPERTY(QDeclarativeListProperty<QmlProjectManager::QmlProjectContentItem> content READ content DESIGNABLE false) Q_PROPERTY(QDeclarativeListProperty<QmlProjectManager::QmlProjectContentItem> content READ content DESIGNABLE false)
Q_PROPERTY(QString sourceDirectory READ sourceDirectory NOTIFY sourceDirectoryChanged) Q_PROPERTY(QString sourceDirectory READ sourceDirectory NOTIFY sourceDirectoryChanged)
Q_PROPERTY(QStringList libraryPaths READ libraryPaths WRITE setLibraryPaths NOTIFY libraryPathsChanged) Q_PROPERTY(QStringList importPaths READ importPaths WRITE setImportPaths NOTIFY importPathsChanged)
Q_CLASSINFO("DefaultProperty", "content"); Q_CLASSINFO("DefaultProperty", "content");
...@@ -37,8 +37,8 @@ public: ...@@ -37,8 +37,8 @@ public:
QString sourceDirectory() const; QString sourceDirectory() const;
void setSourceDirectory(const QString &directoryPath); void setSourceDirectory(const QString &directoryPath);
QStringList libraryPaths() const; QStringList importPaths() const;
void setLibraryPaths(const QStringList &paths); void setImportPaths(const QStringList &paths);
QStringList files() const; QStringList files() const;
bool matchesFile(const QString &filePath) const; bool matchesFile(const QString &filePath) const;
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
signals: signals:
void qmlFilesChanged(); void qmlFilesChanged();
void sourceDirectoryChanged(); void sourceDirectoryChanged();
void libraryPathsChanged(); void importPathsChanged();
protected: protected:
QmlProjectItemPrivate *d_ptr; QmlProjectItemPrivate *d_ptr;
......
...@@ -169,7 +169,7 @@ QStringList QmlProject::libraryPaths() const ...@@ -169,7 +169,7 @@ QStringList QmlProject::libraryPaths() const
{ {
QStringList libraryPaths; QStringList libraryPaths;
if (m_projectItem) if (m_projectItem)
libraryPaths = m_projectItem.data()->libraryPaths(); libraryPaths = m_projectItem.data()->importPaths();
return libraryPaths; return libraryPaths;
} }
......
...@@ -250,7 +250,7 @@ void TestProject::testLibraryPaths() ...@@ -250,7 +250,7 @@ void TestProject::testLibraryPaths()
QString projectFile = QLatin1String( QString projectFile = QLatin1String(
"import QmlProject 1.0\n" "import QmlProject 1.0\n"
"Project {\n" "Project {\n"
" libraryPaths: [ \"../otherLibrary\", \"library\" ]\n" " importPaths: [ \"../otherLibrary\", \"library\" ]\n"
"}\n"); "}\n");
{ {
...@@ -268,7 +268,7 @@ void TestProject::testLibraryPaths() ...@@ -268,7 +268,7 @@ void TestProject::testLibraryPaths()
QStringList expectedPaths(QStringList() << "../otherLibrary" QStringList expectedPaths(QStringList() << "../otherLibrary"
<< "library"); << "library");
QCOMPARE(project->libraryPaths().toSet(), expectedPaths.toSet()); QCOMPARE(project->importPaths().toSet(), expectedPaths.toSet());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment