[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdesdk/lokalize/src
From:       Nickolai Shaforostoff <shafff () ukr ! net>
Date:       2009-05-31 21:52:30
Message-ID: 1243806750.717598.8404.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 976100 by shaforo:

postpone script autoruns so that they actually work (w/o this \
PythonScript::Destructor was called immediately after run)



 M  +5 -10     lokalizemainwindow.cpp  
 M  +14 -0     lokalizemainwindow.h  


--- trunk/KDE/kdesdk/lokalize/src/lokalizemainwindow.cpp #976099:976100
@@ -592,7 +592,6 @@
 #include "mainwindowadaptor.h"
 #include <kross/core/actioncollection.h>
 #include <kross/core/manager.h>
-#include <kross/ui/plugin.h>
 
 using namespace Kross;
 
@@ -610,14 +609,6 @@
     ~MyScriptingPlugin(){}
 };
 
-class ProjectScriptingPlugin: public Kross::ScriptingPlugin
-{
-public:
-    ProjectScriptingPlugin(QObject* lokalize, QObject* editor);
-    ~ProjectScriptingPlugin();
-    void setDOMDocument (const QDomDocument &document, bool merge = false);
-};
-
 #define PROJECTRCFILE "scripts.rc"
 #define PROJECTRCFILEDIR  Project::instance()->projectDir()+"/lokalize-scripts"
 #define PROJECTRCFILEPATH Project::instance()->projectDir()+"/lokalize-scripts" "/" \
PROJECTRCFILE @@ -649,7 +640,11 @@
 void ProjectScriptingPlugin::setDOMDocument (const QDomDocument &document, bool \
merge)  {
     Kross::ScriptingPlugin::setDOMDocument(document, merge);
+    QTimer::singleShot(0,this, SLOT(doAutoruns()));
+}
 
+void ProjectScriptingPlugin::doAutoruns()
+{
     Kross::ActionCollection* \
collection=Kross::Manager::self().actionCollection()->collection(Project::instance()->kind());
  if (!collection) return;
     foreach(const QString &collectionname, collection->collections())
@@ -699,7 +694,7 @@
 
 void LokalizeMainWindow::registerDBusAdaptor()
 {
-    MainWindowAdaptor* adaptor=new MainWindowAdaptor(this);
+    new MainWindowAdaptor(this);
     QDBusConnection::sessionBus().registerObject("/ThisIsWhatYouWant", this);
     QDBusConnection::sessionBus().unregisterObject("/KDebug",QDBusConnection::UnregisterTree);
  
--- trunk/KDE/kdesdk/lokalize/src/lokalizemainwindow.h #976099:976100
@@ -153,5 +153,19 @@
 };
 
 
+#include <kross/ui/plugin.h>
 
+class ProjectScriptingPlugin: public Kross::ScriptingPlugin
+{
+Q_OBJECT
+public:
+    ProjectScriptingPlugin(QObject* lokalize, QObject* editor);
+    ~ProjectScriptingPlugin();
+    void setDOMDocument (const QDomDocument &document, bool merge = false);
+
+private slots:
+    void doAutoruns();
+};
+
+
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic