summaryrefslogtreecommitdiffstats
path: root/src/klamav_run.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-01-13 19:26:24 +0200
committerMavridis Philippe <[email protected]>2021-01-13 19:26:24 +0200
commit8c20dc919f7d54eb48fb60f39ba5e1d466a70763 (patch)
tree44d89f278d5dd066603e5ab9c0b270bc8eb4ad51 /src/klamav_run.cpp
downloadklamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.tar.gz
klamav-8c20dc919f7d54eb48fb60f39ba5e1d466a70763.zip
Initial commit
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/klamav_run.cpp')
-rw-r--r--src/klamav_run.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/klamav_run.cpp b/src/klamav_run.cpp
new file mode 100644
index 0000000..8f011c1
--- /dev/null
+++ b/src/klamav_run.cpp
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Sashmit Bhaduri *
+ * *
+ * Licensed under GPL. *
+ ***************************************************************************/
+
+
+#include "viewer.h"
+#include "klamav_run.h"
+
+using namespace KlamAV;
+
+
+BrowserRun::BrowserRun(Viewer *viewer, QWidget *parent, KParts::ReadOnlyPart *part, const KURL & url, const KParts::URLArgs &args)
+ : KParts::BrowserRun(url, args, part, parent, false, true)
+{
+ m_viewer=viewer;
+ connect(m_viewer, SIGNAL(destroyed()), this, SLOT(killMyself()));
+ setEnableExternalBrowser(false);
+
+}
+
+BrowserRun::~BrowserRun()
+{
+ //kdDebug() << "BrowserRun::~BrowserRun()" << endl;
+}
+
+void BrowserRun::foundMimeType( const QString & type )
+{
+ if (type=="text/html" ||type=="text/xml" || type=="application/xhtml+xml" )
+ m_viewer->openPage(url());
+ else
+ KParts::BrowserRun::foundMimeType( type );
+}
+
+void BrowserRun::killMyself()
+{
+ kdDebug() << "BrowserRun::killMyself()" << endl;
+ delete this;
+}
+
+
+
+// vim: set et ts=4 sts=4 sw=4:
+#include "klamav_run.moc"