From e2f541c98dfa4081fa3ab3d28f08ea2309281884 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 15 Mar 2010 17:32:48 +0000 Subject: Added KDE3 version of kdesvn git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1103685 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/main.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/main.cpp (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..cee2ef2 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,97 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + + +#include "kdesvn.h" +#include "commandline.h" +#include "kdesvn-config.h" +#include +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A Subversion Client for KDE (standalone application)"); + +static const char version[] = VERSION; + +static KCmdLineOptions options[] = +{ + { "r startrev[:endrev]",I18N_NOOP("Execute single subversion command on specific revision(-range)"),0}, + {"R",I18N_NOOP("Ask for revision when executing single command"),0}, + {"f",I18N_NOOP("Force operation"),0}, + {"o ",I18N_NOOP("Save output of subversion command (eg \"cat\") into file "),0}, + {"l ",I18N_NOOP("Limit log output to "),0}, + { "+exec ",I18N_NOOP("Execute subversion command (\"exec help\" for more information)"),0}, + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("kdesvn", I18N_NOOP("kdesvn"), version, description, + KAboutData::License_GPL, "(C) 2005-2007 Rajko Albrecht",0, + 0, "ral@alwins-world.de"); + about.addAuthor( "Rajko Albrecht", 0, "ral@alwins-world.de" ); + about.setHomepage("http://kdesvn.alwins-world.de/"); + about.setBugAddress("kdesvn-bugs@alwins-world.de"); + + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + + + KApplication app; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(kdesvn); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + kdesvn *widget = new kdesvn; + widget->show(); + widget->checkReload(); + } + else + { + if (QString(args->arg(0))==QString("exec")) { + kdDebug()<<"Execute a command" << endl; + CommandLine cl(args); + return cl.exec(); + } else { + int i = 0; + for (; i < args->count(); i++) + { + kdesvn *widget = new kdesvn; + widget->show(); + widget->load(args->url(i),true); + } + } + } + args->clear(); + } + return app.exec(); +} -- cgit v1.2.1