EffectsList MainWindow::customEffects;
EffectsList MainWindow::transitions;
+QMap <QString,QImage> MainWindow::m_lumacache;
+
MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & clipsToLoad, QWidget *parent) :
KXmlGuiWindow(parent),
m_activeDocument(NULL),
char *separator = localeconv()->decimal_point;
if (separator != systemLocale.decimalPoint()) {
kDebug()<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
- // HACK: There is a locale conflict, so set locale to at least have correct decimal point
- if (strncmp(separator, ".", 1) == 0) systemLocale = QLocale::c();
- else if (strncmp(separator, ",", 1) == 0) systemLocale = QLocale("fr_FR.UTF-8");
+ // HACK: There is a locale conflict, so set locale to C
+ // Make sure to override exported values or it won't work
+ setenv("LANG", "C", 1);
+ setlocale(LC_NUMERIC, "C");
+ systemLocale = QLocale::c();
}
systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
// FIXME: the next call returns a newly allocated object, which leaks
initEffects::parseEffectFiles();
//initEffects::parseCustomEffectsFile();
-
+
m_monitorManager = new MonitorManager();
m_shortcutRemoveFocus = new QShortcut(QKeySequence("Esc"), this);
KActionCategory *layoutActions = new KActionCategory(i18n("Layouts"), actionCollection());
m_loadLayout = new KSelectAction(i18n("Load Layout"), actionCollection());
for (int i = 1; i < 5; i++) {
- KAction *load = new KAction(KIcon(), i18n("Layout %1").arg(i), this);
- load->setData("_" + QString::number(i));
+ KAction *load = new KAction(KIcon(), i18n("Layout %1", i), this);
+ load->setData('_' + QString::number(i));
layoutActions->addAction("load_layout" + QString::number(i), load);
m_loadLayout->addAction(load);
- KAction *save = new KAction(KIcon(), i18n("Save As Layout %1").arg(i), this);
- save->setData("_" + QString::number(i));
+ KAction *save = new KAction(KIcon(), i18n("Save As Layout %1", i), this);
+ save->setData('_' + QString::number(i));
layoutActions->addAction("save_layout" + QString::number(i), save);
}
+ // Required to enable user to add the load layout action to toolbar
layoutActions->addAction("load_layouts", m_loadLayout);
connect(m_loadLayout, SIGNAL(triggered(QAction*)), this, SLOT(slotLoadLayout(QAction*)));
m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
m_effectsActionCollection->readSettings();
+ // Populate View menu with show / hide actions for dock widgets
+ KActionCategory *guiActions = new KActionCategory(i18n("Interface"), actionCollection());
+
setupGUI();
// Find QDockWidget tab bars and show / hide widget title bars on right click
connect(m, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
connect(m_effectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
- connect(m_transitionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTransition(QAction *)));
-
- QMenu *viewMenu = static_cast<QMenu*>(factory()->container("dockwindows", this));
- const QList<QAction *> viewActions = createPopupMenu()->actions();
- viewMenu->insertActions(NULL, viewActions);
+ connect(m_transitionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTransition(QAction *)));
m_timelineContextMenu = new QMenu(this);
m_timelineContextClipMenu = new QMenu(this);
if (!clipsToLoad.isEmpty() && m_activeDocument) {
QStringList list = clipsToLoad.split(',');
QList <QUrl> urls;
- foreach(QString path, list) {
+ foreach(const QString &path, list) {
kDebug() << QDir::current().absoluteFilePath(path);
urls << QUrl::fromLocalFile(QDir::current().absoluteFilePath(path));
}
actionCollection()->addAssociatedWidget(m_clipMonitor->container());
actionCollection()->addAssociatedWidget(m_projectMonitor->container());
+ QMap <QString, KAction *> viewActions;
+ KAction *showTimeline = new KAction(i18n("Timeline"), this);
+ showTimeline->setCheckable(true);
+ showTimeline->setChecked(true);
+ connect(showTimeline, SIGNAL(triggered(bool)), this, SLOT(slotShowTimeline(bool)));
+ viewActions.insert(showTimeline->text(), showTimeline);
+
+ QList <QDockWidget *> docks = findChildren<QDockWidget *>();
+ for (int i = 0; i < docks.count(); i++) {
+ QDockWidget* dock = docks.at(i);
+ KAction* dockInformations = new KAction(this);
+ dockInformations->setText(dock->windowTitle());
+ dockInformations->setCheckable(true);
+ dockInformations->setChecked(!dock->isHidden());
+ connect(dockInformations,SIGNAL(toggled(bool)), dock, SLOT(setVisible(bool)));
+ viewActions.insert(dockInformations->text(), dockInformations);
+ }
+
+
+ KMenu *viewMenu = static_cast<KMenu*>(factory()->container("dockwindows", this));
+ //const QList<QAction *> viewActions = createPopupMenu()->actions();
+ QMap<QString, KAction *>::const_iterator i = viewActions.constBegin();
+ while (i != viewActions.constEnd()) {
+ viewMenu->addAction(guiActions->addAction(i.key(), i.value()));
+ ++i;
+ }
+
// Populate encoding profiles
KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
if (KdenliveSettings::proxyparams().isEmpty() || KdenliveSettings::proxyextension().isEmpty()) {
if (m_activeDocument->url().fileName().isEmpty())
message = i18n("Save changes to document?");
else
- message = i18n("The project <b>\"%1\"</b> has been changed.\nDo you want to save your changes?").arg(m_activeDocument->url().fileName());
+ message = i18n("The project <b>\"%1\"</b> has been changed.\nDo you want to save your changes?", m_activeDocument->url().fileName());
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QString &, int, int)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QString &, int, int)));
connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QImage &)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QImage &)));
+
+ kDebug()<<" - - - - - -\n CONNECTED REPLY";
connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool)));
connect(m_projectMonitor->render, SIGNAL(removeInvalidClip(const QString &, bool)), m_projectList, SLOT(slotRemoveInvalidClip(const QString &, bool)));
pasteEffects->setData("paste_effects");
connect(pasteEffects , SIGNAL(triggered()), this, SLOT(slotPasteEffects()));
- QAction *showTimeline = new KAction(i18n("Show Timeline"), this);
- collection.addAction("show_timeline", showTimeline);
- showTimeline->setCheckable(true);
- showTimeline->setChecked(true);
- connect(showTimeline, SIGNAL(triggered(bool)), this, SLOT(slotShowTimeline(bool)));
-
QAction *showTitleBar = new KAction(i18n("Show Title Bars"), this);
collection.addAction("show_titlebars", showTitleBar);
showTitleBar->setCheckable(true);
KStandardAction::saveAs(this, SLOT(saveFileAs()), collection);
KStandardAction::openNew(this, SLOT(newFile()), collection);
// TODO: make the following connection to slotEditKeys work
- KStandardAction::keyBindings(this, SLOT(slotEditKeys()), collection);
+ //KStandardAction::keyBindings(this, SLOT(slotEditKeys()), collection);
KStandardAction::preferences(this, SLOT(slotPreferences()), collection);
KStandardAction::configureNotifications(this, SLOT(configureNotifications()), collection);
KStandardAction::copy(this, SLOT(slotCopy()), collection);
foreach(const QString & key, entries) {
if (key.endsWith(QString("_%1").arg(i))) {
// Found previously saved layout
- QString layoutName = key.section("_", 0, -2);
+ QString layoutName = key.section('_', 0, -2);
for (int j = 0; j < loadActions.count(); j++) {
- if (loadActions.at(j)->data().toString().endsWith("_" + QString::number(i))) {
+ if (loadActions.at(j)->data().toString().endsWith('_' + QString::number(i))) {
loadActions[j]->setText(layoutName);
loadActions[j]->setData(key);
break;
}
}
for (int j = 0; j < saveActions.count(); j++) {
- if (saveActions.at(j)->data().toString().endsWith("_" + QString::number(i))) {
- saveActions[j]->setText(i18n("Save as %1").arg(layoutName));
+ if (saveActions.at(j)->data().toString().endsWith('_' + QString::number(i))) {
+ saveActions[j]->setText(i18n("Save as %1", layoutName));
saveActions[j]->setData(key);
break;
}
layouts.deleteEntry(originallayoutName);
QByteArray st = saveState();
- layoutName.append("_" + QString::number(layoutId));
+ layoutName.append('_' + QString::number(layoutId));
layouts.writeEntry(layoutName, st.toBase64());
loadLayouts();
}
}
}
-
+ if (KdenliveSettings::ffmpegpath().isEmpty() || KdenliveSettings::ffplaypath().isEmpty()) upgrade = true;
if (!initialGroup.exists() || upgrade) {
// this is our first run, show Wizard
- Wizard *w = new Wizard(upgrade, this);
+ QPointer<Wizard> w = new Wizard(upgrade, this);
if (w->exec() == QDialog::Accepted && w->isOk()) {
w->adjustSettings();
initialGroup.writeEntry("version", version);
delete w;
} else {
+ delete w;
::exit(1);
}
}
void MainWindow::slotRunWizard()
{
- Wizard *w = new Wizard(false, this);
+ QPointer<Wizard> w = new Wizard(false, this);
if (w->exec() == QDialog::Accepted && w->isOk()) {
w->adjustSettings();
}
if (!closeCurrentDocument())
return;
} else {
- ProjectSettings *w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
- if (w->exec() != QDialog::Accepted)
+ QPointer<ProjectSettings> w = new ProjectSettings(NULL, QMap <QString, QString> (), QStringList(), projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this);
+ if (w->exec() != QDialog::Accepted) {
+ delete w;
return;
+ }
if (!KdenliveSettings::activatetabs())
- if (!closeCurrentDocument())
+ if (!closeCurrentDocument()) {
+ delete w;
return;
+ }
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs())
slotSwitchVideoThumbs();
if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs())
if (m_activeDocument->url().fileName().isEmpty())
message = i18n("Save changes to document?");
else
- message = i18n("The project <b>\"%1\"</b> has been changed.\nDo you want to save your changes?").arg(m_activeDocument->url().fileName());
+ message = i18n("The project <b>\"%1\"</b> has been changed.\nDo you want to save your changes?", m_activeDocument->url().fileName());
switch (KMessageBox::warningYesNoCancel(this, message)) {
case KMessageBox::Yes :
// save document here. If saving fails, return false;
if (mime.data()->is("application/x-compressed-tar")) {
// Opening a compressed project file, we need to process it
kDebug()<<"Opening archive, processing";
- ArchiveWidget *ar = new ArchiveWidget(url);
+ QPointer<ArchiveWidget> ar = new ArchiveWidget(url);
if (ar->exec() == QDialog::Accepted) openFile(KUrl(ar->extractedProjectFile()));
delete ar;
return;
if (KdenliveSettings::rendererpath().isEmpty()) {
// Cannot find the MLT melt renderer, ask for location
- KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of MLT)"), this);
+ QPointer<KUrlRequesterDialog> getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of MLT)"), this);
if (getUrl->exec() == QDialog::Rejected) {
+ delete getUrl;
::exit(0);
}
KUrl rendererPath = getUrl->selectedUrl();
}
if (profilesList.isEmpty()) {
// Cannot find the MLT profiles, ask for location
- KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your MLT profiles, please give the path"), this);
+ QPointer<KUrlRequesterDialog> getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your MLT profiles, please give the path"), this);
getUrl->fileDialog()->setMode(KFile::Directory);
if (getUrl->exec() == QDialog::Rejected) {
+ delete getUrl;
::exit(0);
}
KUrl mltPath = getUrl->selectedUrl();
void MainWindow::slotEditProjectSettings()
{
QPoint p = m_activeDocument->getTracksCount();
- ProjectSettings *w = new ProjectSettings(m_projectList, m_activeDocument->metadata(), m_activeTimeline->projectView()->extractTransitionsLumas(), p.x(), p.y(), m_activeDocument->projectFolder().path(), true, !m_activeDocument->isModified(), this);
+ QPointer<ProjectSettings> w = new ProjectSettings(m_projectList, m_activeDocument->metadata(), m_activeTimeline->projectView()->extractTransitionsLumas(), p.x(), p.y(), m_activeDocument->projectFolder().path(), true, !m_activeDocument->isModified(), this);
connect(w, SIGNAL(disableProxies()), this, SLOT(slotDisableProxies()));
if (w->exec() == QDialog::Accepted) {
disconnect(m_effectStack, SIGNAL(updateEffect(ClipItem*, int, QDomElement, QDomElement, int,bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, int, QDomElement, QDomElement, int,bool)));
disconnect(m_effectStack, SIGNAL(removeEffect(ClipItem*, int, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, int, QDomElement)));
disconnect(m_effectStack, SIGNAL(addEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*, QDomElement)));
- disconnect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, int, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, int, bool)));
- disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int, int)));
+ disconnect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, QList <int>, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, QList <int>, bool)));
+ disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, QList<int>, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, QList <int>, int)));
disconnect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
disconnect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
disconnect(m_effectStack, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(m_projectList, SIGNAL(clipNameChanged(const QString, const QString)), trackView->projectView(), SLOT(clipNameChanged(const QString, const QString)));
- //connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(configTrack(int)), this, SLOT(slotConfigTrack(int)));
connect(trackView, SIGNAL(updateTracksInfo()), this, SLOT(slotUpdateTrackInfo()));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(m_projectList, SIGNAL(gotFilterJobResults(const QString &, int, int, const QString &, stringMap)), trackView->projectView(), SLOT(slotGotFilterJobResults(const QString &, int, int, const QString &, stringMap)));
+ // Effect stack signals
connect(m_effectStack, SIGNAL(updateEffect(ClipItem*, int, QDomElement, QDomElement, int,bool)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, int, QDomElement, QDomElement, int,bool)));
connect(m_effectStack, SIGNAL(updateClipRegion(ClipItem*, int, QString)), trackView->projectView(), SLOT(slotUpdateClipRegion(ClipItem*, int, QString)));
connect(m_effectStack, SIGNAL(removeEffect(ClipItem*, int, QDomElement)), trackView->projectView(), SLOT(slotDeleteEffect(ClipItem*, int, QDomElement)));
connect(m_effectStack, SIGNAL(addEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*, QDomElement)));
- connect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, int, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, int, bool)));
- connect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int, int)));
+ connect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, QList <int>, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, QList <int>, bool)));
+ connect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, QList <int>, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, QList <int>, int)));
connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
- connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
- connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
- connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(setCursorPos(int)));
+ connect(m_effectStack, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(seekCursorPos(int)));
connect(m_effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
connect(m_effectStack, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
+
+ // Transition config signals
+ connect(m_transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
+ connect(m_transitionConfig, SIGNAL(seekTimeline(int)), trackView->projectView() , SLOT(seekCursorPos(int)));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(slotActivateMonitor()));
connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
}
QString id = clip->getId();
CommentedTime marker(pos, i18n("Marker"));
- MarkerDialog d(clip, marker, m_activeDocument->timecode(), i18n("Add Marker"), this);
- if (d.exec() == QDialog::Accepted)
- m_activeTimeline->projectView()->slotAddClipMarker(id, d.newMarker().time(), d.newMarker().comment());
+ QPointer<MarkerDialog> d = new MarkerDialog(clip, marker,
+ m_activeDocument->timecode(), i18n("Add Marker"), this);
+ if (d->exec() == QDialog::Accepted)
+ m_activeTimeline->projectView()->slotAddClipMarker(id, d->newMarker().time(), d->newMarker().comment());
+ delete d;
}
void MainWindow::slotDeleteClipMarker()
}
CommentedTime marker(pos, oldcomment);
- MarkerDialog d(clip, marker, m_activeDocument->timecode(), i18n("Edit Marker"), this);
- if (d.exec() == QDialog::Accepted) {
- m_activeTimeline->projectView()->slotAddClipMarker(id, d.newMarker().time(), d.newMarker().comment());
- if (d.newMarker().time() != pos) {
+ QPointer<MarkerDialog> d = new MarkerDialog(clip, marker,
+ m_activeDocument->timecode(), i18n("Edit Marker"), this);
+ if (d->exec() == QDialog::Accepted) {
+ m_activeTimeline->projectView()->slotAddClipMarker(id, d->newMarker().time(), d->newMarker().comment());
+ if (d->newMarker().time() != pos) {
// remove old marker
m_activeTimeline->projectView()->slotAddClipMarker(id, pos, QString());
}
}
+ delete d;
}
void MainWindow::slotAddMarkerGuideQuickly()
else
effect = customEffects.getEffectByTag(info.at(0), info.at(1));
if (!effect.isNull()) slotAddEffect(effect);
- else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2").arg(info.at(0)).arg(info.at(1)), ErrorMessage);
+ else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2", info.at(0), info.at(1)), ErrorMessage);
}
return;
}
QString path = clip->getProperty("resource");
- TitleWidget *dia_ui = new TitleWidget(KUrl(), m_activeDocument->timecode(), titlepath, m_projectMonitor->render, this);
+ QPointer<TitleWidget> dia_ui = new TitleWidget(KUrl(), m_activeDocument->timecode(), titlepath, m_projectMonitor->render, this);
QDomDocument doc;
doc.setContent(clip->getProperty("xmldata"));
dia_ui->setXml(doc);
void MainWindow::slotShowClipProperties(QList <DocClipBase *> cliplist, QMap<QString, QString> commonproperties)
{
- ClipProperties dia(cliplist, m_activeDocument->timecode(), commonproperties, this);
- if (dia.exec() == QDialog::Accepted) {
+ QPointer<ClipProperties> dia = new ClipProperties(cliplist,
+ m_activeDocument->timecode(), commonproperties, this);
+ if (dia->exec() == QDialog::Accepted) {
QUndoCommand *command = new QUndoCommand();
command->setText(i18n("Edit clips"));
- QMap <QString, QString> newImageProps = dia.properties();
+ QMap <QString, QString> newImageProps = dia->properties();
// Transparency setting applies only for images
QMap <QString, QString> newProps = newImageProps;
newProps.remove("transparency");
}
m_activeDocument->commandStack()->push(command);
for (int i = 0; i < cliplist.count(); i++)
- m_activeTimeline->projectView()->slotUpdateClip(cliplist.at(i)->getId(), dia.needsTimelineReload());
+ m_activeTimeline->projectView()->slotUpdateClip(cliplist.at(i)->getId(), dia->needsTimelineReload());
}
+ delete dia;
}
void MainWindow::customEvent(QEvent* e)
QString tmppath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash);
if (baseClip == NULL) tmppath.append("untitled.mlt");
else {
- tmppath.append((baseClip->name().isEmpty() ? baseClip->fileURL().fileName() : baseClip->name()) + "-" + QString::number(zone.x()).rightJustified(4, '0') + ".mlt");
+ tmppath.append((baseClip->name().isEmpty() ? baseClip->fileURL().fileName() : baseClip->name()) + '-' + QString::number(zone.x()).rightJustified(4, '0') + ".mlt");
}
path = KUrl(tmppath);
}
{
KNS3::Entry::List entries;
#if KDE_IS_VERSION(4,3,80)
- KNS3::DownloadDialog dialog(configFile);
- dialog.exec();
- entries = dialog.changedEntries();
+ QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog(configFile);
+ dialog->exec();
+ if (dialog) entries = dialog->changedEntries();
foreach(const KNS3::Entry & entry, entries) {
if (entry.status() == KNS3::Entry::Installed)
kDebug() << "// Installed files: " << entry.installedFiles();
}
+ delete dialog;
#else
KNS::Engine engine(0);
if (engine.init(configFile))
// We must stop the monitors since we create a new on in the dvd wizard
m_clipMonitor->stop();
m_projectMonitor->stop();
- DvdWizard w(url, profile, this);
- w.exec();
+ QPointer<DvdWizard> w = new DvdWizard(url, profile, this);
+ w->exec();
m_projectMonitor->start();
+ delete w;
}
void MainWindow::slotShowTimeline(bool show)
QMapIterator<QString, QString> i(profiles);
while (i.hasNext()) {
i.next();
- QStringList data = i.value().split(";");
+ QStringList data = i.value().split(';');
QAction *a;
// separate audio transcoding in a separate menu
if (data.count() > 2 && data.at(2) == "audio") {
QDomElement e = producers.item(n).toElement();
producerResource = EffectsList::property(e, "resource");
if (producerResource.isEmpty()) continue;
- if (!producerResource.startsWith("/")) {
- producerResource.prepend(root + "/");
+ if (!producerResource.startsWith('/')) {
+ producerResource.prepend(root + '/');
}
if (producerResource.contains('?')) {
// slowmotion producer
- suffix = "?" + producerResource.section('?', 1);
+ suffix = '?' + producerResource.section('?', 1);
producerResource = producerResource.section('?', 0, 0);
}
else suffix.clear();
// Do save scenelist
QFile file(playlistPath);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage);
+ m_messageLabel->setMessage(i18n("Cannot write to file %1", playlistPath), ErrorMessage);
return;
}
file.write(playlistContent.toUtf8());
if (file.error() != QFile::NoError) {
- m_messageLabel->setMessage(i18n("Cannot write to file %1").arg(playlistPath), ErrorMessage);
+ m_messageLabel->setMessage(i18n("Cannot write to file %1", playlistPath), ErrorMessage);
file.close();
return;
}
projectId = m_activeDocument->getDocumentProperty("documentid");
}
- BackupWidget *dia = new BackupWidget(projectFile, projectFolder, projectId, this);
+ QPointer<BackupWidget> dia = new BackupWidget(projectFile, projectFolder, projectId, this);
if (dia->exec() == QDialog::Accepted) {
QString requestedBackup = dia->selectedFile();
m_activeDocument->backupLastSavedVersion(projectFile.path());