Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5784 in orxonox.OLD for trunk/src/lib/shell/shell_input.cc


Ignore:
Timestamp:
Nov 26, 2005, 8:48:11 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: shell without tList now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_input.cc

    r5639 r5784  
    4949  this->inputLine = new char[1];
    5050  this->inputLine[0] = '\0';
    51   this->history = new tList<char>;
    52   this->historyIT = this->history->getIterator();
     51  this->historyIT = this->history.begin();
    5352  this->setHistoryLength(50);
    5453  this->historyScrolling = false;
     
    7574  delete this->completion;
    7675
    77   char* histEl = this->historyIT->firstElement();
    78   while (histEl != NULL)
    79   {
    80     delete[] histEl;
    81     histEl = this->historyIT->nextElement();
    82   }
    83   delete this->historyIT;
    84   delete this->history;
     76  while (!this->history.empty())
     77  {
     78    delete[] this->history.front();
     79    this->history.pop_front();
     80  }
    8581}
    8682
     
    139135  if (this->historyScrolling)
    140136  {
    141     delete[] this->history->lastElement();
    142     this->history->remove(this->history->lastElement());
     137    delete[] this->history.back();
     138    this->history.pop_back();
    143139    this->historyScrolling = false;
    144140  }
     
    160156  if (this->historyScrolling)
    161157  {
    162     delete[] this->history->lastElement();
    163     this->history->remove(this->history->lastElement());
     158    delete[] this->history.back();
     159    this->history.pop_back();
    164160    this->historyScrolling = false;
    165161  }
     
    181177  if (this->historyScrolling)
    182178  {
    183     delete[] this->history->lastElement();
    184     this->history->remove(this->history->lastElement());
     179    delete[] this->history.back();
     180    this->history.pop_back();
    185181    this->historyScrolling = false;
    186182  }
     
    220216  if (this->historyScrolling)
    221217  {
    222     delete[] this->history->lastElement();
    223     this->history->remove(this->history->lastElement());
     218    delete[] this->history.back();
     219    this->history.pop_back();
    224220    this->historyScrolling = false;
    225221  }
    226222
    227223  // adding the new Command to the History
    228   this->history->add(newCommand);
    229   if (this->history->getSize() > this->historyLength)
    230   {
    231     delete[] this->history->firstElement();
    232     this->history->remove(this->history->firstElement());
     224  this->history.push_back(newCommand);
     225  if (this->history.size() > this->historyLength)
     226  {
     227    delete[] this->history.front();
     228    this->history.pop_front();
    233229  }
    234230
     
    248244    char* currentText = new char[strlen(this->inputLine)+1];
    249245    strcpy(currentText, this->inputLine);
    250     this->history->add(currentText);
     246    this->history.push_back(currentText);
    251247    this->historyScrolling = true;
    252     this->historyIT->lastElement();
    253   }
    254 
    255   char* prevElem = this->historyIT->prevStep();
     248    this->historyIT = this->history.end();
     249  }
     250
     251  char* prevElem = *(this->historyIT--);
    256252  if (prevElem == NULL)
    257253    return;
     
    270266  if (!this->historyScrolling)
    271267    return;
    272   char* nextElem = this->historyIT->nextStep();
     268  char* nextElem = *(this->historyIT++);
    273269  if (nextElem == NULL)
    274270    return;
Note: See TracChangeset for help on using the changeset viewer.