#include "dolphinview.h"
#include "dolphinsettings.h"
#include "dolphinsortfilterproxymodel.h"
-#include "generalsettings.h"
+#include "dolphin_generalsettings.h"
#include "viewproperties.h"
#include <assert.h>
m_useAsDefault(0)
{
assert(dolphinView != 0);
+ const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
setCaption(i18n("View Properties"));
setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
QVBoxLayout* topLayout = new QVBoxLayout();
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
- QGroupBox* propsBox = new QGroupBox(i18n("Properties"), main);
+ QWidget* propsBox = main;
+ if (!useGlobalViewProps) {
+ propsBox = new QGroupBox(i18n("Properties"), main);
+ }
QLabel* viewModeLabel = new QLabel(i18n("View mode:"), propsBox);
m_viewMode = new QComboBox(propsBox);
m_viewMode->addItem(SmallIcon("view_icon"), i18n("Icons"));
- m_viewMode->addItem(SmallIcon("view_text"), i18n("Details"));
+ m_viewMode->addItem(SmallIcon("fileview-text"), i18n("Details"));
const int index = static_cast<int>(m_viewProps->viewMode());
m_viewMode->setCurrentIndex(index);
// Only show the following settings if the view properties are remembered
// for each directory:
- if (!DolphinSettings::instance().generalSettings()->globalViewProps()) {
+ if (!useGlobalViewProps) {
// create 'Apply view properties to:' group
QGroupBox* applyBox = new QGroupBox(i18n("Apply view properties to:"), main);
settings->setViewPropsTimestamp(QDateTime::currentDateTime());
// This is also a good chance to make a cleanup of all mirrored view properties:
- QString basePath = KGlobal::mainComponent().componentName();
- basePath.append("/view_properties/");
- const QString mirroredViewProps = KStandardDirs::locateLocal("data", basePath);
- KIO::NetAccess::del(mirroredViewProps, this);
+ const KUrl mirroredDir = ViewProperties::mirroredDirectory();
+ KIO::NetAccess::del(mirroredDir, this);
}
m_viewProps->save();
settings->setGlobalViewProps(true);
ViewProperties defaultProps(m_dolphinView->url());
defaultProps.setDirProperties(*m_viewProps);
- kDebug() << "saving global viewprops" << endl;
defaultProps.save();
settings->setGlobalViewProps(false);
}