aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmpui')
-rw-r--r--src/qmmpui/commandlinemanager.cpp6
-rw-r--r--src/qmmpui/commandlinemanager.h5
-rw-r--r--src/qmmpui/commandlineoption.h5
-rw-r--r--src/qmmpui/generalhandler.cpp6
-rw-r--r--src/qmmpui/generalhandler.h6
5 files changed, 17 insertions, 11 deletions
diff --git a/src/qmmpui/commandlinemanager.cpp b/src/qmmpui/commandlinemanager.cpp
index e6b23ac4c..82c8d7861 100644
--- a/src/qmmpui/commandlinemanager.cpp
+++ b/src/qmmpui/commandlinemanager.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008 by Ilya Kotov *
+ * Copyright (C) 2008-2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -79,14 +79,14 @@ CommandLineManager::~CommandLineManager()
{
}
-void CommandLineManager::executeCommand(const QString& opt_str)
+void CommandLineManager::executeCommand(const QString& opt_str, const QStringList &args)
{
checkOptions();
foreach(CommandLineOption *opt, *m_options)
{
if (opt->identify(opt_str))
{
- opt->executeCommand(opt_str, this);
+ opt->executeCommand(opt_str, args);
return;
}
}
diff --git a/src/qmmpui/commandlinemanager.h b/src/qmmpui/commandlinemanager.h
index a985f260a..aa393ac42 100644
--- a/src/qmmpui/commandlinemanager.h
+++ b/src/qmmpui/commandlinemanager.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2009 by Ilya Kotov *
+ * Copyright (C) 2008-2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -43,8 +43,9 @@ public:
/*!
* Executes command \b opt_str
* @param opt_str Command line option string
+ * @param args Command arguments
*/
- void executeCommand(const QString& opt_str);
+ void executeCommand(const QString& opt_str, const QStringList &args = QStringList());
/*!
* Return \b true if command \b opt_str is supported, otherwise returns \b false
*/
diff --git a/src/qmmpui/commandlineoption.h b/src/qmmpui/commandlineoption.h
index 9799d063e..edbd40a5c 100644
--- a/src/qmmpui/commandlineoption.h
+++ b/src/qmmpui/commandlineoption.h
@@ -25,6 +25,7 @@ class CommandLineManager;
class QTranslator;
class QString;
class QObject;
+class QStringList;
/*! @brief Abstract base class of the command line plugins.
* @author Vladimir Kuznetsov <vovanec@gmail.ru>
@@ -47,8 +48,10 @@ public:
virtual const QString helpString()const = 0;
/*!
* Parses \b opt_str args(if needed), executes command.
+ * @param opt_str Command to execute
+ * @param args Command arguments
*/
- virtual void executeCommand(const QString& opt_str, CommandLineManager* clm) = 0;
+ virtual void executeCommand(const QString &opt_str, const QStringList &args) = 0;
/*!
* Creates translator with parent object \b parent
*/
diff --git a/src/qmmpui/generalhandler.cpp b/src/qmmpui/generalhandler.cpp
index 744591243..fa8659046 100644
--- a/src/qmmpui/generalhandler.cpp
+++ b/src/qmmpui/generalhandler.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2009 by Ilya Kotov *
+ * Copyright (C) 2008-2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -102,10 +102,10 @@ bool GeneralHandler::visibilityControl()
return FALSE;
}
-void GeneralHandler::executeCommand(const QString &opt_str)
+void GeneralHandler::executeCommand(const QString &opt_str, const QStringList &args)
{
if (CommandLineManager::hasOption(opt_str))
- m_commandLineManager->executeCommand(opt_str);
+ m_commandLineManager->executeCommand(opt_str, args);
}
void GeneralHandler::addAction(QAction *action, MenuType type)
diff --git a/src/qmmpui/generalhandler.h b/src/qmmpui/generalhandler.h
index fa064f3ee..5d2e9cef0 100644
--- a/src/qmmpui/generalhandler.h
+++ b/src/qmmpui/generalhandler.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2009 by Ilya Kotov *
+ * Copyright (C) 2008-2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -24,6 +24,7 @@
#include <QMap>
#include <QList>
#include <QPointer>
+#include <QStringList>
class QAction;
class QMenu;
@@ -76,8 +77,9 @@ public:
/*!
* Executes command by command line plugins
* @param opt_str Command line option string
+ * @param args Command arguments
*/
- void executeCommand(const QString &opt_str);
+ void executeCommand(const QString &opt_str, const QStringList &args = QStringList());
/*!
* Adds the newly created action to the menu with type \b type.
* Menu with type \b type should be created first.