summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-02 08:32:53 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-02 08:32:53 (GMT)
commit1d1595e7d14ef6b0560dc93940f9c23ed96a4ce7 (patch)
tree3a3168db859ca2d2ec80ea5dde73ed5ac7f786fd
parent4a3f660b885f5ba9eb606859ece709189e2189b4 (diff)
Fix various regressions introduced with project folder change
CCBUG: 371965
-rw-r--r--src/doc/documentchecker.cpp1
-rw-r--r--src/doc/kdenlivedoc.cpp5
-rw-r--r--src/kdenlivesettings.kcfg2
-rw-r--r--src/project/dialogs/projectsettings.cpp10
-rw-r--r--src/project/projectmanager.cpp2
-rw-r--r--src/ui/configproject_ui.ui6
-rw-r--r--src/ui/projectsettings_ui.ui111
7 files changed, 52 insertions, 85 deletions
diff --git a/src/doc/documentchecker.cpp b/src/doc/documentchecker.cpp
index 00b12f0..f6a111b 100644
--- a/src/doc/documentchecker.cpp
+++ b/src/doc/documentchecker.cpp
@@ -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"));
}
diff --git a/src/doc/kdenlivedoc.cpp b/src/doc/kdenlivedoc.cpp
index 205cb4e..4bf046f 100644
--- a/src/doc/kdenlivedoc.cpp
+++ b/src/doc/kdenlivedoc.cpp
@@ -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;
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index 8e30602..1082805 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -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>
diff --git a/src/project/dialogs/projectsettings.cpp b/src/project/dialogs/projectsettings.cpp
index f0c6721..56fe594 100644
--- a/src/project/dialogs/projectsettings.cpp
+++ b/src/project/dialogs/projectsettings.cpp
@@ -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
diff --git a/src/project/projectmanager.cpp b/src/project/projectmanager.cpp
index 15f966b..3192c89 100644
--- a/src/project/projectmanager.cpp
+++ b/src/project/projectmanager.cpp
@@ -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);
diff --git a/src/ui/configproject_ui.ui b/src/ui/configproject_ui.ui
index 3d6183d..aea753d 100644
--- a/src/ui/configproject_ui.ui
+++ b/src/ui/configproject_ui.ui
@@ -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>
diff --git a/src/ui/projectsettings_ui.ui b/src/ui/projectsettings_ui.ui
index 731449d..019c7eb 100644
--- a/src/ui/projectsettings_ui.ui
+++ b/src/ui/projectsettings_ui.ui
@@ -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>