]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gtk/GMiniBuffer.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / gtk / GMiniBuffer.C
index 070a46777abdec2573355f18836fa96989d67765..3f117a77455978e218f83caaff500f64103dc078 100644 (file)
@@ -9,7 +9,11 @@
  */
 
 #include <config.h>
-#include <gtkmm.h>
+
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
 
 #include "GView.h"
 #include "GMiniBuffer.h"
@@ -23,6 +27,8 @@
 
 using std::string;
 
+namespace lyx {
+namespace frontend {
 
 GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
        controller_(control), view_(view)
@@ -32,14 +38,14 @@ GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
        listView_.set_model(listStore_);
        listView_.append_column("Completions", listCol_);
        listView_.signal_key_press_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onListKeyPress));
+               sigc::mem_fun(*this, &GMiniBuffer::onListKeyPress));
        listView_.signal_focus_in_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onListFocusIn));
+               sigc::mem_fun(*this, &GMiniBuffer::onListFocusIn));
        listView_.signal_focus_out_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusOut));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
        listSel_ = listView_.get_selection();
        listSel_->signal_changed().connect(
-               SigC::slot(*this, &GMiniBuffer::onSelected));
+               sigc::mem_fun(*this, &GMiniBuffer::onSelected));
 
        listView_.show();
        scrolledWindow_.set_policy(Gtk::POLICY_AUTOMATIC,
@@ -51,13 +57,13 @@ GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) :
                Gtk::Box_Helpers::Element(scrolledWindow_,Gtk::PACK_SHRINK));
 
        entry_.signal_key_press_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onKeyPress));
+               sigc::mem_fun(*this, &GMiniBuffer::onKeyPress));
        entry_.signal_focus_in_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusIn));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusIn));
        entry_.signal_focus_out_event().connect(
-               SigC::slot(*this, &GMiniBuffer::onFocusOut));
+               sigc::mem_fun(*this, &GMiniBuffer::onFocusOut));
        entry_.signal_activate().connect(
-               SigC::slot(*this, &GMiniBuffer::onCommit));
+               sigc::mem_fun(*this, &GMiniBuffer::onCommit));
        entry_.show();
 
        view_->getBox(GView::Bottom).children().push_back(
@@ -218,13 +224,14 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event)
                break;
        case GDK_Tab:
        {
-               Glib::ustring new_input, input;
                string new_input_locale;
-               input = entry_.get_text();
+               Glib::ustring input = entry_.get_text();
                std::vector<string> comp =
                        controller_.completions(Glib::locale_from_utf8(input),
                                                new_input_locale);
-               new_input = Glib::locale_to_utf8(new_input_locale);
+               Glib::ustring new_input =
+                       Glib::locale_to_utf8(new_input_locale);
+
                if (comp.empty() && new_input == input) {
                        showInfo("[no match]");
                        break;
@@ -286,3 +293,6 @@ void GMiniBuffer::setInput(Glib::ustring const & input)
        entry_.set_text(input);
        entry_.set_position(-1);
 }
+
+} // namespace frontend
+} // namespace lyx