Fix clip transcoding

parent 608e806f
......@@ -17,10 +17,6 @@ install(FILES
timeline_avthumbs.png
timeline_nothumbs.png
timeline_vthumbs.png
DESTINATION ${DATA_INSTALL_DIR}/kdenlive)
install(FILES kdenliveui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kdenlive)
install(FILES profiles.xml DESTINATION ${DATA_INSTALL_DIR}/kdenlive/export)
install(FILES
kdenliveeffectscategory.rc
kdenlive_projectprofiles.knsrc
kdenlive_renderprofiles.knsrc
......@@ -28,6 +24,8 @@ install(FILES
kdenlive_wipes.knsrc
kdenlivetranscodingrc
DESTINATION ${DATA_INSTALL_DIR}/kdenlive)
install(FILES kdenliveui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kdenlive)
install(FILES profiles.xml DESTINATION ${DATA_INSTALL_DIR}/kdenlive/export)
install(FILES kdenlive.xpm DESTINATION share/pixmaps)
install(FILES kdenlive.menu DESTINATION share/menu RENAME kdenlive)
install(FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
......
......@@ -823,7 +823,7 @@ void KdenliveSettingsDialog::slotCheckAlsaDriver()
void KdenliveSettingsDialog::loadTranscodeProfiles()
{
KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
m_configTranscode.profiles_list->blockSignals(true);
......@@ -845,7 +845,7 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
void KdenliveSettingsDialog::saveTranscodeProfiles()
{
KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
//KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup transConfig(config, "Transcoding");
// read the entries
......
......@@ -502,7 +502,7 @@ void DvdWizardVob::clear()
void DvdWizardVob::slotTranscodeFiles()
{
// Find transcoding infos related to selected DVD profile
KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QString profileEasyName;
......@@ -555,7 +555,7 @@ void DvdWizardVob::slotTranscodeFiles()
if (conv_pad %2 == 1) conv_pad --;
postParams << "-vf" << QString("scale=%1:%2,pad=%3:%4:%5:0,setdar=%6").arg(finalSize.width() - 2 * conv_pad).arg(destSize.height()).arg(finalSize.width()).arg(finalSize.height()).arg(conv_pad).arg(input_aspect);
}
ClipTranscode *d = new ClipTranscode(QList<QUrl> () << QUrl(item->text(0)), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
ClipTranscode *d = new ClipTranscode(QStringList () << item->text(0), params.section(';', 0, 0), postParams, i18n("Transcoding to DVD format"), true, this);
connect(d, SIGNAL(transcodedClip(QUrl,QUrl)), this, SLOT(slotTranscodedClip(QUrl,QUrl)));
d->slotStartTransCode();
d->show();
......
......@@ -2629,7 +2629,7 @@ void MainWindow::loadTranscoders()
QMenu *extractAudioMenu = static_cast<QMenu*>(factory()->container("extract_audio", this));
extractAudioMenu->clear();
KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QMap< QString, QString > profiles = transConfig.entryMap();
......@@ -2664,7 +2664,7 @@ void MainWindow::slotStartClipAction()
m_projectList->startClipFilterJob(filtername, condition);
}
void MainWindow::slotTranscode(const QList<QUrl> &urls)
void MainWindow::slotTranscode(const QStringList &urls)
{
QString params;
QString desc;
......@@ -2691,7 +2691,9 @@ void MainWindow::slotTranscode(const QList<QUrl> &urls)
void MainWindow::slotTranscodeClip()
{
QList<QUrl> urls = QFileDialog::getOpenFileUrls(this, i18n("Files to transcode"), QUrl("kfiledialog:///projectfolder"));
QString allExtensions = m_projectList->getExtensions().join(" ");
const QString dialogFilter = i18n("All Supported Files") + "(" + allExtensions + ");;" + i18n("All Files") + "(*)";
QStringList urls = QFileDialog::getOpenFileNames(this, i18n("Files to transcode"), "kfiledialog:///projectfolder", dialogFilter);
if (urls.isEmpty()) return;
slotTranscode(urls);
}
......
......@@ -392,7 +392,7 @@ private slots:
void slotAlignAudio();
void slotUpdateClipType(QAction *action);
void slotShowTimeline(bool show);
void slotTranscode(const QList<QUrl> &urls = QList<QUrl>());
void slotTranscode(const QStringList &urls = QStringList());
void slotStartClipAction();
void slotTranscodeClip();
/** @brief Archive project: creates a copy of the project file with all clips in a new folder. */
......
......@@ -23,10 +23,12 @@
#include <QDebug>
#include <QFontDatabase>
#include <QStandardPaths>
#include <KMessageBox>
#include <klocalizedstring.h>
ClipTranscode::ClipTranscode(const QList <QUrl> &urls, const QString &params, const QStringList &postParams, const QString &description, bool automaticMode, QWidget * parent) :
ClipTranscode::ClipTranscode(const QStringList &urls, const QString &params, const QStringList &postParams, const QString &description, bool automaticMode, QWidget * parent) :
QDialog(parent), m_urls(urls), m_duration(0), m_automaticMode(automaticMode), m_postParams(postParams)
{
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
......@@ -46,10 +48,10 @@ ClipTranscode::ClipTranscode(const QList <QUrl> &urls, const QString &params, co
auto_add->setChecked(KdenliveSettings::add_new_clip());
if (m_urls.count() == 1) {
QString fileName = m_urls.at(0).path(); //.section('.', 0, -1);
QString fileName = m_urls.first(); //.section('.', 0, -1);
QString newFile = params.section(' ', -1).replace("%1", fileName);
QUrl dest(newFile);
source_url->setUrl(m_urls.at(0));
source_url->setUrl(m_urls.first());
dest_url->setMode(KFile::File);
dest_url->setUrl(dest);
dest_url->setMode(KFile::File);//OperationMode(KFileDialog::Saving);
......@@ -60,10 +62,10 @@ ClipTranscode::ClipTranscode(const QList <QUrl> &urls, const QString &params, co
source_url->setHidden(true);
label_dest->setText(i18n("Destination folder"));
dest_url->setMode(KFile::Directory);
dest_url->setUrl(QUrl(m_urls.at(0).adjusted(QUrl::RemoveFilename)));
dest_url->setUrl(QUrl::fromLocalFile(m_urls.first()).adjusted(QUrl::RemoveFilename));
dest_url->setMode(KFile::Directory | KFile::ExistingOnly);
for (int i = 0; i < m_urls.count(); ++i)
urls_list->addItem(m_urls.at(i).path());
urls_list->addItem(m_urls.at(i));
}
if (!params.isEmpty()) {
label_profile->setHidden(true);
......@@ -74,7 +76,7 @@ ClipTranscode::ClipTranscode(const QList <QUrl> &urls, const QString &params, co
} else transcode_info->setHidden(true);
} else {
// load Profiles
KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc", KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QMap< QString, QString > profiles = transConfig.entryMap();
......
......@@ -34,7 +34,7 @@ class ClipTranscode : public QDialog, public Ui::ClipTranscode_UI
Q_OBJECT
public:
ClipTranscode(const QList<QUrl> &urls, const QString &params, const QStringList &postParams, const QString &description, bool automaticMode = false, QWidget * parent = 0);
ClipTranscode(const QStringList &urls, const QString &params, const QStringList &postParams, const QString &description, bool automaticMode = false, QWidget * parent = 0);
~ClipTranscode();
public slots:
......@@ -48,7 +48,7 @@ private slots:
private:
QProcess m_transcodeProcess;
QList<QUrl> m_urls;
QStringList m_urls;
int m_duration;
bool m_automaticMode;
/** @brief The path for destination transcoded file. */
......
......@@ -1705,7 +1705,6 @@ void ProjectList::slotAddClip(const QList <QUrl> &givenList, const QString &grou
QList <QUrl> list;
if (givenList.isEmpty()) {
QString allExtensions = getExtensions().join(" ");
qDebug()<<"*********\nEXTENSIONS: "<<allExtensions<<"\n********************";
const QString dialogFilter = i18n("All Supported Files") + "(" + allExtensions + ");;" + i18n("All Files") + "(*)";
QCheckBox *b = new QCheckBox(i18n("Import image sequence"));
b->setChecked(KdenliveSettings::autoimagesequence());
......
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