From 6f34de131286e23e5abe7c0297501f4e08a88fce Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 5 Nov 2008 18:13:18 +0000 Subject: re-added spaste.file method git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2830 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/spaste/controller.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/modules/spaste/controller.cpp b/src/modules/spaste/controller.cpp index 97a55fef6..80d354ec0 100644 --- a/src/modules/spaste/controller.cpp +++ b/src/modules/spaste/controller.cpp @@ -92,7 +92,25 @@ bool SPasteController::pasteClipboardInit(void) void SPasteController::pasteFile(void) { + QString line; + char data[1024]; + if(m_pFile->readLine(data,sizeof(data)) != -1) + { + line = data; + if(line.isEmpty()) + line = QChar(KVI_TEXT_RESET); + if(!g_pApp->windowExists(m_pWindow)) + { + m_pFile->close(); + delete this; + } else { + m_pWindow->ownMessage(line.toAscii()); + } + } else { //File finished + m_pFile->close(); + delete this; + } } void SPasteController::pasteClipboard(void) -- cgit v1.3.1-10-gc9f91