Commit 107adf6c authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Use AppDataLocation instead of deprecated DataLocation, remove useless Windows hack

parent ca6d64ba
......@@ -111,7 +111,7 @@ Generators::~Generators()
//static
void Generators::getGenerators(QStringList producers, QMenu *menu)
{
QStringList generatorFolders = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("generators"), QStandardPaths::LocateDirectory);
QStringList generatorFolders = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("generators"), QStandardPaths::LocateDirectory);
QStringList filters;
filters << QStringLiteral("*.xml");
foreach(const QString & folder, generatorFolders) {
......
......@@ -46,7 +46,7 @@ EncodingProfilesDialog::EncodingProfilesDialog(int profileType, QWidget * parent
button_delete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
button_download->setIcon(KoIconUtils::themedIcon(QStringLiteral("download")));
m_configFile = new KConfig(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::DataLocation);
m_configFile = new KConfig(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::AppDataLocation);
profile_type->setCurrentIndex(profileType);
connect(profile_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotLoadProfiles()));
connect(profile_list, SIGNAL(currentRowChanged(int)), this, SLOT(slotShowParams()));
......
......@@ -113,7 +113,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
m_configEnv.libraryfolderurl->setMode(KFile::Directory);
m_configEnv.libraryfolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_libraryfolder"));
m_configEnv.libraryfolderurl->setEnabled(!KdenliveSettings::librarytodefaultfolder());
m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/library"));
m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library"));
connect(m_configEnv.kcfg_librarytodefaultfolder, SIGNAL(clicked()), this, SLOT(slotEnableLibraryFolder()));
m_page2 = addPage(p2, i18n("Environment"));
......@@ -887,7 +887,7 @@ void KdenliveSettingsDialog::slotCheckAudioBackend()
void KdenliveSettingsDialog::loadTranscodeProfiles()
{
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
m_configTranscode.profiles_list->blockSignals(true);
......@@ -909,7 +909,7 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
void KdenliveSettingsDialog::saveTranscodeProfiles()
{
QString transcodeFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/kdenlivetranscodingrc";
QString transcodeFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/kdenlivetranscodingrc";
KSharedConfigPtr config = KSharedConfig::openConfig(transcodeFile);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
......@@ -1034,7 +1034,7 @@ void KdenliveSettingsDialog::slotUpdatev4lDevice()
m_configCapture.kcfg_v4l_format->blockSignals(true);
m_configCapture.kcfg_v4l_format->clear();
QString vl4ProfilePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/video4linux";
QString vl4ProfilePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/video4linux";
if (QFile::exists(vl4ProfilePath)) {
m_configCapture.kcfg_v4l_format->addItem(i18n("Current settings"));
}
......@@ -1074,13 +1074,13 @@ void KdenliveSettingsDialog::slotUpdatev4lCaptureProfile()
m_configCapture.p_colorspace->setText(ProfilesDialog::getColorspaceDescription(601));
m_configCapture.p_progressive->setText(i18n("Progressive"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/");
if (!dir.exists() || !dir.exists(QStringLiteral("video4linux"))) saveCurrentV4lProfile();
}
void KdenliveSettingsDialog::loadCurrentV4lProfileInfo()
{
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......@@ -1122,7 +1122,7 @@ void KdenliveSettingsDialog::saveCurrentV4lProfile()
profile.frame_rate_num = m_configCapture.p_fps->text().section('/', 0, 0).toInt();
profile.frame_rate_den = m_configCapture.p_fps->text().section('/', 1, 1).toInt();
profile.progressive = m_configCapture.p_progressive->text() == i18n("Progressive");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......@@ -1144,7 +1144,7 @@ void KdenliveSettingsDialog::slotManageEncodingProfile()
void KdenliveSettingsDialog::loadEncodingProfiles()
{
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::DataLocation);
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::AppDataLocation);
// Load v4l profiles
m_configCapture.kcfg_v4l_profile->blockSignals(true);
......@@ -1280,7 +1280,7 @@ void KdenliveSettingsDialog::slotUpdatePreviewProfile(int ix)
void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
{
QString vl4ProfilePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/video4linux";
QString vl4ProfilePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/video4linux";
QPointer<ProfilesDialog> w = new ProfilesDialog(vl4ProfilePath, true);
if (w->exec() == QDialog::Accepted) {
// save and update profile
......
......@@ -251,7 +251,7 @@ bool ProfilesDialog::slotSaveProfile()
saveProfile(path);
} else {
int i = 0;
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/profiles/"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/profiles/"));
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......@@ -400,7 +400,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc)
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir customDir(customProfiles.at(i));
profilesFiles = customDir.entryList(profilesFilter, QDir::Files);
......@@ -432,7 +432,7 @@ QString ProfilesDialog::existingProfile(const MltVideoProfile &profile)
}
// Check custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir customDir(customProfiles.at(i));
profilesFiles = customDir.entryList(profilesFilter, QDir::Files);
......@@ -467,7 +467,7 @@ QList <MltVideoProfile> ProfilesDialog::profilesList()
}
// Check custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir customDir(customProfiles.at(i));
profilesFiles = customDir.entryList(profilesFilter, QDir::Files);
......@@ -499,7 +499,7 @@ QMap <QString, QString> ProfilesDialog::getProfilesInfo()
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir profileDir(customProfiles.at(i));
profilesFiles = profileDir.entryList(profilesFilter, QDir::Files);
......@@ -569,7 +569,7 @@ QMap <QString, QString> ProfilesDialog::getProfilesFromProperties(int width, int
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profiles.size(); ++j) {
......@@ -594,7 +594,7 @@ void ProfilesDialog::saveProfile(MltVideoProfile &profile, QString profilePath)
{
if (profilePath.isEmpty()) {
int i = 0;
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/profiles/"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/profiles/"));
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......
......@@ -560,11 +560,11 @@ void RenderWidget::slotSaveProfile()
bool RenderWidget::saveProfile(QDomElement newprofile)
{
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/customprofiles.xml";
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/customprofiles.xml";
QDomDocument doc;
QFile file(dir.absoluteFilePath(QStringLiteral("customprofiles.xml")));
doc.setContent(&file, false);
......@@ -739,7 +739,7 @@ void RenderWidget::slotEditProfile()
if (d->exec() == QDialog::Accepted) {
slotDeleteProfile(false);
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/customprofiles.xml";
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/customprofiles.xml";
QDomDocument doc;
QFile file(exportFile);
doc.setContent(&file, false);
......@@ -850,7 +850,7 @@ void RenderWidget::slotDeleteProfile(bool refresh)
QString currentProfile = item->text(0);
QString currentGroup = item->parent()->text(0);
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/customprofiles.xml";
QString exportFile = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/customprofiles.xml";
QDomDocument doc;
QFile file(exportFile);
doc.setContent(&file, false);
......@@ -1034,7 +1034,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut,
QStringList overlayargs;
if (m_view.tc_overlay->isChecked()) {
QString filterFile = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("metadata.properties"));
QString filterFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("metadata.properties"));
overlayargs << QStringLiteral("meta.attr.timecode=1") << "meta.attr.timecode.markup=#" + QString(m_view.tc_type->currentIndex() ? "frame" : "timecode");
overlayargs << QStringLiteral("-attach") << QStringLiteral("data_feed:attr_check") << QStringLiteral("-attach");
overlayargs << "data_show:" + filterFile << QStringLiteral("_loader=1") << QStringLiteral("dynamic=1");
......@@ -1690,17 +1690,13 @@ void RenderWidget::parseProfiles(const QString &selectedProfile)
m_view.formats->clear();
// Parse our xml profile
QString exportFile = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("export/profiles.xml"));
if (exportFile.isEmpty()) {
// Check local folder (non installed)
exportFile = qApp->applicationDirPath() + QStringLiteral("/data/kdenlive/export/profiles.xml");
}
QString exportFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("export/profiles.xml"));
parseFile(exportFile, false);
// Parse some MLT's profiles
parseMltPresets();
QString exportFolder = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/";
QString exportFolder = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/";
QDir directory(exportFolder);
QStringList filter;
filter << QStringLiteral("*.xml");
......
......@@ -48,7 +48,7 @@ TitleTemplateDialog::TitleTemplateDialog(const QString &folder, QWidget * parent
}
// System templates
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
QStringList titleTemplates = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("titles/"), QStandardPaths::LocateDirectory);
foreach(const QString & folderpath, titleTemplates) {
QDir folder(folderpath);
......
......@@ -273,7 +273,7 @@ void Wizard::slotUpdateCaptureParameters()
m_capture.v4l_formats->blockSignals(true);
m_capture.v4l_formats->clear();
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......@@ -446,8 +446,8 @@ void Wizard::checkMissingCodecs()
bool replaceLibfaacCodec = false;
if (!acodecsList.contains(QStringLiteral("aac")) && acodecsList.contains(QStringLiteral("libfaac"))) replaceLibfaacCodec = true;
QStringList profilesList;
profilesList << QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("export/profiles.xml"));
QDir directory = QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/");
profilesList << QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("export/profiles.xml"));
QDir directory = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/export/");
QStringList filter;
filter << QStringLiteral("*.xml");
QStringList fileList = directory.entryList(filter, QDir::Files);
......@@ -793,7 +793,7 @@ void Wizard::slotSaveCaptureFormat()
profile.frame_rate_num = format.at(3).toInt();
profile.frame_rate_den = format.at(4).toInt();
profile.progressive = 1;
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/profiles/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/profiles/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......
......@@ -609,7 +609,7 @@ QString DocumentChecker::searchLuma(const QDir &dir, const QString &file) const
if (result.exists())
return result.filePath();
// Try in Kdenlive's standard KDE path
QString res = QStandardPaths::locate(QStandardPaths::DataLocation, "lumas/" + fname);
QString res = QStandardPaths::locate(QStandardPaths::AppDataLocation, "lumas/" + fname);
if (!res.isEmpty()) return res;
// Try in user's chosen folder
return searchPathRecursively(dir, fname);
......
......@@ -1708,7 +1708,7 @@ void DocumentValidator::updateEffects()
// WARNING: order by findDirs will determine which js file to use (in case multiple scripts for the same filter exist)
QMap <QString, QUrl> paths;
QMap <QString, QScriptProgram> scripts;
QStringList directories = QStandardPaths::locateAll(QStandardPaths::DataLocation, "effects/update");
QStringList directories = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, "effects/update");
foreach (const QString &directoryName, directories) {
QDir directory(directoryName);
QStringList fileList = directory.entryList(QStringList() << "*.js", QDir::Files);
......
......@@ -1042,7 +1042,7 @@ void KdenliveDoc::saveCustomEffects(const QDomNodeList &customeffects)
if (MainWindow::customEffects.hasEffect(tag, id) == -1) {
QDomDocument doc;
doc.appendChild(doc.importNode(e, true));
QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/effects";
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects";
path += id + ".xml";
if (!QFile::exists(path)) {
importedEffects << id;
......@@ -1600,7 +1600,7 @@ void KdenliveDoc::selectPreviewProfile()
setDocumentProperty(QStringLiteral("previewextension"), KdenliveSettings::previewextension());
return;
}
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::DataLocation);
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::AppDataLocation);
KConfigGroup group(&conf, "timelinepreview");
QMap< QString, QString > values = group.entryMap();
QMapIterator<QString, QString> i(values);
......
......@@ -61,7 +61,7 @@ DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *paren
, m_previousPage(0)
{
setWindowTitle(i18n("DVD Wizard"));
//setPixmap(QWizard::WatermarkPixmap, QPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, "banner.png")));
//setPixmap(QWizard::WatermarkPixmap, QPixmap(QStandardPaths::locate(QStandardPaths::AppDataLocation, "banner.png")));
m_pageVob = new DvdWizardVob(this);
m_pageVob->setTitle(i18n("Select Files For Your DVD"));
addPage(m_pageVob);
......
......@@ -597,7 +597,7 @@ void DvdWizardVob::slotTranscodeFiles()
{
m_warnMessage->animatedHide();
// Find transcoding info related to selected DVD profile
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QString profileEasyName;
......
......@@ -374,7 +374,7 @@ void EffectsListView::slotUpdateInfo()
void EffectsListView::reloadEffectList(QMenu *effectsMenu, KActionCategory *effectActions)
{
QString effectCategory = m_mode == EffectMode ? QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenliveeffectscategory.rc")) : QString();
QString effectCategory = m_mode == EffectMode ? QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdenliveeffectscategory.rc")) : QString();
m_effectsList->initList(effectsMenu, effectActions, effectCategory, m_mode == TransitionMode);
filterList();
}
......@@ -423,7 +423,7 @@ void EffectsListView::slotRemoveEffect()
QTreeWidgetItem *item = m_effectsList->currentItem();
QString effectId = item->text(0);
QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/effects/";
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects/";
QDir directory = QDir(path);
QStringList filter;
......
......@@ -49,7 +49,7 @@ void initEffects::refreshLumas()
QString defaultWipeLuma;
MainWindow::m_lumaFiles.clear();
fileFilters << QStringLiteral("*.png") << QStringLiteral("*.pgm");
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
customLumas.append(QString(mlt_environment("MLT_DATA")) + "/lumas");
foreach(const QString &folder, customLumas) {
QDir topDir(folder);
......@@ -73,7 +73,7 @@ void initEffects::refreshLumas()
QStringList filters;
filters << QStringLiteral("*.pgm") << QStringLiteral("*.png");
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
QStringList customLumas = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("lumas"), QStandardPaths::LocateDirectory);
foreach(const QString & folder, customLumas) {
QDir directory(folder);
QStringList filesnames = directory.entryList(filters, QDir::Files);
......@@ -213,7 +213,7 @@ bool initEffects::parseEffectFiles(Mlt::Repository* repository, const QString &l
refreshLumas();
// Parse xml transition files
QStringList direc = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("transitions"), QStandardPaths::LocateDirectory);
QStringList direc = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("transitions"), QStandardPaths::LocateDirectory);
// Iterate through effects directories to parse all XML files.
for (more = direc.begin(); more != direc.end(); ++more) {
QDir directory(*more);
......@@ -227,7 +227,7 @@ bool initEffects::parseEffectFiles(Mlt::Repository* repository, const QString &l
}
// Remove blacklisted transitions from the list.
QFile file(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("blacklisted_transitions.txt")));
QFile file(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_transitions.txt")));
if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
while (!in.atEnd()) {
......@@ -245,7 +245,7 @@ bool initEffects::parseEffectFiles(Mlt::Repository* repository, const QString &l
// Remove blacklisted effects from the filters list.
QStringList mltFiltersList = filtersList;
QStringList mltBlackList;
QFile file2(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("blacklisted_effects.txt")));
QFile file2(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_effects.txt")));
if (file2.open(QIODevice::ReadOnly)) {
QTextStream in(&file2);
while (!in.atEnd()) {
......@@ -326,7 +326,7 @@ bool initEffects::parseEffectFiles(Mlt::Repository* repository, const QString &l
}
// Set the directories to look into for effects.
direc = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("effects"), QStandardPaths::LocateDirectory);
direc = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("effects"), QStandardPaths::LocateDirectory);
// Iterate through effects directories to parse all XML files.
for (more = direc.begin(); more != direc.end(); ++more) {
QDir directory(*more);
......@@ -388,7 +388,7 @@ void initEffects::parseCustomEffectsFile()
* cannot be sure about it.
*/
QMap<QString, QDomElement> effectsMap;
QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/effects";
QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects";
QDir directory = QDir(path);
QStringList filter;
filter << QStringLiteral("*.xml");
......
......@@ -375,7 +375,7 @@ void CollapsibleEffect::slotSaveEffect()
{
QString name = QInputDialog::getText(this, i18n("Save Effect"), i18n("Name for saved effect: "));
if (name.isEmpty()) return;
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/effects/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......
......@@ -170,7 +170,7 @@ void CollapsibleGroup::slotSaveGroup()
{
QString name = QInputDialog::getText(this, i18n("Save Group"), i18n("Name for saved group: "), QLineEdit::Normal, m_title->text());
if (name.isEmpty()) return;
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/effects/");
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/effects/");
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......
......@@ -1013,7 +1013,7 @@ void AnimationWidget::slotReverseKeyframeType(bool reverse)
void AnimationWidget::loadPresets(QString currentText)
{
m_presetCombo->blockSignals(true);
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/effects/presets/"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/effects/presets/"));
if (currentText.isEmpty()) currentText = m_presetCombo->currentText();
while (m_presetCombo->count() > 0) {
m_presetCombo->removeItem(0);
......@@ -1092,7 +1092,7 @@ void AnimationWidget::savePreset()
if (d.exec() != QDialog::Accepted) {
return;
}
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/effects/presets/"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/effects/presets/"));
if (!dir.exists()) {
dir.mkpath(QStringLiteral("."));
}
......@@ -1115,7 +1115,7 @@ void AnimationWidget::deletePreset()
{
QString effectName = m_presetCombo->currentText();
// try deleting as effect preset first
QDir dir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/effects/presets/"));
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/effects/presets/"));
KConfig confFile(dir.absoluteFilePath(m_effectId), KConfig::SimpleConfig);
KConfigGroup grp(&confFile, effectName);
if (grp.exists()) {
......
......@@ -181,7 +181,7 @@ LibraryWidget::LibraryWidget(ProjectManager *manager, QWidget *parent) : QWidget
// Library path
QString path;
if (KdenliveSettings::librarytodefaultfolder() || KdenliveSettings::libraryfolder().isEmpty()) {
path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/library");
path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library");
} else {
path = KdenliveSettings::libraryfolder();
}
......@@ -463,7 +463,7 @@ void LibraryWidget::slotUpdateLibraryPath()
m_libraryTree->blockSignals(true);
m_folders.clear();
m_libraryTree->clear();
QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QStringLiteral("/library");
QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library");
if (KdenliveSettings::librarytodefaultfolder() || KdenliveSettings::libraryfolder().isEmpty()) {
m_directory.setPath(defaultPath);
if (!m_directory.exists()) {
......
......@@ -612,7 +612,7 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
m_timelineToolBar->addAction(m_zoomIn);*/
// Populate encoding profiles
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::DataLocation);
KConfig conf(QStringLiteral("encodingprofiles.rc"), KConfig::CascadeConfig, QStandardPaths::AppDataLocation);
if (KdenliveSettings::proxyparams().isEmpty() || KdenliveSettings::proxyextension().isEmpty()) {
KConfigGroup group(&conf, "proxy");
QMap< QString, QString > values = group.entryMap();
......@@ -3171,7 +3171,7 @@ void MainWindow::buildDynamicActions()
}
ts = new KActionCategory(i18n("Transcoders"), m_extraFactory->actionCollection());
KActionCategory *ats = new KActionCategory(i18n("Extract Audio"), m_extraFactory->actionCollection());
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("kdenlivetranscodingrc")), KConfig::CascadeConfig);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
QMap< QString, QString > profiles = transConfig.entryMap();
......
......@@ -1018,7 +1018,7 @@ void ClipPropertiesController::slotFillMeta(QTreeWidget *tree)
for (int i = 0; i < subProperties.count(); i++) {
if (!magicL) {
magicL = new QTreeWidgetItem(tree, QStringList() << i18n("Magic Lantern") << QString());
QIcon icon(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("meta_magiclantern.png")));
QIcon icon(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("meta_magiclantern.png")));
magicL->setIcon(0, icon);
magicL->setExpanded(true);
}
......@@ -1040,7 +1040,7 @@ void ClipPropertiesController::slotFillMeta(QTreeWidget *tree)
m_controller->setProperty("kdenlive:meta.magiclantern." + line.section(':', 0, 0).simplified(), line.section(':', 1).simplified());
if (!magicL) {
magicL = new QTreeWidgetItem(tree, QStringList() << i18n("Magic Lantern") << QString());
QIcon icon(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("meta_magiclantern.png")));
QIcon icon(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("meta_magiclantern.png")));
magicL->setIcon(0, icon);
magicL->setExpanded(true);
}
......
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