OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / lanes.cpp
index 43e561a..05542fb 100644 (file)
@@ -12,7 +12,7 @@
 #define IS_NODE(x) (x == NODE || x == NODE_R || x == NODE_L)\r
 \r
 \r
-void Lanes::init(const QString& expectedSha) {\r
+void Lanes::init(const CGitHash& expectedSha) {\r
 \r
        clear();\r
        activeLane = 0;\r
@@ -38,7 +38,7 @@ void Lanes::setBoundary(bool b) {
                typeVec[activeLane] = BOUNDARY;\r
 }\r
 \r
-bool Lanes::isFork(const QString& sha, bool& isDiscontinuity) {\r
+bool Lanes::isFork(const CGitHash& sha, bool& isDiscontinuity) {\r
 \r
        int pos = findNextSha(sha, 0);\r
        isDiscontinuity = (activeLane != pos);\r
@@ -58,7 +58,7 @@ bool Lanes::isFork(const QString& sha, bool& isDiscontinuity) {
 */\r
 }\r
 \r
-void Lanes::setFork(const QString& sha) {\r
+void Lanes::setFork(const CGitHash& sha) {\r
 \r
        int rangeStart, rangeEnd, idx;\r
        rangeStart = rangeEnd = idx = findNextSha(sha, 0);\r
@@ -97,7 +97,7 @@ void Lanes::setFork(const QString& sha) {
        }\r
 }\r
 \r
-void Lanes::setMerge(const QStringList& parents) {\r
+void Lanes::setMerge(const CGitHashList& parents) {\r
 // setFork() must be called before setMerge()\r
 \r
        if (boundary)\r
@@ -112,7 +112,7 @@ void Lanes::setMerge(const QStringList& parents) {
        t = NODE;\r
 \r
        int rangeStart = activeLane, rangeEnd = activeLane;\r
-       QStringList::const_iterator it(parents.begin());\r
+       CGitHashList::const_iterator it(parents.begin());\r
        for (++it; it != parents.end(); ++it) { // skip first parent\r
 \r
                int idx = findNextSha(*it, 0);\r
@@ -183,7 +183,7 @@ void Lanes::setApplied() {
        typeVec[activeLane] = APPLIED; // TODO test with boundaries\r
 }\r
 \r
-void Lanes::changeActiveLane(const QString& sha) {\r
+void Lanes::changeActiveLane(const CGitHash& sha) {\r
 \r
        int& t = typeVec[activeLane];\r
        if (t == INITIAL || isBoundary(t))\r
@@ -256,12 +256,15 @@ void Lanes::afterApplied() {
        typeVec[activeLane] = ACTIVE; // TODO test with boundaries\r
 }\r
 \r
-void Lanes::nextParent(const QString& sha) {\r
+void Lanes::nextParent(const CGitHash& sha) {\r
 \r
-       nextShaVec[activeLane] = (boundary ? QString(_T("")) : sha);\r
+       if(boundary)\r
+               nextShaVec[activeLane].Empty();\r
+       else\r
+               nextShaVec[activeLane] = sha;\r
 }\r
 \r
-int Lanes::findNextSha(const QString& next, int pos) {\r
+int Lanes::findNextSha(const CGitHash& next, int pos) {\r
 \r
        for (unsigned int i = pos; i < nextShaVec.size(); i++)\r
                if (nextShaVec[i] == next)\r
@@ -277,7 +280,7 @@ int Lanes::findType(int type, int pos) {
        return -1;\r
 }\r
 \r
-int Lanes::add(int type, const QString& next, int pos) {\r
+int Lanes::add(int type, const CGitHash& next, int pos) {\r
 \r
        // first check empty lanes starting from pos\r
        if (pos < (int)typeVec.size()) {\r