Commit 1d1595e7 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix various regressions introduced with project folder change

CCBUG: 371965
parent 4a3f660b
......@@ -93,7 +93,6 @@ bool DocumentChecker::hasErrorInClips()
}
if (!storageFolder.isEmpty() && !QFile::exists(storageFolder) && QFile::exists(m_url.adjusted(QUrl::RemoveFilename).path() + QStringLiteral("/") + documentid)) {
storageFolder = m_url.adjusted(QUrl::RemoveFilename).path();
qDebug()<<"* * *Switching storage folder: "<<storageFolder;
EffectsList::setProperty(playlists.at(i).toElement(), QStringLiteral("kdenlive:docproperties.storagefolder"), storageFolder + QStringLiteral("/") + documentid);
m_doc.documentElement().setAttribute(QStringLiteral("modified"), QStringLiteral("1"));
}
......
......@@ -1387,7 +1387,10 @@ QMap <QString, QString> KdenliveDoc::documentProperties()
{
m_documentProperties.insert(QStringLiteral("version"), QString::number(DOCUMENTVERSION));
m_documentProperties.insert(QStringLiteral("kdenliveversion"), QStringLiteral(KDENLIVE_VERSION));
m_documentProperties.insert(QStringLiteral("storagefolder"), m_projectFolder + QStringLiteral("/") + m_documentProperties.value(QStringLiteral("documentid")));
if (!m_projectFolder.isEmpty()) {
m_documentProperties.insert(QStringLiteral("storagefolder"), m_projectFolder + QStringLiteral("/") +
m_documentProperties.value(QStringLiteral("documentid")));
}
m_documentProperties.insert(QStringLiteral("profile"), profilePath());
m_documentProperties.insert(QStringLiteral("position"), QString::number(m_render->seekPosition().frames(m_render->fps())));
return m_documentProperties;
......
......@@ -383,7 +383,7 @@
<label>Default folder for project files.</label>
<default></default>
</entry>
<entry name="customprojectfolder" type="Bool">
<label>Don't use default XDG folders to store project files.</label>
<default>false</default>
......
......@@ -96,13 +96,8 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
QString storageFolder = doc->getDocumentProperty(QStringLiteral("storagefolder"));
if (!storageFolder.isEmpty()) {
custom_folder->setChecked(true);
QDir dir(storageFolder);
dir.cdUp();
project_folder->setUrl(QUrl::fromLocalFile(dir.absolutePath()));
} else {
xdg_folder->setChecked(true);
project_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
}
project_folder->setUrl(QUrl::fromLocalFile(doc->projectFolder()));
TemporaryData *cacheWidget = new TemporaryData(doc, true, this);
connect(cacheWidget, SIGNAL(disableProxies()), this, SIGNAL(disableProxies()));
connect(cacheWidget, SIGNAL(disablePreview()), this, SIGNAL(disablePreview()));
......@@ -119,9 +114,8 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap <QString, QString> metad
m_proxyextension = KdenliveSettings::proxyextension();
m_previewparams = KdenliveSettings::previewparams();
m_previewextension = KdenliveSettings::previewextension();
xdg_folder->setChecked(!KdenliveSettings::customprojectfolder());
custom_folder->setChecked(KdenliveSettings::customprojectfolder());
project_folder->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
project_folder->setUrl(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)));
}
// Select profile
......
......@@ -336,7 +336,7 @@ bool ProjectManager::hasSelection() const
bool ProjectManager::saveFileAs()
{
QFileDialog fd(pCore->window());
fd.setDirectory(m_project->url().isValid() ? m_project->url().adjusted(QUrl::RemoveFilename).path() : m_project->projectFolder());
fd.setDirectory(m_project->url().isValid() ? m_project->url().adjusted(QUrl::RemoveFilename).path() : KdenliveSettings::defaultprojectfolder());
fd.setMimeTypeFilters(QStringList()<<QStringLiteral("application/x-kdenlive"));
fd.setAcceptMode(QFileDialog::AcceptSave);
fd.setFileMode(QFileDialog::AnyFile);
......
......@@ -248,7 +248,11 @@
</widget>
</item>
<item>
<widget class="KUrlRequester" name="projecturl"/>
<widget class="KUrlRequester" name="projecturl">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>591</width>
<height>746</height>
<height>710</height>
</rect>
</property>
<property name="windowTitle">
......@@ -27,26 +27,26 @@
<string>Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_4">
<item row="4" column="1">
<widget class="QCheckBox" name="video_thumbs">
<property name="text">
<string>Project folder to store proxy clips, thumbnails, previews</string>
<string>Video</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="4">
<widget class="QRadioButton" name="xdg_folder">
<item row="4" column="2">
<widget class="QCheckBox" name="audio_thumbs">
<property name="text">
<string>Standard system fo&amp;lders</string>
<string>Audio</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<item row="1" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="custom_folder">
<widget class="QCheckBox" name="custom_folder">
<property name="text">
<string>C&amp;ustom Folder</string>
<string>Custom project folder</string>
</property>
</widget>
</item>
......@@ -59,14 +59,14 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="4">
<item row="2" column="0" colspan="4">
<widget class="QGroupBox" name="profile_box">
<property name="title">
<string>Video Profile</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<item row="3" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_7">
......@@ -103,41 +103,21 @@
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Thumbnails:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="video_thumbs">
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Video</string>
<string>Project folder to store proxy clips, thumbnails, previews</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QCheckBox" name="audio_thumbs">
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Audio</string>
<string>Thumbnails:</string>
</property>
</widget>
</item>
<item row="5" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>229</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0" colspan="4">
<item row="5" column="0" colspan="4">
<widget class="QGroupBox" name="enable_proxy">
<property name="title">
<string>Prox&amp;y clips</string>
......@@ -248,7 +228,7 @@
</layout>
</widget>
</item>
<item row="7" column="0" colspan="4">
<item row="6" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_25">
......@@ -292,7 +272,7 @@
</item>
</layout>
</item>
<item row="8" column="0" colspan="4">
<item row="7" column="0" colspan="4">
<widget class="QPlainTextEdit" name="previewparams">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
......@@ -305,7 +285,7 @@
</property>
</widget>
</item>
<item row="9" column="0" colspan="4">
<item row="8" column="0" colspan="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -318,22 +298,28 @@
</property>
</spacer>
</item>
<item row="4" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>229</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<zorder>label_4</zorder>
<zorder>project_folder</zorder>
<zorder>profile_box</zorder>
<zorder>label_2</zorder>
<zorder>video_thumbs</zorder>
<zorder>audio_thumbs</zorder>
<zorder>enable_proxy</zorder>
<zorder></zorder>
<zorder></zorder>
<zorder>horizontalSpacer</zorder>
<zorder>label_25</zorder>
<zorder>proxyparams</zorder>
<zorder>xdg_folder</zorder>
<zorder>custom_folder</zorder>
<zorder>verticalSpacer</zorder>
<zorder>previewparams</zorder>
<zorder>verticalSpacer</zorder>
</widget>
......@@ -535,25 +521,6 @@
</widget>
</item>
</layout>
<zorder>tabWidget</zorder>
<zorder>buttonBox</zorder>
<zorder>label_4</zorder>
<zorder>preview_profile</zorder>
<zorder>label_7</zorder>
<zorder>audio_thumbs</zorder>
<zorder>label_8</zorder>
<zorder>label_25</zorder>
<zorder>preview_showprofileinfo</zorder>
<zorder>video_tracks</zorder>
<zorder>profile_box</zorder>
<zorder>horizontalSpacer</zorder>
<zorder>enable_proxy</zorder>
<zorder>video_thumbs</zorder>
<zorder>preview_manageprofile</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>project_folder</zorder>
<zorder>label_2</zorder>
<zorder>audio_tracks</zorder>
</widget>
<customwidgets>
<customwidget>
......@@ -614,12 +581,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>92</x>
<y>137</y>
<x>124</x>
<y>101</y>
</hint>
<hint type="destinationlabel">
<x>377</x>
<y>137</y>
<x>409</x>
<y>101</y>
</hint>
</hints>
</connection>
......
Supports Markdown
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