summaryrefslogtreecommitdiffstats
path: root/kontact/plugins/korganizer/korg_uniqueapp.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kontact/plugins/korganizer/korg_uniqueapp.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kontact/plugins/korganizer/korg_uniqueapp.cpp')
-rw-r--r--kontact/plugins/korganizer/korg_uniqueapp.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/kontact/plugins/korganizer/korg_uniqueapp.cpp b/kontact/plugins/korganizer/korg_uniqueapp.cpp
index b70042353..42a7adcae 100644
--- a/kontact/plugins/korganizer/korg_uniqueapp.cpp
+++ b/kontact/plugins/korganizer/korg_uniqueapp.cpp
@@ -20,19 +20,40 @@
*/
#include "korg_uniqueapp.h"
-#include <kdebug.h>
#include "../../korganizer/korganizer_options.h"
+#include "core.h"
+#include <dcopref.h>
+#include <kapplication.h>
+#include <kstartupinfo.h>
+#include <kwin.h>
+
void KOrganizerUniqueAppHandler::loadCommandLineOptions()
{
- KCmdLineArgs::addCmdLineOptions( korganizer_options );
+ KCmdLineArgs::addCmdLineOptions( korganizer_options );
}
int KOrganizerUniqueAppHandler::newInstance()
{
- //kdDebug(5602) << k_funcinfo << endl;
- // Ensure part is loaded
- (void)plugin()->part();
- // TODO handle command line options
- return Kontact::UniqueAppHandler::newInstance();
+ // Ensure part is loaded
+ (void)plugin()->part();
+ DCOPRef korganizer( "korganizer", "KOrganizerIface" );
+ korganizer.send( "handleCommandLine" );
+
+ // Bring korganizer's plugin to front
+ // This bit is duplicated from KUniqueApplication::newInstance()
+ if ( kapp->mainWidget() ) {
+ kapp->mainWidget()->show();
+ KWin::forceActiveWindow( kapp->mainWidget()->winId() );
+ KStartupInfo::appStarted();
+ }
+
+ // Then ensure the part appears in kontact.
+ // ALWAYS use the korganizer plugin; i.e. never show the todo nor journal
+ // plugins when creating a new instance via the command line, even if
+ // the command line options are empty; else we'd need to examine the
+ // options and then figure out which plugin we should show.
+ // kolab/issue3971
+ plugin()->core()->selectPlugin( "kontact_korganizerplugin" );
+ return 0;
}