Try to make sure we don't create url's with // in them

svn path=/trunk/kdenlive/; revision=3622
parent 30b2729b
......@@ -177,7 +177,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
foreach(const QString &folder, customLumas) {
QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
}
}
......@@ -188,7 +189,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
QDir lumafolder(folder);
QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
}
slotEnableLuma(m_view.slide_fade->checkState());
......
......@@ -399,7 +399,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
// razor tool over a clip, display current frame in monitor
if (!m_blockRefresh && item->type() == AVWIDGET) {
//TODO: solve crash when showing frame when moving razor over clip
//emit showClipFrame(((ClipItem *) item)->baseClip(), mapToScene(event->pos()).x() / m_scale - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
//emit showClipFrame(((ClipItem *) item)->baseClip(), mappedXPos - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
}
event->accept();
return;
......
......@@ -76,18 +76,18 @@ void initEffects::refreshLumas()
QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
imagenamelist.append(fname);
imagefiles.append(folder + '/' + fname);
imagefiles.append(KUrl(folder).path(KUrl::AddTrailingSlash) + fname);
}
}
// Check for MLT lumas
QString folder = mlt_environment("MLT_DATA");
folder.append("/lumas/").append(mlt_environment("MLT_NORMALISATION"));
QString folder = KUrl(mlt_environment("MLT_DATA")).path(KUrl::AddTrailingSlash);
folder.append("lumas/").append(mlt_environment("MLT_NORMALISATION"));
QDir lumafolder(folder);
QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
imagenamelist.append(fname);
imagefiles.append(folder + '/' + fname);
imagefiles.append(folder + fname);
}
QDomElement lumaTransition = MainWindow::transitions.getEffectByTag("luma", "luma");
QDomNodeList params = lumaTransition.elementsByTagName("parameter");
......@@ -657,13 +657,13 @@ void initEffects::fillTransitionsList(Mlt::Repository * repository, EffectsList*
}
// Check for MLT lumas
QString folder = mlt_environment("MLT_DATA");
folder.append("/lumas/").append(mlt_environment("MLT_NORMALISATION"));
QString folder = KUrl(mlt_environment("MLT_DATA")).path(KUrl::AddTrailingSlash);
folder.append("lumas/").append(mlt_environment("MLT_NORMALISATION"));
QDir lumafolder(folder);
QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
imagenamelist.append(fname);
imagefiles.append(folder + '/' + fname);
imagefiles.append(folder + fname);
}
if (name == "luma") {
......
......@@ -215,9 +215,9 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
}
// Make sure that the necessary folders exist
KStandardDirs::makeDir(m_projectFolder.path() + "/titles/");
KStandardDirs::makeDir(m_projectFolder.path() + "/thumbs/");
KStandardDirs::makeDir(m_projectFolder.path() + "/ladspa/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "titles/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/");
KStandardDirs::makeDir(m_projectFolder.path(KUrl::AddTrailingSlash) + "ladspa/");
kDebug() << "Kdenlive document, init timecode: " << m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
......@@ -528,8 +528,8 @@ void KdenliveDoc::setProjectFolder(KUrl url)
if (url == m_projectFolder) return;
setModified(true);
KStandardDirs::makeDir(url.path());
KStandardDirs::makeDir(url.path() + "/titles/");
KStandardDirs::makeDir(url.path() + "/thumbs/");
KStandardDirs::makeDir(url.path(KUrl::AddTrailingSlash) + "titles/");
KStandardDirs::makeDir(url.path(KUrl::AddTrailingSlash) + "thumbs/");
if (KMessageBox::questionYesNo(kapp->activeWindow(), i18n("You have changed the project folder. Do you want to copy the cached data from %1 to the new folder %2?").arg(m_projectFolder.path(), url.path())) == KMessageBox::Yes) moveProjectData(url);
m_projectFolder = url;
}
......@@ -543,20 +543,20 @@ void KdenliveDoc::moveProjectData(KUrl url)
if (clip->clipType() == TEXT) {
// the image for title clip must be moved
KUrl oldUrl = clip->fileURL();
KUrl newUrl = KUrl(url.path() + "/titles/" + oldUrl.fileName());
KUrl newUrl = KUrl(url.path(KUrl::AddTrailingSlash) + "titles/" + oldUrl.fileName());
KIO::Job *job = KIO::copy(oldUrl, newUrl);
if (KIO::NetAccess::synchronousRun(job, 0)) clip->setProperty("resource", newUrl.path());
}
QString hash = clip->getClipHash();
KUrl oldVideoThumbUrl = KUrl(m_projectFolder.path() + "/thumbs/" + hash + ".png");
KUrl oldAudioThumbUrl = KUrl(m_projectFolder.path() + "/thumbs/" + hash + ".thumb");
KUrl oldVideoThumbUrl = KUrl(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".png");
KUrl oldAudioThumbUrl = KUrl(m_projectFolder.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".thumb");
if (KIO::NetAccess::exists(oldVideoThumbUrl, KIO::NetAccess::SourceSide, 0)) {
KUrl newUrl = KUrl(url.path() + "/thumbs/" + hash + ".png");
KUrl newUrl = KUrl(url.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".png");
KIO::Job *job = KIO::copy(oldVideoThumbUrl, newUrl);
KIO::NetAccess::synchronousRun(job, 0);
}
if (KIO::NetAccess::exists(oldAudioThumbUrl, KIO::NetAccess::SourceSide, 0)) {
KUrl newUrl = KUrl(url.path() + "/thumbs/" + hash + ".thumb");
KUrl newUrl = KUrl(url.path(KUrl::AddTrailingSlash) + "thumbs/" + hash + ".thumb");
KIO::Job *job = KIO::copy(oldAudioThumbUrl, newUrl);
if (KIO::NetAccess::synchronousRun(job, 0)) clip->refreshThumbUrl();
}
......@@ -1068,7 +1068,7 @@ void KdenliveDoc::slotCreateSlideshowClipFile(const QString name, const QString
void KdenliveDoc::slotCreateTextClip(QString group, const QString &groupId, const QString &templatePath)
{
QString titlesFolder = projectFolder().path() + "/titles/";
QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
KStandardDirs::makeDir(titlesFolder);
TitleWidget *dia_ui = new TitleWidget(templatePath, titlesFolder, m_render, kapp->activeWindow());
if (dia_ui->exec() == QDialog::Accepted) {
......@@ -1085,7 +1085,7 @@ void KdenliveDoc::slotCreateTextClip(QString group, const QString &groupId, cons
void KdenliveDoc::slotCreateTextTemplateClip(QString group, const QString &groupId, KUrl path)
{
QString titlesFolder = projectFolder().path() + "/titles/";
QString titlesFolder = projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
if (path.isEmpty()) {
path = KFileDialog::getOpenUrl(KUrl(titlesFolder), "*.kdenlivetitle", kapp->activeWindow(), i18n("Enter Template Path"));
}
......
......@@ -1518,7 +1518,7 @@ void MainWindow::parseProfiles(const QString &mltPath)
KUrl mltPath = getUrl->selectedUrl();
delete getUrl;
if (mltPath.isEmpty()) ::exit(0);
KdenliveSettings::setMltpath(mltPath.path());
KdenliveSettings::setMltpath(mltPath.path(KUrl::AddTrailingSlash));
QStringList profilesList = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
}
}
......@@ -1585,7 +1585,7 @@ void MainWindow::slotEditProjectSettings()
if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
m_activeDocument->setProjectFolder(w->selectedFolder());
if (m_renderWidget) m_renderWidget->setDocumentPath(w->selectedFolder().path());
if (m_renderWidget) m_renderWidget->setDocumentPath(w->selectedFolder().path(KUrl::AddTrailingSlash));
if (m_activeDocument->profilePath() != profile) {
// Profile was changed
double dar = m_activeDocument->dar();
......@@ -1608,7 +1608,7 @@ void MainWindow::slotEditProjectSettings()
void MainWindow::slotRenderProject()
{
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path() : KdenliveSettings::defaultprojectfolder();
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
m_renderWidget = new RenderWidget(projectfolder, this);
connect(m_renderWidget, SIGNAL(doRender(const QStringList&, const QStringList&)), this, SLOT(slotDoRender(const QStringList&, const QStringList&)));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &)));
......@@ -1893,7 +1893,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha
m_activeTimeline = trackView;
if (m_renderWidget) {
m_renderWidget->setProfile(doc->mltProfile());
m_renderWidget->setDocumentPath(doc->projectFolder().path());
m_renderWidget->setDocumentPath(doc->projectFolder().path(KUrl::AddTrailingSlash));
m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"));
}
//doc->setRenderer(m_projectMonitor->render);
......@@ -2306,7 +2306,7 @@ void MainWindow::slotGotProgressInfo(const QString &message, int progress)
void MainWindow::slotShowClipProperties(DocClipBase *clip)
{
if (clip->clipType() == TEXT) {
QString titlepath = m_activeDocument->projectFolder().path() + "/titles/";
QString titlepath = m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
if (!clip->getProperty("xmltemplate").isEmpty()) {
// template text clip
......
......@@ -198,7 +198,7 @@ MltVideoProfile ProfilesDialog::getVideoProfile(QString name)
if (!isCustom) {
// List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + '/' + name;
if (profilesFiles.contains(name)) path = KdenliveSettings::mltpath() + name;
}
if (isCustom || path.isEmpty()) {
path = name;
......@@ -228,33 +228,6 @@ MltVideoProfile ProfilesDialog::getVideoProfile(QString name)
return result;
}
// static
QString ProfilesDialog::getProfileDescription(QString name)
{
QStringList profilesNames;
QStringList profilesFiles;
QStringList profilesFilter;
profilesFilter << "*";
// List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + name, KConfig::SimpleConfig);
return confFile.entryMap().value("description");
}
// List custom profiles
QStringList customProfiles = KGlobal::dirs()->findDirs("appdata", "profiles");
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
if (profilesFiles.contains(name)) {
KConfig confFile(customProfiles.at(i) + '/' + name, KConfig::SimpleConfig);
return confFile.entryMap().value("description");
}
}
return QString();
}
// static
bool ProfilesDialog::existingProfileDescription(const QString &desc)
......@@ -265,7 +238,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc)
// List the Mlt profiles
QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig);
if (desc == confFile.entryMap().value("description")) return true;
}
......@@ -274,7 +247,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc)
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
KConfig confFile(customProfiles.at(i) + '/' + profilesFiles.at(j), KConfig::SimpleConfig);
KConfig confFile(customProfiles.at(i) + profilesFiles.at(j), KConfig::SimpleConfig);
if (desc == confFile.entryMap().value("description")) return true;
}
}
......@@ -291,7 +264,7 @@ QString ProfilesDialog::existingProfile(MltVideoProfile profile)
// Check the Mlt profiles
QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig);
if (profile.display_aspect_den != confFile.entryMap().value("display_aspect_den").toInt()) continue;
if (profile.display_aspect_num != confFile.entryMap().value("display_aspect_num").toInt()) continue;
if (profile.sample_aspect_den != confFile.entryMap().value("sample_aspect_den").toInt()) continue;
......@@ -309,7 +282,7 @@ QString ProfilesDialog::existingProfile(MltVideoProfile profile)
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
KConfig confFile(customProfiles.at(i) + '/' + profilesFiles.at(j), KConfig::SimpleConfig);
KConfig confFile(customProfiles.at(i) + profilesFiles.at(j), KConfig::SimpleConfig);
if (profile.display_aspect_den != confFile.entryMap().value("display_aspect_den").toInt()) continue;
if (profile.display_aspect_num != confFile.entryMap().value("display_aspect_num").toInt()) continue;
if (profile.sample_aspect_den != confFile.entryMap().value("sample_aspect_den").toInt()) continue;
......@@ -319,7 +292,7 @@ QString ProfilesDialog::existingProfile(MltVideoProfile profile)
if (profile.frame_rate_den != confFile.entryMap().value("frame_rate_den").toInt()) continue;
if (profile.frame_rate_num != confFile.entryMap().value("frame_rate_num").toInt()) continue;
if (profile.progressive != confFile.entryMap().value("progressive").toInt()) continue;
return customProfiles.at(i) + '/' + profilesFiles.at(j);
return customProfiles.at(i) + profilesFiles.at(j);
}
}
return QString();
......@@ -335,7 +308,7 @@ QMap <QString, QString> ProfilesDialog::getProfilesInfo()
// List the Mlt profiles
QStringList profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig);
QString desc = confFile.entryMap().value("description");
if (!desc.isEmpty()) result.insert(desc, profilesFiles.at(i));
}
......@@ -345,9 +318,9 @@ QMap <QString, QString> ProfilesDialog::getProfilesInfo()
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
KConfig confFile(customProfiles.at(i) + '/' + profilesFiles.at(j), KConfig::SimpleConfig);
KConfig confFile(customProfiles.at(i) + profilesFiles.at(j), KConfig::SimpleConfig);
QString desc = confFile.entryMap().value("description");
if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + '/' + profilesFiles.at(j));
if (!desc.isEmpty()) result.insert(desc, customProfiles.at(i) + profilesFiles.at(j));
}
}
return result;
......@@ -363,7 +336,7 @@ QMap< QString, QString > ProfilesDialog::getSettingsFromFile(const QString path)
if (!path.contains('/')) {
// This is an MLT profile
KConfig confFile(KdenliveSettings::mltpath() + '/' + path, KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + path, KConfig::SimpleConfig);
return confFile.entryMap();
} else {
// This is a custom profile
......@@ -383,7 +356,7 @@ QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString pro
// List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
values.insert("path", profilesFiles.at(i));
......@@ -396,10 +369,10 @@ QMap< QString, QString > ProfilesDialog::getSettingsForProfile(const QString pro
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig);
KConfig confFile(customProfiles.at(i) + profiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileName) {
values.insert("path", customProfiles.at(i) + '/' + profiles.at(i));
values.insert("path", customProfiles.at(i) + profiles.at(i));
return values;
}
}
......@@ -418,7 +391,7 @@ QString ProfilesDialog::getPathFromDescription(const QString profileDesc)
// List the Mlt profiles
profilesFiles = QDir(KdenliveSettings::mltpath()).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
KConfig confFile(KdenliveSettings::mltpath() + '/' + profilesFiles.at(i), KConfig::SimpleConfig);
KConfig confFile(KdenliveSettings::mltpath() + profilesFiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileDesc) return profilesFiles.at(i);
}
......@@ -428,9 +401,9 @@ QString ProfilesDialog::getPathFromDescription(const QString profileDesc)
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profiles.size(); ++i) {
KConfig confFile(customProfiles.at(i) + '/' + profiles.at(i), KConfig::SimpleConfig);
KConfig confFile(customProfiles.at(i) + profiles.at(i), KConfig::SimpleConfig);
QMap< QString, QString > values = confFile.entryMap();
if (values.value("description") == profileDesc) return customProfiles.at(i) + '/' + profiles.at(i);
if (values.value("description") == profileDesc) return customProfiles.at(i) + profiles.at(i);
}
}
return QString();
......
......@@ -33,7 +33,6 @@ public:
ProfilesDialog(QWidget * parent = 0);
void fillList(const QString selectedProfile = QString());
static QString getProfileDescription(QString name);
static QMap< QString, QString > getSettingsForProfile(const QString profileName);
static QMap< QString, QString > getSettingsFromFile(const QString path);
static QString getPathFromDescription(const QString profileDesc);
......
......@@ -690,7 +690,7 @@ void ProjectList::slotAddTitleTemplateClip()
// Get the list of existing templates
QStringList filter;
filter << "*.kdenlivetitle";
const QString path = m_doc->projectFolder().path() + "/titles/";
const QString path = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
QStringList templateFiles = QDir(path).entryList(filter, QDir::Files);
QDialog *dia = new QDialog(this);
......
......@@ -200,7 +200,7 @@ void RenderWidget::setDocumentPath(const QString path)
{
m_projectFolder = path;
const QString fileName = m_view.out_file->url().fileName();
m_view.out_file->setUrl(KUrl(m_projectFolder + '/' + fileName));
m_view.out_file->setUrl(KUrl(m_projectFolder + fileName));
parseScriptFiles();
}
......@@ -983,7 +983,7 @@ KUrl RenderWidget::filenameWithExtension(KUrl url, QString extension)
else path = path.left(pos) + extension;
} else {
path = m_projectFolder + "/untitled." + extension;
path = m_projectFolder + "untitled." + extension;
}
return KUrl(path);
}
......@@ -1396,9 +1396,9 @@ void RenderWidget::parseScriptFiles()
QTreeWidgetItem *item;
// List the project scripts
QStringList scriptFiles = QDir(m_projectFolder + "/scripts").entryList(scriptsFilter, QDir::Files);
QStringList scriptFiles = QDir(m_projectFolder + "scripts").entryList(scriptsFilter, QDir::Files);
for (int i = 0; i < scriptFiles.size(); ++i) {
KUrl scriptpath(m_projectFolder + "/scripts/" + scriptFiles.at(i));
KUrl scriptpath(m_projectFolder + "scripts/" + scriptFiles.at(i));
item = new QTreeWidgetItem(m_view.scripts_list, QStringList() << scriptpath.fileName());
QString target;
QFile file(scriptpath.path());
......@@ -1559,7 +1559,7 @@ bool RenderWidget::startWaitingRenderJobs()
QString RenderWidget::getFreeScriptName(const QString &prefix)
{
int ix = 0;
QString scriptsFolder = m_projectFolder + "/scripts/";
QString scriptsFolder = m_projectFolder + "scripts/";
KStandardDirs::makeDir(scriptsFolder);
QString path;
while (path.isEmpty() || QFile::exists(path)) {
......
......@@ -69,7 +69,8 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
foreach(const QString &folder, customLumas) {
QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
}
}
......@@ -80,7 +81,8 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
QDir lumafolder(folder);
QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
foreach(const QString &fname, filesnames) {
m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
QString filePath = KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
m_view.luma_file->addItem(KIcon(filePath), fname, filePath);
}
//adjustSize();
......
......@@ -737,7 +737,7 @@ DocClipBase *TrackView::getMissingProducer(const QString id) const
}
}
// prepend MLT XML document root if no path in clip resource and not a color clip
if (!resource.contains('/') && !resource.startsWith("0x")) resource.prepend(docRoot);
if (!resource.startsWith('/') && !resource.startsWith("0x")) resource.prepend(docRoot);
DocClipBase *missingClip = NULL;
if (!resource.isEmpty())
missingClip = m_doc->clipManager()->getClipByResource(resource);
......
......@@ -94,7 +94,7 @@ Wizard::Wizard(bool upgrade, QWidget *parent) :
slotCheckStandard();
connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
// select default profile
if (!KdenliveSettings::default_profile().isEmpty()) {
for (int i = 0; i < m_standard.profiles_list->count(); i++) {
if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) {
......@@ -105,12 +105,6 @@ Wizard::Wizard(bool upgrade, QWidget *parent) :
}
}
// select default profile
fprintf(stderr, "LOOKING FOR: %s", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data());
QList<QListWidgetItem *> profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly);
if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0));
fprintf(stderr, "LOOKING FOR: %s // %d", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data(), profiles.count());
addPage(page2);
QWizardPage *page3 = new QWizardPage;
......
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