summaryrefslogtreecommitdiffstats
path: root/kate/filelistloader/katefll_initplugin.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /kate/filelistloader/katefll_initplugin.cpp
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/filelistloader/katefll_initplugin.cpp')
-rw-r--r--kate/filelistloader/katefll_initplugin.cpp96
1 files changed, 96 insertions, 0 deletions
diff --git a/kate/filelistloader/katefll_initplugin.cpp b/kate/filelistloader/katefll_initplugin.cpp
new file mode 100644
index 0000000..4eb116f
--- /dev/null
+++ b/kate/filelistloader/katefll_initplugin.cpp
@@ -0,0 +1,96 @@
+/***************************************************************************
+ katefll_initplugin.cpp - description
+ -------------------
+ begin : FRE July 12th 2002
+ copyright : (C) 2002 by Joseph Wenninger
+ email : jowenn@kde.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "katefll_initplugin.h"
+#include "katefll_initplugin.moc"
+
+#include <kate/pluginmanager.h>
+
+#include <qfileinfo.h>
+#include <kgenericfactory.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <kio/netaccess.h>
+
+K_EXPORT_COMPONENT_FACTORY( katefll_initplugin, KGenericFactory<InitPluginKateFileListLoader>( "katefll_loader" ) )
+
+InitPluginKateFileListLoader::InitPluginKateFileListLoader (QObject * parent, const char *name, const QStringList datalist)
+ :InitPlugin((Kate::Application*)parent,name)
+{
+}
+
+
+InitPluginKateFileListLoader:: ~InitPluginKateFileListLoader()
+{
+}
+
+
+int InitPluginKateFileListLoader::actionsKateShouldNotPerformOnRealStartup()
+{
+ return 0x1;
+}
+
+int InitPluginKateFileListLoader::initKate()
+{
+ QString tmpFile;
+ KURL tmpURL;
+ if( KIO::NetAccess::download( configScript(), tmpFile ) )
+ {
+ QFile file(tmpFile);
+ file.open(IO_ReadOnly);
+
+ QTextStream t(&file);
+
+ bool somethingOpened=false;
+
+ application()->documentManager()->closeAllDocuments();
+ while (!t.eof())
+ {
+ somethingOpened=true;
+// application()->activeMainWindow()->viewManager()->openURL(KURL(t.readLine()));
+ application()->documentManager()->openURL(tmpURL=KURL(t.readLine()));
+ }
+ if (!somethingOpened) application()->documentManager()->openURL(KURL());
+ else if (application()->activeMainWindow())
+ application()->activeMainWindow()->viewManager()->openURL(tmpURL);
+
+ file.close();
+
+ KIO::NetAccess::removeTempFile( tmpFile );
+
+ } else application()->documentManager()->openURL(KURL());
+
+ Kate::Plugin *pl=application()->pluginManager()->plugin("katefll_plugin");
+ if (pl)
+ {
+ connect(this,SIGNAL(updateInit()),pl,SLOT(updateInit()));
+ updateInit();
+ disconnect(this,SIGNAL(updateInit()),pl,SLOT(updateInit()));
+
+/* int id = pl->metaObject()->findSlot( SLOT(updateInit()) );
+ if ( id != -1 )
+ {
+ kdDebug()<<"Action slot was found, it will be called now"<<endl;
+ QUObject o[ 1 ];
+ mod->module->qt_invoke( id, o );
+ } */
+ }
+ return 0;
+}
+