Bug 168202 - KTImeTracker does not start if it gets a -caption parameter
Summary: KTImeTracker does not start if it gets a -caption parameter
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Thorsten Staerk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-03 13:20 UTC by Tomas Mecir
Modified: 2008-08-11 11:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mecir 2008-08-03 13:20:33 UTC
Version:            (using KDE 4.1.0)
Installed from:    SuSE RPMs

If ktimetracker receives a -caption "anything can be here" parameter on the command line, it fails to start properly, terminating instantly instead. This is a problem, because the karm.desktop file (on openSuSE at least, no idea about other distros) gives it the -caption parameter, making it impossible to start ktimetracker from krunner/kickoff with the default installation.
Comment 1 Thorsten Staerk 2008-08-03 21:50:13 UTC
If you hand over parameters to ktimetracker, it falls into the konsolemode, this means, you can tell it something like
 ktimetracker --addtask mytask
This is the explanation why it terminates at an instant. More to follow.
Comment 2 Thorsten Staerk 2008-08-10 18:45:57 UTC
Here is a patch that I want to apply. About that way:
Index: main.cpp
===================================================================
--- main.cpp    (revision 844739)
+++ main.cpp    (working copy)
@@ -111,15 +111,17 @@
   KCmdLineArgs::addCmdLineOptions( options );
   KUniqueApplication::addCmdLineOptions();
   KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-  /* when do we open a gui, when do we use konsole mode ?
-     call                                    argc args->count konsolemode
-     ktimetracker                               1           0          no
-     ktimetracker /tmp/test                     2           1          no
-     ktimetracker /tmp/test --listtasknames     3           1         yes
-     ktimetracker --listtasknames               2           0         yes
-  */
   int err=0;  // error code
-  if ( argc-( args->count() ) <= 1)
+  bool konsolemode=false;
+  if ( args->isSet("listtasknames") ) konsolemode=true;
+  if ( !args->getOption("addtask").isEmpty() ) konsolemode=true;
+  if ( !args->getOption("deletetask").isEmpty() ) konsolemode=true;
+  if ( !args->getOption("taskidsfromname").isEmpty() ) konsolemode=true;
+  if ( !args->getOption("totalminutesfortaskid").isEmpty() ) konsolemode=true;
+  if ( !args->getOption("starttask").isEmpty() ) konsolemode=true;
+  if ( !args->getOption("stoptask").isEmpty() ) konsolemode=true;
+
+  if ( !konsolemode )
   {  // no konsole mode
     KPIM::PimApplication myApp;
     MainWindow *mainWindow;
Comment 3 Thorsten Staerk 2008-08-11 11:06:26 UTC
SVN commit 845106 by tstaerk:

Decide depending on the parameters if you get into a dialog with the
user.
BUGS:168202


 M  +10 -8     main.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=845106