Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Get rid of custom video player app setting and uses system's default app to...

Get rid of custom video player app setting and uses system's default app to play videos after render
parent e347c148
......@@ -8,12 +8,6 @@ set(kdenlive_render_SRCS
add_executable(kdenlive_render ${kdenlive_render_SRCS})
include_directories(
)
#include(${QT_USE_FILE})
qt5_use_modules(kdenlive_render Widgets Concurrent DBus)
target_link_libraries(kdenlive_render
......
......@@ -282,8 +282,11 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("setRenderingFinished"), m_dbusargs);
}
m_logstream << "Rendering of " << m_dest << " finished" << endl;
if (!m_dualpass && m_player != QLatin1String("-"))
QProcess::startDetached(m_player, QStringList(m_dest));
if (!m_dualpass && !m_player.isEmpty()) {
QStringList args = m_player.split(QLatin1Char(' '));
QString exec = args.takeFirst();
QProcess::startDetached(exec, args);
}
if (m_dualpass) {
emit renderingFinished();
deleteLater();
......
......@@ -251,8 +251,8 @@ target_link_libraries(kdenlive
KF5::WidgetsAddons
KF5::Archive
KF5::CoreAddons
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOCore
KF5::KIOFileWidgets
KF5::KIOWidgets
KF5::NotifyConfig
KF5::NewStuff
......
......@@ -216,7 +216,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
connect(m_configEnv.kp_image, SIGNAL(clicked()), this, SLOT(slotEditImageApplication()));
connect(m_configEnv.kp_audio, SIGNAL(clicked()), this, SLOT(slotEditAudioApplication()));
connect(m_configEnv.kp_player, SIGNAL(clicked()), this, SLOT(slotEditVideoApplication()));
loadEncodingProfiles();
checkProfile();
......@@ -619,18 +618,6 @@ void KdenliveSettingsDialog::showPage(int page, int option)
}
}
void KdenliveSettingsDialog::slotEditVideoApplication()
{
KService::Ptr service;
QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(QList<QUrl>(), i18n("Select default video player"), m_configEnv.kcfg_defaultplayerapp->text(), this);
if (dlg->exec() == QDialog::Accepted) {
service = dlg->service();
m_configEnv.kcfg_defaultplayerapp->setText(KRun::binaryName(service->exec(), false));
}
delete dlg;
}
void KdenliveSettingsDialog::slotEditAudioApplication()
{
KService::Ptr service;
......
......@@ -55,7 +55,6 @@ private slots:
void slotUpdateShuttleDevice(int ix = 0);
void slotEditImageApplication();
void slotEditAudioApplication();
void slotEditVideoApplication();
void slotReadAudioDevices();
void slotUpdateGrabRegionStatus();
void slotCheckAlsaDriver();
......
......@@ -30,6 +30,8 @@
#include <KRun>
#include <KColorScheme>
#include <KNotification>
#include <KMimeTypeTrader>
#include <KIO/DesktopExecParser>
#include <qglobal.h>
#include <qstring.h>
......@@ -45,6 +47,7 @@
#include <QKeyEvent>
#include <QTimer>
#include <QStandardPaths>
#include <QMimeDatabase>
#include <QDir>
#include <locale>
......@@ -934,9 +937,6 @@ void RenderWidget::slotPrepareExport(bool scriptExport)
KMessageBox::sorry(this, i18n("Cannot find the melt program required for rendering (part of Mlt)"));
return;
}
if (m_view.play_after->isChecked() && KdenliveSettings::defaultplayerapp().isEmpty()) {
KMessageBox::sorry(this, i18n("Cannot play video after rendering because the default video player application is not set.\nPlease define it in Kdenlive settings dialog."));
}
QString chapterFile;
if (m_view.create_chapter->isChecked()) chapterFile = m_view.out_file->url().path() + ".dvdchapter";
......@@ -1121,10 +1121,14 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
render_process_args << KdenliveSettings::rendererpath();
render_process_args << m_profile.path << item->data(0, RenderRole).toString();
if (m_view.play_after->isChecked())
render_process_args << KdenliveSettings::KdenliveSettings::defaultplayerapp();
else
render_process_args << QStringLiteral("-");
if (m_view.play_after->isChecked()) {
QMimeDatabase db;
QMimeType mime = db.mimeTypeForFile(dest);
KService::Ptr serv = KMimeTypeTrader::self()->preferredService(mime.name());
KIO::DesktopExecParser parser(*serv, QList <QUrl>() << QUrl::fromLocalFile(dest));
render_process_args << parser.resultingArguments().join(QStringLiteral(" "));
}
else render_process_args << QString();
if (m_view.speed->isEnabled()) {
renderArgs.append(QChar(' ') + item->data(0, SpeedsRole).toStringList().at(m_view.speed->value()));
......@@ -2385,10 +2389,8 @@ QString RenderWidget::getFreeScriptName(const QUrl &projectName, const QString &
void RenderWidget::slotPlayRendering(QTreeWidgetItem *item, int)
{
RenderJobItem *renderItem = static_cast<RenderJobItem*> (item);
if (KdenliveSettings::defaultplayerapp().isEmpty() || renderItem->status() != FINISHEDJOB) return;
QList<QUrl> urls;
urls.append(QUrl::fromLocalFile(item->text(1)));
KRun::run(KdenliveSettings::defaultplayerapp(), urls, this);
if (renderItem->status() != FINISHEDJOB) return;
new KRun(QUrl::fromLocalFile(item->text(1)), this);
}
void RenderWidget::errorMessage(const QString &message)
......
......@@ -578,12 +578,6 @@ void Wizard::slotCheckPrograms()
if (program.isEmpty()) program = QStandardPaths::findExecutable(QStringLiteral("traverso"));
if (!program.isEmpty()) KdenliveSettings::setDefaultaudioapp(program);
}
if (KdenliveSettings::defaultplayerapp().isEmpty()) {
//TODO: re-add in KF5
/*KService::Ptr offer = KMimeTypeTrader::self()->preferredService("video/mpeg");
if (offer)
KdenliveSettings::setDefaultplayerapp(KRun::binaryName(offer->exec(), true));*/
}
if (allIsOk) {
removePage(4);
}
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>419</width>
<height>364</height>
<width>440</width>
<height>434</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
......@@ -282,28 +282,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Video player</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="kcfg_defaultplayerapp">
<property name="showClearButton" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="kp_player">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -325,7 +304,7 @@
<customwidgets>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<extends>QWidget</extends>
<header>kurlrequester.h</header>
<container>1</container>
</customwidget>
......
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