Commit bb258845 authored by Scott Wheeler's avatar Scott Wheeler

Copied over some code from FlashKard to load command line arguments.

svn path=/trunk/kdemultimedia/juk/; revision=168662
parent 8ecb6ef8
......@@ -19,6 +19,7 @@
#include <keditcl.h>
#include <kfiledialog.h>
#include <kiconloader.h>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include "juk.h"
......@@ -33,6 +34,7 @@ JuK::JuK(QWidget *parent, const char *name) : KMainWindow(parent, name)
setupLayout();
setupPlayer();
readConfig();
processArgs();
}
JuK::~JuK()
......@@ -123,6 +125,18 @@ void JuK::setupPlayer()
}
}
void JuK::processArgs()
{
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QStringList files;
for(int i = 0; i < args->count(); i++)
files.append(args->arg(i));
if(tagger)
tagger->add(files);
}
void JuK::readConfig()
{
KConfig *config = KGlobal::config();
......
......@@ -46,6 +46,7 @@ private:
void setupActions();
void setupLayout();
void setupPlayer();
void processArgs();
void readConfig();
void saveConfig();
......
......@@ -30,19 +30,19 @@ I18N_NOOP("JuK is a jukebox and tagger for KDE. \n"
static KCmdLineOptions options[] =
{
{ "+[file(s)]", I18N_NOOP("File(s) to open"), 0 },
{ 0, 0, 0 }
// INSERT YOUR COMMANDLINE OPTIONS HERE
};
int main(int argc, char *argv[])
{
KAboutData aboutData("juk", I18N_NOOP("JuK"),
VERSION, description, KAboutData::License_GPL,
"(c) 2002, Scott Wheeler", 0, 0, "scott@slackorama.net");
aboutData.addAuthor("Scott Wheeler", 0, "scott@slackorama.net");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);
KApplication a;
JuK *juk = new JuK();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment