]> git.sesse.net Git - kdenlive/commitdiff
Add command line option ( --mlt-path ) to give location of the MLT install
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Oct 2008 14:38:05 +0000 (14:38 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Oct 2008 14:38:05 +0000 (14:38 +0000)
svn path=/branches/KDE4/; revision=2458

src/main.cpp
src/mainwindow.cpp
src/mainwindow.h

index 362ad4a3bf5f396526d1f2fa434d76eb52b9907e..4f8823771d3f536efb5c41f382a09639700a6b78 100644 (file)
@@ -18,7 +18,6 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
-
 #include <KApplication>
 #include <KAboutData>
 #include <KDebug>
 #include "mainwindow.h"
 
 int main(int argc, char *argv[]) {
-    KAboutData aboutData("kdenlive", "kdenlive",
-                         ki18n("Kdenlive"), "0.7",
+    KAboutData aboutData(QByteArray("kdenlive"), QByteArray("kdenlive"),
+                         ki18n("Kdenlive"), QByteArray("0.7"),
                          ki18n("An open source video editor."),
                          KAboutData::License_GPL,
                          ki18n("Copyright (c) 2008 Development team"));
     aboutData.addAuthor(ki18n("Jean-Baptiste Mardelle"), ki18n("Mlt porting, KDE4 porting, Main developer"), "jb@kdenlive.org");
     aboutData.addAuthor(ki18n("Marco Gittler"), ki18n("MltConnection, Transition, Effect, Timeline Developer"), "g.marco@freenet.de");
     aboutData.setHomepage("http://kdenlive.org");
+    //aboutData.setBugAddress("http://kdenlive.org/mantis");
     KCmdLineArgs::init(argc, argv, &aboutData);
 
-    KCmdLineOptions options; //new
+    KCmdLineOptions options;
+    options.add("mlt-path <path>", ki18n("Set the path for MLT environnement"));
     options.add("+[file]", ki18n("Document to open")); //new
     KCmdLineArgs::addCmdLineOptions(options); //new
 
@@ -58,10 +59,11 @@ int main(int argc, char *argv[]) {
             ++n;
         }
     } else {
-        MainWindow* window = new MainWindow();
-        window->show();
-
         KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
+
+        QString mltPath = args->getOption("mlt-path");
+        MainWindow* window = new MainWindow(mltPath);
+        window->show();
         if (args->count()) { //new
             window->openFile(args->url(0)); //new
         }
index 90a4d7cb4b9d08de01b58554d744b3569a7cfa85..d73d5ea859daebe5576cf042b43e812950fd7a90 100644 (file)
@@ -96,12 +96,12 @@ EffectsList MainWindow::audioEffects;
 EffectsList MainWindow::customEffects;
 EffectsList MainWindow::transitions;
 
-MainWindow::MainWindow(QWidget *parent)
+MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
         : KXmlGuiWindow(parent),
         m_activeDocument(NULL), m_activeTimeline(NULL), m_renderWidget(NULL), m_jogProcess(NULL), m_findActivated(false), m_initialized(false) {
     setlocale(LC_NUMERIC, "POSIX");
     setFont(KGlobalSettings::toolBarFont());
-    parseProfiles();
+    parseProfiles(MltPath);
     m_commandStack = new QUndoGroup;
     m_timelineArea = new KTabWidget(this);
     m_timelineArea->setTabReorderingEnabled(true);
@@ -980,10 +980,15 @@ void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles) {
 }
 
 
-void MainWindow::parseProfiles() {
+void MainWindow::parseProfiles(const QString &mltPath) {
     //kdDebug()<<" + + YOUR MLT INSTALL WAS FOUND IN: "<< MLT_PREFIX <<endl;
 
     //KdenliveSettings::setDefaulttmpfolder();
+    if (!mltPath.isEmpty()) {
+        KdenliveSettings::setMltpath(mltPath + "/share/mlt/profiles/");
+        KdenliveSettings::setRendererpath(mltPath + "/bin/inigo");
+    }
+
     if (KdenliveSettings::mltpath().isEmpty()) {
         KdenliveSettings::setMltpath(QString(MLT_PREFIX) + QString("/share/mlt/profiles/"));
     }
index 6973e0254dfa0392445acf12264a068024cceb1f..f15288ea1ddcdb7747720c9e626348e66ac1ebdb 100644 (file)
@@ -61,8 +61,8 @@ class MainWindow : public KXmlGuiWindow {
     Q_OBJECT
 
 public:
-    MainWindow(QWidget *parent = 0);
-    void parseProfiles();
+    MainWindow(const QString &MltPath = QString(), QWidget *parent = 0);
+    void parseProfiles(const QString &mltPath = QString());
 
     static EffectsList videoEffects;
     static EffectsList audioEffects;