From 092be7678b67552cb3161fe162242bf8d3aeed2f Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 17 Feb 2010 00:54:13 +0000 Subject: Added old abandoned KDE3 version of kmplayer git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmplayer@1091557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/main.cpp | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 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..c10df5b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,90 @@ +/*************************************************************************** + main.cpp - description + ------------------- +begin : Sat Dec 7 16:14:51 CET 2002 +copyright : (C) 2002 by Koos Vriezen +email : + ***************************************************************************/ + +/*************************************************************************** +* * +* 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. * +* * + ***************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "kmplayer.h" + +static const char description[] = I18N_NOOP("KMPlayer"); + + +static KCmdLineOptions options[] = +{ + { "+[File]", I18N_NOOP("file to open"), 0 }, + KCmdLineLastOption + // INSERT YOUR COMMANDLINE OPTIONS HERE +}; + +extern "C" { + + KDE_EXPORT int kdemain (int argc, char *argv[]) + { + setsid (); + + KAboutData aboutData ("kmplayer", I18N_NOOP ("KMPlayer"), + VERSION, description, KAboutData::License_GPL, + "(c) 2002-2005, Koos Vriezen", 0, 0, ""); + aboutData.addAuthor( "Koos Vriezen",0, ""); + KCmdLineArgs::init (argc, argv, &aboutData); + KCmdLineArgs::addCmdLineOptions (options); // Add our own options. + + KMPlayer::StringPool::init(); + + KApplication app; + QGuardedPtr kmplayer; + + if (app.isRestored ()) { + RESTORE (KMPlayerApp); + } else { + kmplayer = new KMPlayerApp (); + kmplayer->show(); + + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + KURL url; + if (args->count () == 1) + url = args->url (0); + if (args->count () > 1) + for (int i = 0; i < args->count (); i++) { + KURL url = args->url (i); + if (url.url ().find ("://") < 0) + url = KURL (QFileInfo (url.url ()).absFilePath ()); + if (url.isValid ()) + kmplayer->addURL (url); + } + kmplayer->openDocumentFile (url); + args->clear (); + } + app.dcopClient()->registerAs("kmplayer"); + int retvalue = app.exec (); + + delete kmplayer; + + KMPlayer::StringPool::reset(); + + return retvalue; + } +} -- cgit v1.2.3