Commit c3952850 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Store the location of the resource folder and cache db in the config

parent 481d6d47
......@@ -71,6 +71,7 @@
#include "kis_preference_set_registry.h"
#include "widgets/kis_cmb_idlist.h"
#include <kis_image.h>
#include "kis_file_name_requester.h"
#include <klocalizedstring.h>
#include <kundo2stack.h>
......@@ -206,7 +207,16 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
m_chkCacheAnimatioInBackground->setChecked(cfg.calculateAnimationCacheInBackground());
//
// Resources
//
m_urlCacheDbLocation->setMode(KoFileDialog::OpenDirectory);
m_urlCacheDbLocation->setConfigurationName("cachedb_location");
m_urlCacheDbLocation->setFileName(cfg.readEntry<QString>("ResourceCacheDbDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)));
m_urlResourceFolder->setMode(KoFileDialog::OpenDirectory);
m_urlResourceFolder->setConfigurationName("resource_directory");
m_urlResourceFolder->setFileName(cfg.readEntry<QString>("ResourceDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)));
}
void GeneralTab::setDefault()
......@@ -252,6 +262,9 @@ void GeneralTab::setDefault()
KoColor cursorColor(KoColorSpaceRegistry::instance()->rgb8());
cursorColor.fromQColor(cfg.getCursorMainColor(true));
cursorColorBtutton->setColor(cursorColor);
m_urlCacheDbLocation->setFileName(cfg.readEntry<QString>("ResourceCacheDbDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)));
m_urlResourceFolder->setFileName(cfg.readEntry<QString>("ResourceDirectory", QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)));
}
CursorStyle GeneralTab::cursorStyle()
......@@ -1286,6 +1299,9 @@ bool KisDlgPreferences::editPreferences()
cfg.setUndoStackLimit(dialog->m_general->undoStackSize());
cfg.setFavoritePresets(dialog->m_general->favoritePresets());
cfg.writeEntry("ResourceCacheDbDirectory", dialog->m_general->m_urlCacheDbLocation->fileName());
cfg.writeEntry("ResourceDirectory", dialog->m_general->m_urlResourceFolder->fileName());
// Color settings
cfg.setUseSystemMonitorProfile(dialog->m_colorSettings->m_page->chkUseSystemMonitorProfile->isChecked());
for (int i = 0; i < QApplication::desktop()->screenCount(); ++i) {
......
......@@ -767,7 +767,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="KisFileNameRequester" name="urlCacheLocation" native="true"/>
<widget class="KisFileNameRequester" name="m_urlCacheDbLocation" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_14">
......@@ -777,7 +777,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="KisFileNameRequester" name="urlResourceFolder" native="true"/>
<widget class="KisFileNameRequester" name="m_urlResourceFolder" native="true"/>
</item>
</layout>
</widget>
......
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