Removed all dependencies on sigc++.

This commit is contained in:
rakshasa
2013-08-27 00:43:23 +09:00
parent aa93404278
commit 370bae4b98
11 changed files with 101 additions and 70 deletions
+9 -6
View File
@@ -67,7 +67,8 @@ PathInput::pressed(int key) {
return TextInput::pressed(key);
} else if (m_showNext) {
m_signalShowNext.emit();
for (signal_void::iterator itr = m_signal_show_next.begin(), last = m_signal_show_next.end(); itr != last; itr++)
(*itr)();
} else {
receive_do_complete();
@@ -101,7 +102,7 @@ PathInput::receive_do_complete() {
std::for_each(dir.begin(), dir.end(), _transform_filename());
Range r = find_incomplete(dir, str().substr(dirEnd, get_pos()));
range_type r = find_incomplete(dir, str().substr(dirEnd, get_pos()));
if (r.first == r.second)
return; // Show some nice colors here.
@@ -121,8 +122,10 @@ PathInput::receive_do_complete() {
// Only emit if there are more than one option.
m_showNext = ++utils::Directory::iterator(r.first) != r.second;
if (m_showNext)
m_signalShowRange.emit(r.first, r.second);
if (m_showNext) {
for (signal_itr_itr::iterator itr = m_signal_show_range.begin(), last = m_signal_show_range.end(); itr != last; itr++)
(*itr)(r.first, r.second);
}
}
PathInput::size_type
@@ -147,9 +150,9 @@ find_complete_not_compare(const utils::directory_entry& complete, const std::str
return !complete.d_name.compare(0, base.size(), base);
}
PathInput::Range
PathInput::range_type
PathInput::find_incomplete(utils::Directory& d, const std::string& f) {
Range r;
range_type r;
r.first = std::find_if(d.begin(), d.end(), rak::bind2nd(std::ptr_fun(&find_complete_not_compare), f));
r.second = std::find_if(r.first, d.end(), rak::bind2nd(std::ptr_fun(&find_complete_compare), f));