Skip to content
Snippets Groups Projects
Commit fa50d035 authored by andreas's avatar andreas
Browse files

added missing files from last new_shell commit

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/branches/new_shell@2260 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 8b67744f
Branches
Tags
No related merge requests found
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
/* /*
Author: Andreas Schenk Author: Andreas Schenk
*/ */
#include "shell_history.hh" #include "shell_history.hh"
namespace ost { namespace gui { namespace ost { namespace gui {
...@@ -77,29 +76,33 @@ bool ShellHistory::AtEnd() ...@@ -77,29 +76,33 @@ bool ShellHistory::AtEnd()
return index_>=history_list_.size(); return index_>=history_list_.size();
} }
void ShellHistory::operator--() void ShellHistory::MoveToPreviousMatch()
{ {
if(index_>0){ int newindex=index_-1;
--index_; while(newindex>=0){
if(history_list_[newindex].first.indexOf(current_)==0 || current_.size()==0){
index_=newindex;
break;
}
--newindex;
} }
} }
void ShellHistory::operator--(int) void ShellHistory::MoveToNextMatch()
{
operator--();
}
void ShellHistory::operator++()
{ {
if(index_<history_list_.size()){ int newindex=index_+1;
++index_; while(newindex<history_list_.size()){
if(history_list_[newindex].first.indexOf(current_)==0 || current_.size()==0){
index_=newindex;
break;
}
++newindex;
}
if(newindex!=index_){
index_=history_list_.size();
} }
} }
void ShellHistory::operator++(int)
{
operator++();
}
}}//ns }}//ns
...@@ -38,10 +38,8 @@ public: ...@@ -38,10 +38,8 @@ public:
QString GetCommand(); QString GetCommand();
BlockEditMode GetCommandMode(); BlockEditMode GetCommandMode();
bool AtEnd(); bool AtEnd();
void operator--(); void MoveToPreviousMatch();
void operator--(int); void MoveToNextMatch();
void operator++();
void operator++(int);
protected: protected:
std::vector<std::pair<QString,BlockEditMode> > history_list_; std::vector<std::pair<QString,BlockEditMode> > history_list_;
QString current_; QString current_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment