* Fix drag-n-drop of file onto MFSK transmit pic dialog
pull/1/head
David Freese 2012-02-25 17:46:29 -06:00
rodzic 4a0833efab
commit c9df72646d
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -675,11 +675,14 @@ int picbox::handle(int event)
// handle FL_PASTE
string text = Fl::event_text();
// from dnd event "file:///home/dave/Photos/dave.jpeg"
string::size_type p;
if ((p = text.find("file://")) != string::npos)
text.erase(0, p + strlen("file://"));
if ((p = text.find('\r')) != string::npos)
text.erase(p);
if ((p = text.find('\n')) != string::npos)
text.erase(p);
struct stat st;
if (stat(text.c_str(), &st) == -1 || !S_ISREG(st.st_mode))