]> git.sesse.net Git - kdenlive/blob - src/kdenlivedoc.cpp
Starting KDE4 porting
[kdenlive] / src / kdenlivedoc.cpp
1 /***************************************************************************
2                         kdenlivedoc.cpp  -  description
3                            -------------------
4   begin                : Fri Nov 22 2002
5   copyright            : (C) 2002 by Jason Wood
6   email                : jasonwood@blueyonder.co.uk
7   copyright            : (C) 2005 Lucio Flavio Correa
8   email                : lucio.correa@gmail.com
9   copyright            : (C) Marco Gittler
10   email                : g.marco@freenet.de
11   copyright            : (C) 2006 Jean-Baptiste Mardelle
12   email                : jb@ader.ch
13
14 ***************************************************************************/
15
16 /***************************************************************************
17  *                                                                         *
18  *   This program is free software; you can redistribute it and/or modify  *
19  *   it under the terms of the GNU General Public License as published by  *
20  *   the Free Software Foundation; either version 2 of the License, or     *
21  *   (at your option) any later version.                                   *
22  *                                                                         *
23  ***************************************************************************/
24
25
26 #include <KDebug>
27 #include <KStandardDirs>
28 #include <KMessageBox>
29 #include <KLocale>
30 #include <KFileDialog>
31 #include <KIO/NetAccess>
32
33
34 #include "kdenlivedoc.h"
35
36 KdenliveDoc::KdenliveDoc(KUrl url, double fps, int width, int height, QWidget *parent):QObject(parent), m_url(url), m_projectName(NULL)
37 {
38   if (!url.isEmpty()) {
39     QString tmpFile;
40     if(KIO::NetAccess::download(url.path(), tmpFile, parent))
41   {
42     QFile file(tmpFile);
43     m_document.setContent(&file, false);
44     file.close();
45     m_projectName = url.fileName();
46  
47     KIO::NetAccess::removeTempFile(tmpFile);
48   }
49   else
50   {
51     KMessageBox::error(parent, 
52         KIO::NetAccess::lastErrorString());
53   }
54   }
55 }
56
57 KdenliveDoc::~KdenliveDoc()
58 {
59 }
60
61 QString KdenliveDoc::documentName()
62 {
63   return m_projectName;
64 }
65
66 QDomNodeList KdenliveDoc::producersList()
67 {
68   return m_document.elementsByTagName("producer");
69 }
70
71 #include "kdenlivedoc.moc"
72