# # # rename "src/model/Attributes.cpp" # to "src/model/GetAttributes.cpp" # # rename "src/model/Attributes.h" # to "src/model/GetAttributes.h" # # patch "guitone.pro" # from [a5804ea420bcf84ab3a55d21a5fd495809dc6989] # to [c11bc3fb57e03c3f13033bb24188b9eb6abd6924] # # patch "src/model/GetAttributes.cpp" # from [aebaba821284e215181dd48f905cca2a112040f7] # to [dd05d9f07c224950e04d0365ecec2dbf2aad251a] # # patch "src/model/GetAttributes.h" # from [a4d4844a547daa12380f96da44609c627e859b25] # to [b6e49201bf220ba5b56af673ae64f5d860c66df1] # # patch "src/monotone/Monotone.cpp" # from [bf0017135a0ae4004bf096f028df40f73699f31d] # to [5464a4a21288891c7da8d95d84bccef25cb45beb] # # patch "src/view/MainWindow.cpp" # from [7064dcc81b11c6991521f64da0762beb9a347350] # to [79df09cea17cb3370404a769946f4b2f0c8de9c4] # # patch "src/view/MainWindow.h" # from [ed423769deea41872ede542b5920a765f790a38a] # to [7b4ca503131853dfb98f4057c543a37cd63b3f16] # ============================================================ --- guitone.pro a5804ea420bcf84ab3a55d21a5fd495809dc6989 +++ guitone.pro c11bc3fb57e03c3f13033bb24188b9eb6abd6924 @@ -45,7 +45,7 @@ HEADERS = src/view/MainWindow.h \ src/model/Inventory.h \ src/model/InventoryItem.h \ src/model/InventoryProxyModel.h \ - src/model/Attributes.h \ + src/model/GetAttributes.h \ src/model/Select.h \ src/model/Certs.h \ src/model/ContentDiff.h \ @@ -106,7 +106,7 @@ SOURCES += src/view/MainWindow.cpp \ src/model/Inventory.cpp \ src/model/InventoryItem.cpp \ src/model/InventoryProxyModel.cpp \ - src/model/Attributes.cpp \ + src/model/GetAttributes.cpp \ src/model/Select.cpp \ src/model/Certs.cpp \ src/model/ContentDiff.cpp \ ============================================================ --- src/model/Attributes.cpp aebaba821284e215181dd48f905cca2a112040f7 +++ src/model/GetAttributes.cpp dd05d9f07c224950e04d0365ecec2dbf2aad251a @@ -18,28 +18,28 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "Attributes.h" +#include "GetAttributes.h" #include "InventoryItem.h" #include "Monotone.h" #include "BasicIOParser.h" #include -Attributes::Attributes(QObject *parent) +GetAttributes::GetAttributes(QObject *parent) : QAbstractItemModel(parent) { attributes = new AttributeList(); mtnDelegate = new MonotoneDelegate(this); } -Attributes::~Attributes() +GetAttributes::~GetAttributes() { attributes->clear(); delete attributes; delete mtnDelegate; } -bool Attributes::readAttributes(const QModelIndex & index) +bool GetAttributes::readAttributes(const QModelIndex & index) { // convert ProxyModel index to real Model index QModelIndex sourceIndex = static_cast(index.model())->mapToSource(index); @@ -64,13 +64,13 @@ bool Attributes::readAttributes(const QM } QStringList cmd; - cmd.append("attributes"); + cmd.append("get_attributes"); cmd.append(item->getPath()); return mtnDelegate->triggerCommand(cmd); } -void Attributes::parseOutput() +void GetAttributes::parseOutput() { BasicIOParser parser(AutomateCommand::data); I(parser.parse()); @@ -143,12 +143,12 @@ void Attributes::parseOutput() emit attributesRead(); } -int Attributes::columnCount(const QModelIndex &parent) const +int GetAttributes::columnCount(const QModelIndex &parent) const { return 3; } -QVariant Attributes::data(const QModelIndex &index, int role) const +QVariant GetAttributes::data(const QModelIndex &index, int role) const { if (!index.isValid()) { @@ -182,14 +182,14 @@ QVariant Attributes::data(const QModelIn return QVariant(); } -Qt::ItemFlags Attributes::flags(const QModelIndex &index) const +Qt::ItemFlags GetAttributes::flags(const QModelIndex &index) const { // TODO: add ItemIsEditable as soon as we can set/drop attributes through // the automation interface, implement setData() then as well return Qt::ItemIsEnabled | Qt::ItemIsSelectable; } -QVariant Attributes::headerData(int section, Qt::Orientation orientation, int role) const +QVariant GetAttributes::headerData(int section, Qt::Orientation orientation, int role) const { if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { @@ -203,17 +203,17 @@ QVariant Attributes::headerData(int sect return QVariant(); } -int Attributes::rowCount(const QModelIndex& parent) const +int GetAttributes::rowCount(const QModelIndex& parent) const { return attributes->size(); } -QModelIndex Attributes::index(int row, int column, const QModelIndex& parent) const +QModelIndex GetAttributes::index(int row, int column, const QModelIndex& parent) const { return hasIndex(row, column, parent) ? createIndex(row, column, 0) : QModelIndex(); } -QModelIndex Attributes::parent(const QModelIndex& index) const +QModelIndex GetAttributes::parent(const QModelIndex& index) const { return QModelIndex(); } ============================================================ --- src/model/Attributes.h a4d4844a547daa12380f96da44609c627e859b25 +++ src/model/GetAttributes.h b6e49201bf220ba5b56af673ae64f5d860c66df1 @@ -18,11 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -// TODO: enable editing of items as well as dropping/adding them +#ifndef GETATTRIBUTES_H +#define GETATTRIBUTES_H -#ifndef ATTRIBUTES_H -#define ATTRIBUTES_H - #include "AutomateCommand.h" #include "MonotoneDelegate.h" @@ -35,12 +33,12 @@ typedef QList AttributeList; } Attribute; typedef QList AttributeList; -class Attributes : public QAbstractItemModel, public AutomateCommand +class GetAttributes : public QAbstractItemModel, public AutomateCommand { Q_OBJECT public: - Attributes(QObject*); - virtual ~Attributes(); + GetAttributes(QObject*); + virtual ~GetAttributes(); // needed Qt Model methods QVariant data(const QModelIndex&, int) const; ============================================================ --- src/monotone/Monotone.cpp bf0017135a0ae4004bf096f028df40f73699f31d +++ src/monotone/Monotone.cpp 5464a4a21288891c7da8d95d84bccef25cb45beb @@ -88,8 +88,8 @@ // - if not, we additionally check the interface version in case the user // compiled his own version with all needed commands // -const QString Monotone::RequiredProgramVersion = "0.35"; -const QString Monotone::RequiredInterfaceVersion = "4.2"; +const QString Monotone::RequiredProgramVersion = "0.36"; +const QString Monotone::RequiredInterfaceVersion = "5.0"; const int Monotone::StdioBufferSize = 50 * 1024 * 1024; const int Monotone::WaitForMonotoneStart = 15000; // milliseconds ============================================================ --- src/view/MainWindow.cpp 7064dcc81b11c6991521f64da0762beb9a347350 +++ src/view/MainWindow.cpp 79df09cea17cb3370404a769946f4b2f0c8de9c4 @@ -22,7 +22,7 @@ #include "Monotone.h" #include "Inventory.h" #include "InventoryItem.h" -#include "Attributes.h" +#include "GetAttributes.h" #include "InventoryProxyModel.h" #include "Splitter.h" #include "InventoryView.h" @@ -68,7 +68,7 @@ MainWindow::MainWindow() // create the main models invModel = new Inventory(this); - attrModel = new Attributes(this); + attrModel = new GetAttributes(this); connect( invModel, SIGNAL(invalidWorkspaceFormat(const QString &)), ============================================================ --- src/view/MainWindow.h ed423769deea41872ede542b5920a765f790a38a +++ src/view/MainWindow.h 7b4ca503131853dfb98f4057c543a37cd63b3f16 @@ -26,7 +26,7 @@ class Inventory; class QModelIndex; class Inventory; -class Attributes; +class GetAttributes; class InventoryProxyModel; class InventoryView; class AttributesView; @@ -87,10 +87,10 @@ private: void closeEvent(QCloseEvent *); void switchMode(Mode); - Inventory *invModel; - Attributes *attrModel; - InventoryProxyModel *proxyModelFolderTree; - InventoryProxyModel *proxyModelFileList; + Inventory * invModel; + GetAttributes * attrModel; + InventoryProxyModel * proxyModelFolderTree; + InventoryProxyModel * proxyModelFileList; Mode mode; int closeCounter; };