rem: if(variables.isVerbose()) { kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Create event" << endl; }
add: kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Create event" << endl;
context: int main(int argc, char *argv[]){  KAboutData aboutData( "konsolekalendar", I18N_NOOP( "KonsoleKalendar" ),                        "0.6", description, KAboutData::License_GPL,                        "(c) 2002-2003, Tuukka Pasanen", 0, 0,                        "illuusio@mailcity.com");  aboutData.addAuthor("Tuukka Pasanen",0, "illuusio@mailcity.com");  aboutData.addAuthor("Allen Winter", 0, "winterz@earthlink.net");  KCmdLineArgs::init( argc, argv, &aboutData );  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();  QString KalendarFile;  // Default values (Now!) for which date and time to show  QDate date = QDate::currentDate();  QTime time = QTime::currentTime();  // Default values for start (today at 0700) and end (today at 1700) timestamps  QDate startdate = QDate::currentDate();  QTime starttime(7,0);  QDate enddate = QDate::currentDate();  QTime endtime(17,0);  // Default values for switches  bool view = true;  bool add = false;  bool change = false;  bool del = false;  bool create = false;  bool calendarFile = false;  bool importFile = false;  QString option;  KApplication app( false, false );  KonsoleKalendarVariables variables;  KonsoleKalendarEpoch epochs;  if ( args->isSet("verbose") ) {     variables.setVerbose(true);  }  /*   *  Switch on adding   *   */  if ( args->isSet("add") ) {    view=false;    add=true;    if(variables.isVerbose()) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Add event" << endl;    }  }  /*   *  Switch on Create   *   */  if ( args->isSet("create") ) {    create=true;    if(variables.isVerbose()) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Create event" << endl;    }  }  /*   *  Switch on Change   *   */  if ( args->isSet("change") ) {    view=false;    add=false;    change=true;    if(variables.isVerbose()) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Change event" << endl;    }  }  /*   *  Switch on Delete   *   */  if ( args->isSet("delete") ) {    view=false;    add=false;    change=false;    del=true;    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Delete event" << endl;    }  }  /*   *  If there is summary attached.   *   */  if ( args->isSet("summary") ) {    option = args->getOption("summary");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Summary: (" << option << ")" << endl;    }    variables.setSummary(option);    //variables.setDate(date);  }  /*   *  If there is description attached.   *   */  if ( args->isSet("description") ) {    option = args->getOption("description");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Description: (" << option << ")" << endl;    }    variables.setDescription(option);    //variables.setDate(date);  }  /*   *  Show next happening and exit   *   */  if ( args->isSet("next") )  {    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Show next happening in calendar and exit" << endl;    }    variables.setNext(true);  }  /*   *  If we like to see some date   *   */  if ( args->isSet("date") )  {    option = args->getOption("date");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Show date info and exit: (" << option << ")" << endl;    }    date = variables.parseDate(option);    //variables.setDate(date);  }  /*   *  If we like to see some time   *   */  if ( args->isSet("time") ) {    option = args->getOption("time");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Show date info and exit: (" << option << ")" << endl;    }    time = variables.parseTime(option);    //variables.setDate(date);  }  /*   *  Set starting date for calendar   *   */  if ( args->isSet("start-date") ) {    option = args->getOption("start-date");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Start date: (" << option << ")" << endl;    }    startdate = variables.parseDate(option);    //variables.setStartDate(date);  }  /*   *  Set starting time   *   */  if ( args->isSet("start-time") ) {    option = args->getOption("start-time");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Start time: (" << option << ")" << endl;    }    starttime = variables.parseTime(option);    //variables.setStartDate(date);  }  /*   *  Set end date for calendar   *   */  if ( args->isSet("end-date") ) {    QString option = args->getOption("end-date");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | End date: (" << option << ")" << endl;    }    enddate = variables.parseDate(option);    //variables.setEndDate(date);  }  /*   *  Set ending time   *   */  if ( args->isSet("end-time") ) {    option = args->getOption("end-time");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | End time: (" << option << ")" << endl;    }    endtime = variables.parseTime(option);    // variables.setStartDate(date);  }  /*   *  Set start date/time from epoch   *   */  time_t epochstart=0;  if ( args->isSet("epoch-start") ) {      option = args->getOption("epoch-start");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Epoch start: (" << option << ")" << endl;    }    epochstart = (time_t) option.toULong(0,10);  }  /*   *  Set end date/time from epoch   *   */  time_t epochend=0;  if ( args->isSet("epoch-end") ) {      option = args->getOption("epoch-end");    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | Epoch end: (" << option << ")" << endl;    }    epochend = (time_t) option.toULong(0,10);  }  if( args->isSet("all") ) {    variables.setAll( true );  } else {    variables.setAll( false );  } // else  if ( args->isSet("import") ) {    importFile = true;    option = args->getOption("import");    variables.setImportFile( option );    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | importing file from: (" << option << ")" << endl;    } // if verbose  } // if  if ( args->isSet("file") ) {    calendarFile = true;    option = args->getOption("file");    variables.setCalendarFile( option );    if( variables.isVerbose() ) {      kdDebug() << "main.cpp::int main(int argc, char *argv[]) | using calendar at: (" << variables.getCalendarFile() << ")" << endl;    } // if verbose  } else {    KConfig cfg( locate( "config", "korganizerrc" ) );    cfg.setGroup("General");    KURL url( cfg.readPathEntry("Active Calendar") );    if ( url.isLocalFile() )    {      KalendarFile = url.path();      variables.setCalendarFile(KalendarFile);      if( variables.isVerbose() ) {        cout << "main.cpp::int main(int argc, char *argv[]) | Calendar file currently is " << variables.getCalendarFile().local8Bit() << endl;      } // if verbose    } else {      cout << i18n("Remote files are not supported yet.").local8Bit() << endl;    } // else  } // else  QDateTime startdatetime, enddatetime;  if ( args->isSet("epoch-start") ) {    startdatetime = epochs.epoch2QDateTime(epochstart);  } else {    startdatetime = QDateTime::QDateTime(startdate, starttime);  }  if ( args->isSet("epoch-end") ) {    enddatetime = epochs.epoch2QDateTime(epochend);  } else {    enddatetime = QDateTime::QDateTime(enddate, endtime);  }  QDateTime datetime( date, time );  variables.setStartDate( startdatetime );  variables.setEndDate( enddatetime );  variables.setDate( datetime );  if ( variables.isVerbose() ) {      // Tuukka, please fix so --verbose makes kdDebug print something.      kdDebug() << "DateTime=" << datetime.toString(Qt::TextDate) << endl;      kdDebug() << "StartDate=" << startdatetime.toString(Qt::TextDate) << endl;      kdDebug() << "EndDate=" << enddatetime.toString(Qt::TextDate) << endl;  } // if  args->clear(); // Free up some memory.  KonsoleKalendar *konsolekalendar = new KonsoleKalendar(variables);   if( calendarFile && create ) {     if( variables.isVerbose() ) {       kdDebug() << "main.cpp::int main(int argc, char *argv[]) | create file" << endl;     }     konsolekalendar->createCalendar();   } // if  /*   * Opens calendar file so we can use it;)   * Because at this point we don't know what we'll   * Do with it..   *   * Adds it to konsolekalendarvariables also..   */   if( konsolekalendar->openCalendar() ) {     if( importFile ) {       konsolekalendar->importCalendar();     }     if( add ) {       konsolekalendar->addEvent();     }     if( change ) {       konsolekalendar->changeEvent();     }     if( del ) {       konsolekalendar->deleteEvent();     }     if( view ) {       konsolekalendar->showInstance();     }     konsolekalendar->closeCalendar();   }   delete konsolekalendar;  if( variables.isVerbose() ) {    kdDebug() << "main.cpp::int main(int argc, char *argv[]) | exiting" << endl;  }  return 0;}