summaryrefslogtreecommitdiffstats
path: root/src/viewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/viewer.cpp')
-rw-r--r--src/viewer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/viewer.cpp b/src/viewer.cpp
index f98fb79..dc31dce 100644
--- a/src/viewer.cpp
+++ b/src/viewer.cpp
@@ -13,6 +13,7 @@
#include <tdepopupmenu.h>
#include <tqclipboard.h>
+#include <tqfile.h>
#include <tqpaintdevicemetrics.h>
#include "viewer.h"
@@ -67,6 +68,22 @@ bool Viewer::openURL(const KURL &url)
return true;
}
+/* borrowed from Konqueror */
+TQString Viewer::loadFile( const TQString& file ) {
+ TQString res;
+ if( file.isEmpty() )
+ return res;
+
+ TQFile f(file);
+
+ if( !f.open(IO_ReadOnly) )
+ return res;
+
+ TQTextStream t(&f);
+ res = t.read();
+
+ return res;
+}
bool Viewer::closeURL()
{