diff options
| author | Ted Gould <ted@gould.cx> | 2007-06-27 06:29:41 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2007-06-27 06:29:41 +0000 |
| commit | a0d5cc12ee0fe26459d0278013a35a4f96c2e4b1 (patch) | |
| tree | 60f593f962a94497083473fec05ee5b85feedc95 /src/extension/implementation/script.h | |
| parent | (bzr r3138) (diff) | |
| download | inkscape-a0d5cc12ee0fe26459d0278013a35a4f96c2e4b1.tar.gz inkscape-a0d5cc12ee0fe26459d0278013a35a4f96c2e4b1.zip | |
r15629@tres: ted | 2007-06-26 21:47:00 -0700
Adding in the ability to open files. Which required some changes. But,
now everything seems happy. Can't break it all anymore.
(bzr r3139)
Diffstat (limited to 'src/extension/implementation/script.h')
| -rw-r--r-- | src/extension/implementation/script.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index d8970cf15..417b42a89 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -148,13 +148,16 @@ private: sigc::connection _conn; Glib::RefPtr<Glib::IOChannel> _channel; Glib::RefPtr<Glib::MainLoop> _main_loop; + bool _dead; public: - file_listener () { }; + file_listener () : _dead(false) { }; ~file_listener () { _conn.disconnect(); }; + bool isDead () { return _dead; } + void init (int fd, Glib::RefPtr<Glib::MainLoop> main) { _channel = Glib::IOChannel::create_from_fd(fd); _channel->set_encoding(); @@ -172,14 +175,15 @@ private: Glib::IOStatus status; Glib::ustring out; - status = _channel->read_to_end(out); + status = _channel->read_line(out); + _string += out; if (status != Glib::IO_STATUS_NORMAL) { _main_loop->quit(); + _dead = true; return false; } - _string += out; return true; }; |
