Loading mtp/MtpStorage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ int MtpStorage::renameObject(MtpObjectHandle handle, std::string newName) { std::string newFullName = parentdir + "/" + newName; MTPD("old: '%s', new: '%s'\n", oldName.c_str(), newFullName.c_str()); if (rename(oldName.c_str(), newFullName.c_str()) == 0) { node->setPath(newFullName); node->rename(newFullName); return 0; } else { MTPE("MtpStorage::renameObject failed, handle: %d, new name: '%s'\n", handle, newName.c_str()); Loading mtp/btree.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public: Node(); void setMtpid(int aMtpid); void setPath(std::string aPath); void rename(std::string aPath); void setLeft(Node* aLeft); void setRight(Node* aRight); void setParent(Node* aParent); Loading mtp/node.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,12 @@ Node::Node() { void Node::setMtpid(int aMtpid) { mtpid = aMtpid; } void Node::setPath(std::string aPath) { path = aPath; } void Node::rename(std::string aPath) { path = aPath; updateProperty(MTP_PROPERTY_OBJECT_FILE_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); updateProperty(MTP_PROPERTY_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); updateProperty(MTP_PROPERTY_DISPLAY_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); } void Node::setLeft(Node* aLeft) { left = aLeft; } void Node::setRight(Node* aRight) { right = aRight; } void Node::setParent(Node* aParent) { parent = aParent; } Loading Loading
mtp/MtpStorage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -644,7 +644,7 @@ int MtpStorage::renameObject(MtpObjectHandle handle, std::string newName) { std::string newFullName = parentdir + "/" + newName; MTPD("old: '%s', new: '%s'\n", oldName.c_str(), newFullName.c_str()); if (rename(oldName.c_str(), newFullName.c_str()) == 0) { node->setPath(newFullName); node->rename(newFullName); return 0; } else { MTPE("MtpStorage::renameObject failed, handle: %d, new name: '%s'\n", handle, newName.c_str()); Loading
mtp/btree.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public: Node(); void setMtpid(int aMtpid); void setPath(std::string aPath); void rename(std::string aPath); void setLeft(Node* aLeft); void setRight(Node* aRight); void setParent(Node* aParent); Loading
mtp/node.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,12 @@ Node::Node() { void Node::setMtpid(int aMtpid) { mtpid = aMtpid; } void Node::setPath(std::string aPath) { path = aPath; } void Node::rename(std::string aPath) { path = aPath; updateProperty(MTP_PROPERTY_OBJECT_FILE_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); updateProperty(MTP_PROPERTY_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); updateProperty(MTP_PROPERTY_DISPLAY_NAME, 0, basename(aPath.c_str()), MTP_TYPE_STR); } void Node::setLeft(Node* aLeft) { left = aLeft; } void Node::setRight(Node* aRight) { right = aRight; } void Node::setParent(Node* aParent) { parent = aParent; } Loading