# # # patch "src/model/GetAttributes.cpp" # from [788b143a775e678233581e431466c91890124dfd] # to [ef0ce96c1007e2e722d210212154eac682383113] # # patch "src/model/GetAttributes.h" # from [32cd96a45c84b05f2817ec8dad06d068583cf6eb] # to [2db2efdcb1f3cefc6e157461a04953173426f271] # # patch "src/model/Inventory.cpp" # from [32ee297eee600346e5397fd2e0765504aa01919d] # to [cdd2c8db749ff58dd89bc76bf3995e5b7a4de7ce] # # patch "src/model/Inventory.h" # from [3f2a4810860620d0e444c9cd999b3f5b5162163b] # to [915db6a5693802dac41f20d550b54c86e89eb39a] # # patch "src/view/WorkspaceWindow.cpp" # from [8e2d05c91b8f13a2ab34bf3d930f28aeb0a35e51] # to [5ffb067d212df64626931235490caa859ac14328] # ============================================================ --- src/model/GetAttributes.cpp 788b143a775e678233581e431466c91890124dfd +++ src/model/GetAttributes.cpp ef0ce96c1007e2e722d210212154eac682383113 @@ -25,8 +25,8 @@ #include #include -GetAttributes::GetAttributes(QObject * parent, const WorkspacePath & ws) - : QAbstractItemModel(parent), AutomateCommand(0), workspacePath(ws) +GetAttributes::GetAttributes(QObject * parent) + : QAbstractItemModel(parent), AutomateCommand(0), workspacePath() { attributes = new AttributeList(); } @@ -43,9 +43,15 @@ void GetAttributes::revert() path = QString(); reset(); } +void GetAttributes::setWorkspacePath(const WorkspacePath & ws) +{ + workspacePath = ws; +} void GetAttributes::readAttributes(const QString & p) { + I(!workspacePath.isEmpty()); + // clear current attributes list attributes->clear(); // reset the view ============================================================ --- src/model/GetAttributes.h 32cd96a45c84b05f2817ec8dad06d068583cf6eb +++ src/model/GetAttributes.h 2db2efdcb1f3cefc6e157461a04953173426f271 @@ -36,7 +36,7 @@ public: { Q_OBJECT public: - GetAttributes(QObject *, const WorkspacePath &); + GetAttributes(QObject *); virtual ~GetAttributes(); // needed Qt Model methods @@ -53,6 +53,7 @@ public slots: inline bool attributesLoaded() const { return !path.isEmpty(); } public slots: + void setWorkspacePath(const WorkspacePath &); void readAttributes(const QString &); void revert(); ============================================================ --- src/model/Inventory.cpp 32ee297eee600346e5397fd2e0765504aa01919d +++ src/model/Inventory.cpp cdd2c8db749ff58dd89bc76bf3995e5b7a4de7ce @@ -25,8 +25,8 @@ #include -Inventory::Inventory(QObject * parent, const WorkspacePath & ws) - : QAbstractItemModel(parent), AutomateCommand(0), workspacePath(ws) +Inventory::Inventory(QObject * parent) + : QAbstractItemModel(parent), AutomateCommand(0), workspacePath() { // create a dummy item since the view needs at least one item // in the model, otherwise the app crashes @@ -46,8 +46,14 @@ Inventory::~Inventory() delete regex; } +void Inventory::setWorkspacePath(const WorkspacePath & ws) +{ + workspacePath = ws; +} + void Inventory::readInventory() { + I(!workspacePath.isEmpty()); MonotoneTask task(QStringList() << "inventory"); AutomateCommand::enqueueWorkspaceTask(workspacePath, task); } ============================================================ --- src/model/Inventory.h 3f2a4810860620d0e444c9cd999b3f5b5162163b +++ src/model/Inventory.h 915db6a5693802dac41f20d550b54c86e89eb39a @@ -32,7 +32,7 @@ public: { Q_OBJECT public: - Inventory(QObject *, const WorkspacePath &); + Inventory(QObject *); ~Inventory(); QMap findUnaccountedRenames(); @@ -49,6 +49,7 @@ public slots: int columnCount(const QModelIndex &) const; public slots: + void setWorkspacePath(const WorkspacePath &); void readInventory(); private: ============================================================ --- src/view/WorkspaceWindow.cpp 8e2d05c91b8f13a2ab34bf3d930f28aeb0a35e51 +++ src/view/WorkspaceWindow.cpp 5ffb067d212df64626931235490caa859ac14328 @@ -153,8 +153,8 @@ void WorkspaceWindow::setup() listSplitter->init(); // models - invModel = new Inventory(this, workspacePath); - attrModel = new GetAttributes(this, workspacePath); + invModel = new Inventory(this); + attrModel = new GetAttributes(this); proxyModelFolderTree = new InventoryProxyModel(this, true); proxyModelFileList = new InventoryProxyModel(this, false); @@ -219,6 +219,9 @@ void WorkspaceWindow::load(const QString throw e; } + invModel->setWorkspacePath(workspacePath); + attrModel->setWorkspacePath(workspacePath); + // read the inventory invModel->readInventory();