00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <kdebug.h>
00013 #include <qtextstream.h>
00014 #include "filebuffer.h"
00015 #include <qmessagebox.h>
00016
00020 FileBuffer::~FileBuffer()
00021
00022 {
00023 for ( FileBufferList::Iterator it = m_subBuffers.begin(); it != m_subBuffers.end(); ++it )
00024 delete *it;
00025 for ( ValuesIgnoreList::Iterator it = m_valuesIgnore.begin(); it != m_valuesIgnore.end(); ++it )
00026 delete *it;
00027 m_subBuffers.clear();
00028 }
00029
00037 Caret FileBuffer::findInBuffer(const QString &subString,const Caret& startPos, bool nvlToMax, bool searchForVariable)
00038
00039 {
00040
00041
00042 unsigned int i=startPos.m_row;
00043 if (!m_buffer.count())
00044 if (nvlToMax)
00045 return Caret(m_buffer.count(),0);
00046 else
00047 return Caret(-1,-1); QString line = m_buffer[i++];
00048 line = line.mid(startPos.m_idx,line.length()-startPos.m_idx);
00049 for (; i<=m_buffer.count(); ++i)
00050 {
00051 int idxSeek = line.find(subString);
00052
00053 if ((line.find(subString)!=-1)
00054
00055
00056 && ( ! (searchForVariable && line[idxSeek+subString.length()].isLetterOrNumber()) ) )
00057 {
00058
00059
00060 if (startPos.m_row == (int) i-1)
00061
00062 idxSeek = idxSeek + startPos.m_idx;
00063 return Caret(i-1,idxSeek);
00064 }
00065 if (i<m_buffer.count())
00066 line = m_buffer[i];
00067 }
00068 if (nvlToMax)
00069 return Caret(m_buffer.count(),0);
00070 else
00071 return Caret(-1,-1);
00072 }
00073
00078 void FileBuffer::removeComments()
00079
00080 {
00081 for (uint i=0; i<m_buffer.count(); ++i)
00082 {
00083 QString tmp = m_buffer[i].simplifyWhiteSpace();
00084 if (tmp[0]=='#')
00085 {
00086 pop(i);
00087 --i;
00088 }
00089 }
00090
00091 }
00092
00093
00098 QString FileBuffer::pop(int row)
00099
00100 {
00101 if ((unsigned int)row>=m_buffer.count())
00102 return NULL;
00103 QStringList::Iterator it=m_buffer.begin();
00104 for (int i=0; i<row; ++it,++i);
00105 QString ReturnStr = *it;
00106 m_buffer.remove(it);
00107 return ReturnStr;
00108 }
00109
00113 void FileBuffer::splitScopeString(QString scopeString,QString &scopeName, QString &scopeRest)
00114
00115 {
00116 scopeString = scopeString.simplifyWhiteSpace();
00117 scopeName="";
00118 scopeRest="";
00119 if (!scopeString.isEmpty())
00120 {
00121 int kolonPos = scopeString.find(':');
00122 if (kolonPos==-1)
00123 scopeName = scopeString;
00124 else
00125 {
00126 scopeName = scopeString.left(kolonPos).simplifyWhiteSpace();
00127 scopeRest = scopeString.right(scopeString.length()-kolonPos-1);
00128 }
00129 }
00130 }
00131
00136 FileBuffer* FileBuffer::getSubBuffer(QString scopeString)
00137
00138 {
00139 QString nextScopeName,scopeStringRest;
00140 splitScopeString(scopeString,nextScopeName,scopeStringRest);
00141 if (nextScopeName.isEmpty())
00142 return this;
00143 int idx = findChildBuffer(nextScopeName);
00144 if (idx==-1)
00145 return NULL;
00146 return m_subBuffers[idx]->getSubBuffer(scopeStringRest);
00147 }
00148
00152 void FileBuffer::setValues(const QString &variable,QStringList values,FileBuffer::ValueSetMode append, int valuesPerRow)
00153
00154 {
00155 QStringList temp;
00156 unsigned int i;
00157 QString line;
00158 ValuesIgnore* valIgnore = getValuesIgnore(variable);
00159 if (append == VSM_APPEND)
00160 {
00161 line = variable + " += ";
00162 values += valIgnore->values;
00163 }
00164 else if (append == VSM_RESET)
00165 {
00166 line = variable + " = ";
00167 values += valIgnore->values;
00168 }
00169 else if (append == VSM_EXCLUDE)
00170 {
00171 line = variable + " -= ";
00172 values += valIgnore->values_exclude;
00173 }
00174 QString spacing;
00175 spacing.fill(' ',line.length());
00176
00177 for (i=0; i<values.count(); ++i)
00178 {
00179 line = line + values[i] + " ";
00180 if (!((i+1) % valuesPerRow))
00181 {
00182 if (i != values.count()-1)
00183 line = line + "\\";
00184 temp.append(line);
00185 line = spacing;
00186 }
00187 }
00188
00189 if (i % valuesPerRow)
00190 temp.append( line );
00191
00192
00193 for ( int i = temp.count()-1; i >= 0; i-- )
00194 m_buffer.prepend( temp[i] );
00195 }
00196
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00249 bool FileBuffer::getValues(const QString &variable, QStringList &plusList, QStringList &minusList)
00250
00251 {
00252 Caret curPos(0,0);
00253 QStringList plusValues;
00254 QStringList minusValues;
00255 QStringList curValues;
00256 QStringList curValuesIgnore;
00257 bool finished = false;
00258 while (!finished)
00259 {
00260 Caret variablePos(findInBuffer(variable,curPos,false,true));
00261 if (variablePos==Caret(-1,-1))
00262 {
00263 finished=true;
00264 continue;
00265 }
00266 Caret eqSign = findInBuffer("=",variablePos);
00267 if (eqSign.m_row != variablePos.m_row)
00268 {
00269 curPos = Caret(variablePos)+Caret(1,0);
00270 continue;
00271 }
00272 QString line=m_buffer[eqSign.m_row];
00273 QChar effectOperator = line[eqSign.m_idx-1];
00274 int lineNum=eqSign.m_row;
00275 curValues.clear();
00276 curValuesIgnore.clear();
00277 line = line.mid(eqSign.m_idx+1,line.length()-eqSign.m_idx);
00278 filterOutIgnoreValues(line,curValuesIgnore);
00279 while (!line.isEmpty())
00280 {
00281 if (line[line.length()-1]=='\\')
00282 {
00283 line = line.left(line.length()-1).simplifyWhiteSpace();
00284 curValues += QStringList::split(" ",line);
00285 lineNum++;
00286 line = m_buffer[lineNum];
00287 filterOutIgnoreValues(line,curValuesIgnore);
00288 continue;
00289 }
00290 curValues += QStringList::split(" ",line);
00291 line = "";
00292 }
00293 if (QString("+-*~").find(effectOperator)==-1)
00294 {
00295
00296
00297 getValuesIgnore(variable)->values.clear();
00298 getValuesIgnore(variable)->values_exclude.clear();
00299 plusValues.clear();
00300 minusValues.clear();
00301 }
00302 if (effectOperator=='-')
00303 {
00304
00305 for (uint i=0; i<curValues.count(); ++i)
00306 plusValues.remove(curValues[i]);
00307
00308 for (uint i=0; i<curValuesIgnore.count(); ++i)
00309 getValuesIgnore(variable)->values.remove(curValuesIgnore[i]);
00310
00311 getValuesIgnore(variable)->values_exclude += curValuesIgnore;
00312 minusValues += curValues;
00313 }
00314 else
00315 {
00316
00317 for (uint i=0; i<curValues.count(); ++i)
00318 minusValues.remove(curValues[i]);
00319
00320 for (uint i=0; i<curValuesIgnore.count(); ++i)
00321 getValuesIgnore(variable)->values_exclude.remove(curValuesIgnore[i]);
00322
00323 getValuesIgnore(variable)->values += curValuesIgnore;
00324 plusValues += curValues;
00325 }
00326 curPos = Caret(lineNum+1,0);
00327 }
00328 plusList = plusValues;
00329 minusList = minusValues;
00330 return true;
00331 }
00332
00336 void FileBuffer::getVariableValueSetModes(const QString &variable,QPtrList<FileBuffer::ValueSetMode> &modes)
00337
00338 {
00339 Caret curPos(0,0);
00340 bool finished = false;
00341
00342 for (int i=0; !finished; ++i)
00343 {
00344 Caret variablePos(findInBuffer(variable,curPos,false,true));
00345 if (variablePos==Caret(-1,-1))
00346 {
00347 finished=true;
00348 continue;
00349 }
00350
00351 Caret eqSign = findInBuffer("=",variablePos);
00352 if (eqSign.m_row != variablePos.m_row)
00353 {
00354 curPos = Caret(variablePos)+Caret(1,0);
00355 continue;
00356 }
00357
00358 QString line=m_buffer[eqSign.m_row];
00359 QChar effectOperator = line[eqSign.m_idx-1];
00360 int lineNum=eqSign.m_row;
00361 line = line.mid(eqSign.m_idx+1,line.length()-eqSign.m_idx);
00362 while (!line.isEmpty())
00363 {
00364 if (line[line.length()-1]=='\\')
00365 {
00366 line = line.left(line.length()-1).simplifyWhiteSpace();
00367 lineNum++;
00368 line = m_buffer[lineNum];
00369 continue;
00370 }
00371 line = "";
00372 }
00373
00374 if (QString("+-*~").find(effectOperator)==-1)
00375 {
00376 modes.append(new ValueSetMode(VSM_RESET));
00377 }
00378 if (effectOperator=='-')
00379 {
00380 modes.append(new ValueSetMode(VSM_EXCLUDE));
00381 }
00382 else
00383 {
00384 modes.append(new ValueSetMode(VSM_APPEND));
00385 }
00386 curPos = Caret(lineNum+1,0);
00387 }
00388 }
00389
00393 void FileBuffer::removeValues(const QString &variable)
00394
00395 {
00396 Caret curPos = Caret(0,0);
00397 bool finished = false;
00398 while (!finished)
00399 {
00400 Caret variablePos = findInBuffer(variable,curPos,false,true);
00401 if (variablePos==Caret(-1,-1))
00402 {
00403 finished = true;
00404 continue;
00405 }
00406 QString line = pop(variablePos.m_row);
00407 while (line[line.length()-1]=='\\')
00408 {
00409 line = pop(variablePos.m_row);
00410 if (line.isNull())
00411 break;
00412 }
00413 }
00414 }
00415
00419 void FileBuffer::bufferFile(const QString &fileName)
00420
00421 {
00422 m_buffer.clear();
00423 QFile dataFile(fileName);
00424 if (dataFile.open(IO_ReadOnly))
00425 {
00426 QTextStream inStream( &dataFile );
00427 QString inLine;
00428 while ( !inStream.eof() )
00429 {
00430 inLine = inStream.readLine();
00431 inLine = inLine.simplifyWhiteSpace();
00432 m_buffer.append(inLine);
00433 }
00434 }
00435 dataFile.close();
00436 removeComments();
00437 }
00438
00442 void FileBuffer::saveBuffer(const QString &filename,const QString &qmakeHeader)
00443
00444 {
00445 QFile dataFile(filename);
00446 QStringList writeBuffer;
00447 writeBuffer.append(qmakeHeader);
00448 writeBuffer += getBufferTextInDepth();
00449 if (dataFile.open(IO_WriteOnly))
00450 {
00451 for (unsigned int i=0; i<writeBuffer.count(); ++i)
00452 if (!writeBuffer[i].simplifyWhiteSpace().isEmpty())
00453 dataFile.writeBlock((writeBuffer[i]+"\n").ascii(),(writeBuffer[i]+"\n").length());
00454 }
00455 }
00456
00463 void FileBuffer::makeScope(const QString &scopeString)
00464
00465 {
00466 FileBuffer *subBuffer;
00467 QString nextScopeName,scopeStringRest;
00468 splitScopeString(scopeString,nextScopeName,scopeStringRest);
00469 if (nextScopeName.isEmpty())
00470 return;
00471
00472 int idx = findChildBuffer(nextScopeName);
00473
00474 if (idx==-1)
00475 {
00476
00477 subBuffer = new FileBuffer();
00478 subBuffer->setScopeName(nextScopeName);
00479 m_subBuffers.append(subBuffer);
00480 }
00481 else
00482 subBuffer = m_subBuffers[idx];
00483 subBuffer->makeScope(scopeStringRest);
00484 }
00485
00486 QStringList FileBuffer::getBufferTextInDepth()
00487
00488 {
00489 QStringList resBuffer = m_buffer;
00490 for (unsigned int i=0; i<m_subBuffers.count(); ++i)
00491 {
00492 resBuffer.append(m_subBuffers[i]->getScopeName() + "{");
00493 QStringList subBuffer = m_subBuffers[i]->getBufferTextInDepth();
00494 for (unsigned int j=0; j<subBuffer.count(); j++)
00495 subBuffer[j] = " " + subBuffer[j];
00496 resBuffer += subBuffer;
00497 resBuffer.append("}");
00498 }
00499 return resBuffer;
00500 }
00501
00502 void FileBuffer::dumpBuffer()
00503
00504 {
00505 for ( unsigned int i=0; i<m_buffer.count(); ++i )
00506 printf("%s\n", m_buffer[i].latin1());
00507 }
00508
00509 Caret FileBuffer::findScopeEnd(Caret pos)
00510
00511 {
00512 int scopeDepth=1;
00513 while (scopeDepth)
00514 {
00515 Caret nextScopeStart = findInBuffer("{",pos,true);
00516 Caret nextScopeEnd = findInBuffer("}",pos,true);
00517 if (nextScopeStart < nextScopeEnd)
00518 {
00519 ++scopeDepth;
00520 pos = nextScopeStart + Caret(0,1);
00521 }
00522 else
00523 {
00524 --scopeDepth;
00525 pos = nextScopeEnd + Caret(0,1);
00526 }
00527 if (nextScopeStart==nextScopeEnd)
00528 return Caret(-1,-1);
00529 }
00530 return pos - Caret(0,1);
00531 }
00532
00533 bool FileBuffer::findNextScope(const Caret &startSearch, Caret& scopeStart, Caret& scopeEnd)
00534
00535 {
00536 scopeStart = findInBuffer("{",startSearch);
00537 if (scopeStart==Caret(-1,-1))
00538 return false;
00539 scopeEnd = findScopeEnd(scopeStart+Caret(0,1));
00540 if (scopeEnd==Caret(-1,-1))
00541 return false;
00542 return true;
00543 }
00544
00545 QStringList FileBuffer::copyBlock(const Caret &blockStart, const Caret &blockEnd)
00546
00547 {
00548 QStringList result;
00549 QString tmp = m_buffer[blockStart.m_row];
00550 result.append(tmp.right(tmp.length()-blockStart.m_idx));
00551 for (int i=blockStart.m_row+1; i<blockEnd.m_row; ++i)
00552 result.append(m_buffer[i]);
00553 tmp = m_buffer[blockEnd.m_row];
00554 result.append(tmp.left(blockEnd.m_idx+1));
00555 return result;
00556 }
00557
00558 QStringList FileBuffer::popBlock(const Caret &blockStart, const Caret &blockEnd)
00559
00560 {
00561 QStringList result = copyBlock(blockStart,blockEnd);
00562 int poprow;
00563 if (blockStart.m_idx==0)
00564 {
00565 pop(blockStart.m_row);
00566 poprow=blockStart.m_row;
00567 }
00568 else
00569 {
00570 m_buffer[blockStart.m_row] = m_buffer[blockStart.m_row].left(blockStart.m_idx);
00571 poprow = blockStart.m_row+1;
00572 }
00573 for (int i=0; i<blockEnd.m_row-blockStart.m_row-1; ++i)
00574 pop(poprow);
00575 QString tmp = m_buffer[poprow];
00576 if (blockEnd.m_idx >= (int) tmp.length()-1)
00577 pop(poprow);
00578 else
00579 m_buffer[poprow] = tmp.right(tmp.length()-blockEnd.m_idx-1);
00580 return result;
00581 }
00582
00588 bool FileBuffer::handleScopes()
00589
00590 {
00591 bool parseError = false;
00592 unsigned int i;
00593 Caret pos(0,0);
00594
00595 while (true)
00596 {
00597 Caret startScope,endScope;
00598 if (!findNextScope(pos,startScope,endScope))
00599 break;
00600 pos = Caret(startScope.m_row,0);
00601
00602 if (startScope.m_idx==0)
00603 {
00604 break;
00605 parseError = true;
00606 }
00607
00608 QStringList subBuffer;
00609 QString tmp = m_buffer[startScope.m_row];
00610 QStringList scopeNames = QStringList::split(":",tmp.left(startScope.m_idx));
00611
00612 for (i=0;i<scopeNames.count();++i)
00613 scopeNames[i]=scopeNames[i].simplifyWhiteSpace();
00614 if (scopeNames.count()>1)
00615 {
00616
00617 QString subBufferPrefix = scopeNames[1];
00618 for (i=2;i<scopeNames.count();++i)
00619 subBufferPrefix = subBufferPrefix + ":" + scopeNames[i];
00620 subBuffer = popBlock(startScope,endScope);
00621 subBuffer[0] = subBufferPrefix + subBuffer[0];
00622 }
00623 else
00624 {
00625 subBuffer = popBlock(startScope,endScope);
00626
00627 tmp = subBuffer[0];
00628 subBuffer[0] = tmp.right(tmp.length()-1);
00629 tmp = subBuffer[subBuffer.count()-1];
00630 subBuffer[subBuffer.count()-1] = tmp.left(tmp.length()-1);
00631 }
00632
00633
00634 pop(startScope.m_row);
00635 int subBufferIdx = findChildBuffer(scopeNames[0]);
00636 FileBuffer *subBufferObject;
00637 if (subBufferIdx==-1)
00638 {
00639 subBufferObject = new FileBuffer();
00640 m_subBuffers.append(subBufferObject);
00641 }
00642 else
00643 subBufferObject = m_subBuffers[subBufferIdx];
00644 subBufferObject->setScopeName(scopeNames[0]);
00645 subBufferObject->appendBufferText(subBuffer);
00646 subBufferObject->handleScopes();
00647 }
00648
00649 pos = Caret(0,0);
00650 while (true)
00651 {
00652 Caret kolonPos = findInBuffer(":",pos);
00653 if (kolonPos == Caret(-1,-1))
00654 break;
00655 QString scopeLine = pop(kolonPos.m_row);
00656 int equalPos = scopeLine.find('=',kolonPos.m_idx);
00657 if (equalPos == -1)
00658 {
00659
00660 parseError = true;
00661 break;
00662 }
00663 int idxScopeStringEnd = scopeLine.findRev(':',equalPos);
00664 QString scopeString = scopeLine.left(idxScopeStringEnd);
00665 scopeLine = scopeLine.right(scopeLine.length()-idxScopeStringEnd-1);
00666 scopeLine = scopeLine.simplifyWhiteSpace();
00667 makeScope(scopeString);
00668 FileBuffer *subBufferObject = getSubBuffer(scopeString);
00669 subBufferObject->appendBufferText(scopeLine);
00670 while (scopeLine[scopeLine.length()-1] == '\\')
00671 {
00672 scopeLine = pop(kolonPos.m_row);
00673 scopeLine = scopeLine.simplifyWhiteSpace();
00674 subBufferObject->appendBufferText(scopeLine);
00675 }
00676 pos = Caret(kolonPos.m_row,0);
00677 }
00678 return parseError;
00679 }
00680
00681 int FileBuffer::findChildBuffer(const QString &scopeName)
00682
00683 {
00684 for (unsigned int i=0; i<m_subBuffers.count(); ++i)
00685 if (m_subBuffers[i]->getScopeName()==scopeName)
00686 return i;
00687 return -1;
00688 }
00689
00690 QStringList FileBuffer::getAllScopeStrings(int depth)
00691
00692 {
00693 QStringList result;
00694 unsigned int i;
00695 for (i=0; i<m_subBuffers.count(); ++i)
00696 result += m_subBuffers[i]->getAllScopeStrings(depth+1);
00697 if (depth)
00698 {
00699 for (i=0; i<result.count(); ++i)
00700 result[i] = getScopeName() + ":" + result[i];
00701 result.append(getScopeName());
00702 }
00703 return result;
00704 }
00705
00706 QStringList FileBuffer::getAllScopeNames(int depth)
00707
00708 {
00709 QStringList result;
00710 unsigned int i;
00711 for (i=0; i<m_subBuffers.count(); ++i)
00712 result += m_subBuffers[i]->getAllScopeNames(depth+1);
00713 if (!depth)
00714 {
00715 for (i=0; i<result.count(); ++i)
00716 {
00717 QString scopeName = result[0];
00718 result.remove(scopeName);
00719 result.append(scopeName);
00720 }
00721 }
00722 else
00723 {
00724 QString tmpScopeName = getScopeName();
00725
00726 if (tmpScopeName[0]=='!')
00727 tmpScopeName = tmpScopeName.right(tmpScopeName.length()-1);
00728 result.append(tmpScopeName);
00729 }
00730 return result;
00731
00732 }
00733
00734 QStringList FileBuffer::getChildScopeNames()
00735
00736 {
00737 QStringList result;
00738 for (unsigned int i=0; i<m_subBuffers.count(); ++i)
00739 result += m_subBuffers[i]->getScopeName();
00740 return result;
00741 }
00742
00743 bool FileBuffer::getAllExcludeValues(const QString &variable,QStringList &minusValues, int depth)
00744
00745 {
00746 unsigned int i;
00747 QStringList plusDummy,minusTmp;
00748 for (i=0; i<m_subBuffers.count(); ++i)
00749 m_subBuffers[i]->getAllExcludeValues(variable,minusValues,depth+1);
00750 if (depth)
00751 {
00752 for (i=0; i<minusValues.count(); ++i)
00753 minusValues[i] = getScopeName() + ":" + minusValues[i];
00754 }
00755 getValues(variable,plusDummy,minusTmp);
00756 for (i=0; i<minusTmp.count(); ++i)
00757 minusTmp[i] = getScopeName() + "-" + minusTmp[i];
00758 minusValues += minusTmp;
00759 return true;
00760 }
00761
00762
00763 void FileBuffer::filterOutIgnoreValues(QString& line,QStringList& valuesignore)
00764
00765 {
00766 QStringList qmakeFunctions =
00767 QStringList::split(',',"join(,member(,find(,contains(,count(,error(,exists(,"
00768 "include(,isEmpty(,system(,message(,infile(");
00769
00770 int len=0;
00771 int closestMatch = -1;
00772 for (uint i=0; i<qmakeFunctions.count(); ++i)
00773 {
00774 int match = line.find(qmakeFunctions[i],0);
00775 if (match==-1)
00776 continue;
00777 if(closestMatch==-1 ||
00778 closestMatch>match)
00779 {
00780 closestMatch = match;
00781 len=qmakeFunctions[i].length();
00782 }
00783 }
00784 int startpos = closestMatch;
00785
00786 while (startpos>-1)
00787 {
00788 int bracketCount=1;
00789 while (bracketCount>0 && startpos+len<(int)line.length())
00790 {
00791 if (line[startpos+len]=='(')
00792 ++bracketCount;
00793 if (line[startpos+len]==')')
00794 --bracketCount;
00795 ++len;
00796 }
00797
00798 valuesignore.append(line.mid(startpos,len));
00799 line = line.left(startpos)+line.right(line.length()-startpos-len);
00800
00801 closestMatch=-1;
00802 for (uint i=0; i<qmakeFunctions.count(); ++i)
00803 {
00804 int match = line.find(qmakeFunctions[i],startpos);
00805 if (match==-1)
00806 continue;
00807 if(closestMatch==-1 ||
00808 closestMatch>match)
00809 {
00810 closestMatch = match;
00811 len=qmakeFunctions[i].length();
00812 }
00813 }
00814 startpos = closestMatch;
00815 }
00816
00817 }
00818
00819 ValuesIgnore* FileBuffer::getValuesIgnore(const QString &variable)
00820
00821 {
00822 ValuesIgnoreList::iterator it;
00823 for ( it = m_valuesIgnore.begin(); it != m_valuesIgnore.end(); ++it )
00824 if ((*it)->variable == variable)
00825 return (*it);
00826 ValuesIgnore* newVar = new ValuesIgnore;
00827 newVar->variable = variable;
00828 m_valuesIgnore.append(newVar);
00829 return newVar;
00830 }
00831
00832 void FileBuffer::removeScope( const QString & scopeString, const QString &removeString, QStringList buffer )
00833 {
00834 FileBuffer *subBuffer;
00835 QString nextScopeName,scopeStringRest;
00836 splitScopeString(scopeString,nextScopeName,scopeStringRest);
00837 if (nextScopeName.isEmpty())
00838 return;
00839
00840 int idx = findChildBuffer(nextScopeName);
00841
00842 if (idx == -1)
00843 return;
00844 else
00845 {
00846 buffer.append(nextScopeName);
00847 subBuffer = m_subBuffers[idx];
00848 if (buffer.join(":") == removeString)
00849 {
00850 m_subBuffers.remove(subBuffer);
00851 delete subBuffer;
00852 }
00853 else
00854 subBuffer->removeScope(scopeStringRest, removeString, buffer);
00855 }
00856 }