# # patch "rev_file_list.cc" # from [3f54a8a2ba25edde4f3ba524bbfdb7b89f937667] # to [1b1e098f3ead04924aaee9a8dd872be81f246b5f] # # patch "rev_file_list.hh" # from [4f4c94279cdbb2adbce2eca88d56edb1df84109f] # to [fbc3f04ddf9cef65a04c4a93d5761ecf866f3540] # ======================================================================== --- rev_file_list.cc 3f54a8a2ba25edde4f3ba524bbfdb7b89f937667 +++ rev_file_list.cc 1b1e098f3ead04924aaee9a8dd872be81f246b5f @@ -5,6 +5,9 @@ #include "revdat.hh" #include "misc.hh" +// getcwd +#include + template std::vector & operator%(std::vector & v, T t) { @@ -84,9 +87,27 @@ menu.append(*mi); } } + + std::list listTargets; + listTargets.push_back(Gtk::TargetEntry("text/uri-list")); + files.drag_source_set(listTargets); + files.signal_drag_data_get() + .connect(sigc::mem_fun(*this, &rev_file_list::drag_get)); } void +rev_file_list::drag_get(const Glib::RefPtr & dc, + Gtk::SelectionData& sel_data, + guint a, guint b) +{ + int s = 512; + char *cwd = new char[s]; + getcwd(cwd, s); + std::string dir(cwd); + sel_data.set(sel_data.get_target(), dir + "/" + current_file); +} + +void rev_file_list::menuadd() { menurow[col.included] = true; ======================================================================== --- rev_file_list.hh 4f4c94279cdbb2adbce2eca88d56edb1df84109f +++ rev_file_list.hh fbc3f04ddf9cef65a04c4a93d5761ecf866f3540 @@ -108,6 +108,10 @@ void menuundrop(); void menurevert(); + void rev_file_list::drag_get(const Glib::RefPtr & dc, + Gtk::SelectionData& sel_data, + guint a, guint b); + void dosel(Gtk::TreeModel::Path const & p); bool selchanged(Glib::RefPtr const & model, Gtk::TreeModel::Path const & path,