refactored item type; moved navigation to qml component
This commit is contained in:
parent
a32fd01e81
commit
bf145a9be9
7 changed files with 54 additions and 55 deletions
|
|
@ -20,7 +20,7 @@ void NavigationController::init(const QString &rootPath)
|
|||
if(!rootDir.exists()) return;
|
||||
mRootPath = rootPath;
|
||||
|
||||
add(mRootPath, mRootItem, true);
|
||||
add(mRootPath, mRootItem);
|
||||
|
||||
mNavList->setModelItems(mRootItem->getChildren());
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ void NavigationController::setContextProperties()
|
|||
mContext->setContextProperty("navigationList", mNavList);
|
||||
}
|
||||
|
||||
void NavigationController::add(const QString &path, NavigationItemModel *parentItem, bool isCircleDelegate)
|
||||
void NavigationController::add(const QString &path, NavigationItemModel *parentItem)
|
||||
{
|
||||
auto dir = QDir(path);
|
||||
if(!dir.exists()) return;
|
||||
|
|
@ -50,10 +50,9 @@ void NavigationController::add(const QString &path, NavigationItemModel *parentI
|
|||
item->deleteLater();
|
||||
continue;
|
||||
}
|
||||
item->setCircleDelegate(isCircleDelegate);
|
||||
connect(item, &NavigationItemModel::clicked, this, &NavigationController::onNavigationRequest);
|
||||
parentItem->appendChild(item);
|
||||
add(item->getPath(), item, false);
|
||||
add(item->getPath(), item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue