# # # patch "src/model/Inventory.cpp" # from [0b85908036de2c631f54520b95647496d4da7e94] # to [f6295d690ed7e9bface0c929f457ab71242b75ba] # # patch "src/model/Inventory.h" # from [5d55d16c1fea9407de59a2c88b040f906f57bb3d] # to [a710182d3bbcf99d9992dcc710a6c67d0d14148b] # ============================================================ --- src/model/Inventory.cpp 0b85908036de2c631f54520b95647496d4da7e94 +++ src/model/Inventory.cpp f6295d690ed7e9bface0c929f457ab71242b75ba @@ -31,7 +31,7 @@ Inventory::Inventory(QObject * parent) connect( this, SIGNAL(modelCreated()), - this, SLOT(loadBranchName()) + this, SLOT(setWorkspacePath()) ); } @@ -100,11 +100,22 @@ void Inventory::processTaskResult(const emit modelCreated(); } -void Inventory::loadBranchName() +void Inventory::setWorkspacePath() { QList children = rootItem->getChildren(); - I(children.size() > 0); - children[0]->setLabel(MonotoneUtil::getBranchName(workspacePath)); + + // the first item is the cdup pseudo item + I(children.size() > 1); + + QString displayPath = workspacePath; + QString homePath = QDir::homePath(); + if (workspacePath.indexOf(homePath) == 0) + { + displayPath = QDir(homePath).relativeFilePath(workspacePath); + displayPath.prepend("~/"); + } + children[1]->setLabel(displayPath); + dataChanged(index(0, 0, QModelIndex()), index(0, 2, QModelIndex())); } ============================================================ --- src/model/Inventory.h 5d55d16c1fea9407de59a2c88b040f906f57bb3d +++ src/model/Inventory.h a710182d3bbcf99d9992dcc710a6c67d0d14148b @@ -58,7 +58,7 @@ private slots: WorkspacePath workspacePath; private slots: - void loadBranchName(); + void setWorkspacePath(); signals: void modelCreated();