本文整理汇总了C++中GeneralSettings::globalViewProps方法的典型用法代码示例。如果您正苦于以下问题:C++ GeneralSettings::globalViewProps方法的具体用法?C++ GeneralSettings::globalViewProps怎么用?C++ GeneralSettings::globalViewProps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeneralSettings
的用法示例。
在下文中一共展示了GeneralSettings::globalViewProps方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: info
ViewProperties::ViewProperties(const KUrl& url) :
m_changedProps(false),
m_autoSave(true),
m_node(0)
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
const bool useGlobalViewProps = settings->globalViewProps();
bool useDetailsViewWithPath = false;
// We try and save it to the file .directory in the directory being viewed.
// If the directory is not writable by the user or the directory is not local,
// we store the properties information in a local file.
if (useGlobalViewProps) {
m_filePath = destinationDir("global");
} else if (url.protocol().contains("search")) {
m_filePath = destinationDir("search");
useDetailsViewWithPath = true;
} else if (url.protocol() == QLatin1String("trash")) {
m_filePath = destinationDir("trash");
useDetailsViewWithPath = true;
} else if (url.isLocalFile()) {
m_filePath = url.toLocalFile();
const QFileInfo info(m_filePath);
if (!info.isWritable() || !isPartOfHome(m_filePath)) {
m_filePath = destinationDir("local") + m_filePath;
}
} else {
m_filePath = destinationDir("remote") + m_filePath;
}
const QString file = m_filePath + QDir::separator() + QLatin1String(".directory");
m_node = new ViewPropertySettings(KSharedConfig::openConfig(file));
// If the .directory file does not exist or the timestamp is too old,
// use default values instead.
const bool useDefaultProps = (!useGlobalViewProps || useDetailsViewWithPath) &&
(!QFileInfo(file).exists() ||
(m_node->timestamp() < settings->viewPropsTimestamp()));
if (useDefaultProps) {
if (useDetailsViewWithPath) {
setViewMode(DolphinView::DetailsView);
setAdditionalInfo(KFileItemDelegate::InformationList() << KFileItemDelegate::LocalPathOrUrl);
} else {
// The global view-properties act as default for directories without
// any view-property configuration
settings->setGlobalViewProps(true);
ViewProperties defaultProps(url);
setDirProperties(defaultProps);
settings->setGlobalViewProps(false);
m_changedProps = false;
}
}
}
示例2: loadSettings
void BehaviorSettingsPage::loadSettings()
{
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
if (settings->globalViewProps()) {
m_globalProps->setChecked(true);
} else {
m_localProps->setChecked(true);
}
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::IncludeGlobals);
const KConfigGroup confirmationGroup(kioConfig, "Confirmations");
m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", CONFIRM_TRASH));
m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", CONFIRM_DELETE));
m_confirmClosingMultipleTabs->setChecked(settings->confirmClosingMultipleTabs());
m_renameInline->setChecked(settings->renameInline());
m_showToolTips->setChecked(settings->showToolTips());
m_showSelectionToggle->setChecked(settings->showSelectionToggle());
m_naturalSorting->setChecked(KGlobalSettings::naturalSorting());
}