kitemviews/kpixmapmodifier.cpp
settings/additionalinfodialog.cpp
settings/applyviewpropsjob.cpp
- settings/dolphinsettings.cpp
settings/viewpropertiesdialog.cpp
settings/viewpropsprogressinfo.cpp
views/additionalinfoaccessor.cpp
views/dolphindirlister.cpp
views/dolphinfileitemlistwidget.cpp
- views/dolphinview.cpp
views/dolphinitemlistcontainer.cpp
views/dolphinnewfilemenuobserver.cpp
+ views/dolphinplacesmodel.cpp
views/dolphinremoteencoding.cpp
+ views/dolphinview.cpp
views/dolphinviewactionhandler.cpp
views/dolphinviewautoscroller.cpp
views/draganddrophelper.cpp
#include "dolphinapplication.h"
#include "dolphinmainwindow.h"
#include "dolphin_generalsettings.h"
-#include "settings/dolphinsettings.h"
#include <KCmdLineArgs>
#include <KDebug>
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
bool resetSplitSettings = false;
- GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
- if (args->isSet("split") && !generalSettings->splitView()) {
+ if (args->isSet("split") && !GeneralSettings::splitView()) {
// Dolphin should be opened with a split view although this is not
// set in the GeneralSettings. Temporary adjust the setting until
// all passed URLs have been opened.
- generalSettings->setSplitView(true);
+ GeneralSettings::setSplitView(true);
resetSplitSettings = true;
}
args->clear();
if (resetSplitSettings) {
- generalSettings->setSplitView(false);
+ GeneralSettings::setSplitView(false);
}
}
#include "dolphinmainwindow.h"
#include "dolphinnewfilemenu.h"
-#include "settings/dolphinsettings.h"
#include "dolphinviewcontainer.h"
#include "dolphin_generalsettings.h"
#include <QClipboard>
#include <QDir>
+#include "views/dolphinplacesmodel.h"
#include "views/dolphinview.h"
#include "views/viewmodecontroller.h"
if (action == emptyTrashAction) {
KonqOperations::emptyTrash(m_mainWindow);
} else if (action == addToPlacesAction) {
- const KUrl& url = m_mainWindow->activeViewContainer()->url();
+ const KUrl url = m_mainWindow->activeViewContainer()->url();
if (url.isValid()) {
- DolphinSettings::instance().placesModel()->addPlace(i18nc("@label", "Trash"), url);
+ DolphinPlacesModel::instance()->addPlace(i18nc("@label", "Trash"), url);
}
}
}
addVersionControlPluginActions();
// insert 'Copy To' and 'Move To' sub menus
- if (DolphinSettings::instance().generalSettings()->showCopyMoveMenu()) {
+ if (GeneralSettings::showCopyMoveMenu()) {
m_copyToMenu.setItems(m_selectedItems);
m_copyToMenu.setReadOnly(!selectedItemsProperties().supportsWriting());
m_copyToMenu.addActionsTo(m_popup);
if (activatedAction == addToPlacesAction) {
const KUrl selectedUrl(m_fileInfo.url());
if (selectedUrl.isValid()) {
- DolphinSettings::instance().placesModel()->addPlace(placesName(selectedUrl),
- selectedUrl);
+ DolphinPlacesModel::instance()->addPlace(placesName(selectedUrl),
+ selectedUrl);
}
} else if (activatedAction == openParentInNewWindowAction) {
m_command = OpenParentFolderInNewWindow;
if (addToPlacesAction && (action == addToPlacesAction)) {
const KUrl url = m_mainWindow->activeViewContainer()->url();
if (url.isValid()) {
- DolphinSettings::instance().placesModel()->addPlace(placesName(url), url);
+ DolphinPlacesModel::instance()->addPlace(placesName(url), url);
}
}
}
bool DolphinContextMenu::placeExists(const KUrl& url) const
{
- const KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
+ const KFilePlacesModel* placesModel = DolphinPlacesModel::instance();
const int count = placesModel->rowCount();
for (int i = 0; i < count; ++i) {
#include "panels/information/informationpanel.h"
#include "search/dolphinsearchbox.h"
#include "search/dolphinsearchinformation.h"
-#include "settings/dolphinsettings.h"
#include "settings/dolphinsettingsdialog.h"
#include "statusbar/dolphinstatusbar.h"
#include "views/dolphinviewactionhandler.h"
#include <KUrlComboBox>
#include <KToolInvocation>
+#include "views/dolphinplacesmodel.h"
+
#include <QDesktopWidget>
#include <QDBusMessage>
#include <QKeyEvent>
m_lastHandleUrlStatJob(0),
m_searchDockIsTemporaryVisible(false)
{
+ DolphinPlacesModel::setModel(new KFilePlacesModel(this));
+ connect(DolphinPlacesModel::instance(), SIGNAL(errorMessage(QString)),
+ this, SLOT(showErrorMessage(QString)));
+
// Workaround for a X11-issue in combination with KModifierInfo
// (see DolphinContextMenu::initializeModifierKeyInfo() for
// more information):
this, SLOT(clearStatusBar()));
connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
this, SLOT(showCommand(CommandType)));
- connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(QString)),
- this, SLOT(showErrorMessage(QString)));
GeneralSettings* generalSettings = GeneralSettings::self();
const bool firstRun = (generalSettings->version() < 200);
const int oldOpenTabsCount = m_viewTab.count();
- const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
- const bool hasSplitView = generalSettings->splitView();
+ const bool hasSplitView = GeneralSettings::splitView();
// Open each directory inside a new tab. If the "split view" option has been enabled,
// always show two directories within one tab.
actionCollection()->action("close_tab")->setEnabled(true);
// provide a split view, if the startup settings are set this way
- const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
- if (generalSettings->splitView()) {
+ if (GeneralSettings::splitView()) {
const int tabIndex = m_viewTab.count() - 1;
createSecondaryView(tabIndex);
m_viewTab[tabIndex].secondaryView->setActive(true);
void DolphinMainWindow::closeEvent(QCloseEvent* event)
{
- GeneralSettings* generalSettings = GeneralSettings::self();
-
// Find out if Dolphin is closed directly by the user or
// by the session manager because the session is closed
bool closedByUser = true;
closedByUser = false;
}
- if ((m_viewTab.count() > 1) && generalSettings->confirmClosingMultipleTabs() && closedByUser) {
+ if (m_viewTab.count() > 1 && GeneralSettings::confirmClosingMultipleTabs() && closedByUser) {
// Ask the user if he really wants to quit and close all tabs.
// Open a confirmation dialog with 3 buttons:
// KDialog::Yes -> Quit
KMessageBox::Notify);
if (doNotAskAgainCheckboxResult) {
- generalSettings->setConfirmClosingMultipleTabs(false);
+ GeneralSettings::setConfirmClosingMultipleTabs(false);
}
switch (result) {
}
}
- generalSettings->setVersion(CurrentDolphinVersion);
- generalSettings->writeConfig();
+ GeneralSettings::setVersion(CurrentDolphinVersion);
+ GeneralSettings::self()->writeConfig();
if (m_searchDockIsTemporaryVisible) {
QDockWidget* searchDock = findChild<QDockWidget*>("searchDock");
void DolphinMainWindow::togglePanelLockState()
{
- GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
-
- const bool newLockState = !generalSettings->lockPanels();
+ const bool newLockState = !GeneralSettings::lockPanels();
foreach (QObject* child, children()) {
DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child);
if (dock) {
}
}
- generalSettings->setLockPanels(newLockState);
+ GeneralSettings::setLockPanels(newLockState);
}
void DolphinMainWindow::slotPlacesPanelVisibilityChanged(bool visible)
// by connecting to the aboutToHide() signal from the parent-menu.
menu->clear();
- const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
-
KActionCollection* ac = actionCollection();
// Add "Edit" actions
}
// Add "View" actions
- if (!generalSettings->showZoomSlider()) {
+ if (!GeneralSettings::showZoomSlider()) {
addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ZoomIn)), menu);
addActionToMenu(ac->action(KStandardAction::name(KStandardAction::ZoomOut)), menu);
menu->addSeparator();
void DolphinMainWindow::setupDockWidgets()
{
- const bool lock = DolphinSettings::instance().generalSettings()->lockPanels();
+ const bool lock = GeneralSettings::lockPanels();
KDualAction* lockLayoutAction = actionCollection()->add<KDualAction>("lock_panels");
lockLayoutAction->setActiveText(i18nc("@action:inmenu Panels", "Unlock Panels"));
searchPanel, SLOT(setUrl(KUrl)));
#endif
- if (DolphinSettings::instance().generalSettings()->version() < 200) {
+ if (GeneralSettings::version() < 200) {
infoDock->hide();
foldersDock->hide();
#ifndef Q_OS_WIN
placesActions.append(separator);
placesActions.append(lockLayoutAction);
placesPanel->addActions(placesActions);
- placesPanel->setModel(DolphinSettings::instance().placesModel());
+ placesPanel->setModel(DolphinPlacesModel::instance());
placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
placesDock->setWidget(placesPanel);
setActiveViewContainer(activeViewContainer);
- const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
- if (generalSettings->modifiedStartupSettings()) {
+ if (GeneralSettings::modifiedStartupSettings()) {
// The startup settings have been changed by the user (see bug #254947).
// Synchronize the split-view setting with the active view:
- const bool splitView = generalSettings->splitView();
+ const bool splitView = GeneralSettings::splitView();
const ViewTab& activeTab = m_viewTab[m_tabIndex];
const bool toggle = ( splitView && !activeTab.secondaryView)
|| (!splitView && activeTab.secondaryView);
#include <KInputDialog>
#include <KProtocolInfo>
-#include "settings/dolphinsettings.h"
#include "views/dolphinview.h"
#include "views/dolphinviewactionhandler.h"
#include "views/dolphinnewfilemenuobserver.h"
DolphinPart::~DolphinPart()
{
- DolphinSettings::instance().save();
DolphinNewFileMenuObserver::instance().detach(m_newFileMenu);
}
# Dummy
Exec=dolphin
+[Desktop Action compact]
+Name=Compact
+Icon=view-list-details
+# Dummy
+Exec=dolphin
+
[Desktop Action details]
Name=Details
Name[af]=Besonderhede
Name[x-test]=xxDetailsxx
Name[zh_CN]=细节
Name[zh_TW]=詳情
-Icon=view-list-details
+Icon=view-list-tree
# Dummy
Exec=dolphin
-
-[Desktop Action columns]
-Name=Columns
-Name[af]=Kolomme
-Name[ar]=الأعمدة
-Name[as]=কলাম
-Name[ast]=Columnes
-Name[be@latin]=Słupki
-Name[bg]=Колони
-Name[bn]=কলাম
-Name[bn_IN]=কলাম
-Name[bs]=Kolone
-Name[ca]=Columnes
-Name[ca@valencia]=Columnes
-Name[cs]=Sloupce
-Name[csb]=Kòlumnë
-Name[da]=Kolonner
-Name[de]=Spalten
-Name[el]=Στήλες
-Name[en_GB]=Columns
-Name[eo]=Kolumnoj
-Name[es]=Columnas
-Name[et]=Veerud
-Name[eu]=Zutabeak
-Name[fa]=ستونها
-Name[fi]=Sarakkeet
-Name[fr]=Colonnes
-Name[fy]=Kolommen
-Name[ga]=Colúin
-Name[gl]=Columnas
-Name[gu]=સ્થંભો
-Name[he]=עמודות
-Name[hi]=स्तम्भ
-Name[hne]=स्तम्भ
-Name[hr]=Stupci
-Name[hsb]=Stołpiki
-Name[hu]=Oszlopok
-Name[ia]=Columnas
-Name[id]=Kolom
-Name[is]=Dálkar
-Name[it]=Colonne
-Name[ja]=カラム
-Name[ka]=სვეტები
-Name[kk]=Бағандар
-Name[km]=ជួរឈរ
-Name[kn]= ಲಂಬಸಾಲುಗಳ ಬಣ್ಣಗಳು
-Name[ko]=열
-Name[ku]=Stûn
-Name[lt]=Stulpeliai
-Name[lv]=Kolonas
-Name[mai]=कालम
-Name[mk]=Колони
-Name[ml]=നിരകള്
-Name[mr]=स्तंभ
-Name[ms]=Lajur
-Name[nb]=Kolonner
-Name[nds]=Striepen
-Name[nl]=Kolommen
-Name[nn]=Kolonnar
-Name[or]=ସ୍ତମ୍ଭ
-Name[pa]=ਕਾਲਮ
-Name[pl]=Kolumny
-Name[pt]=Colunas
-Name[pt_BR]=Colunas
-Name[ro]=Coloane
-Name[ru]=Столбцы
-Name[se]=Čuolddat
-Name[si]=තීරු
-Name[sk]=Stĺpce
-Name[sl]=Stolpci
-Name[sr]=Колоне
-Name[sr@ijekavian]=Колоне
-Name[sr@ijekavianlatin]=Kolone
-Name[sr@latin]=Kolone
-Name[sv]=Kolumner
-Name[ta]=நெடுவரிசைகள்
-Name[te]=నిలువు వరుసలు
-Name[tg]=Сутунҳо
-Name[th]=คอลัมน์
-Name[tr]=Sütunlar
-Name[ug]=ئىستونلار
-Name[uk]=Колонки
-Name[uz]=Ustunlar
-Name[uz@cyrillic]=Устунлар
-Name[wa]=Colones
-Name[x-test]=xxColumnsxx
-Name[zh_CN]=分列
-Name[zh_TW]=欄位
-Icon=view-file-columns
-# Dummy
-Exec=dolphin
-
#include <KDesktopFile>
#include <KFileItemDelegate>
#include <KFilePlacesModel>
-#include <KGlobalSettings>
#include <KLocale>
#include <KIconEffect>
#include <KIO/NetAccess>
#include "dolphinmainwindow.h"
#include "filterbar/filterbar.h"
#include "search/dolphinsearchbox.h"
-#include "settings/dolphinsettings.h"
#include "statusbar/dolphinstatusbar.h"
+#include "views/dolphinplacesmodel.h"
#include "views/viewmodecontroller.h"
#include "views/viewproperties.h"
m_topLayout->setSpacing(0);
m_topLayout->setMargin(0);
- m_urlNavigator = new KUrlNavigator(DolphinSettings::instance().placesModel(), url, this);
+ m_urlNavigator = new KUrlNavigator(DolphinPlacesModel::instance(), url, this);
connect(m_urlNavigator, SIGNAL(urlsDropped(KUrl,QDropEvent*)),
this, SLOT(dropUrls(KUrl,QDropEvent*)));
connect(m_urlNavigator, SIGNAL(activated()),
connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
- const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ const GeneralSettings* settings = GeneralSettings::self();
m_urlNavigator->setUrlEditable(settings->editableUrl());
m_urlNavigator->setShowFullPath(settings->showFullPath());
m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
void DolphinViewContainer::refresh()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- if (settings->modifiedStartupSettings()) {
+ if (GeneralSettings::modifiedStartupSettings()) {
// The startup settings should only get applied if they have been
// modified by the user. Otherwise keep the (possibly) different current
// settings of the URL navigator and the filterbar.
- m_urlNavigator->setUrlEditable(settings->editableUrl());
- m_urlNavigator->setShowFullPath(settings->showFullPath());
- setFilterBarVisible(settings->filterBar());
+ m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl());
+ m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath());
+ setFilterBarVisible(GeneralSettings::filterBar());
}
m_view->refresh();
return;
}
- const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- const bool browseThroughArchives = settings->browseThroughArchives();
- if (browseThroughArchives && item.isFile() && url.isLocalFile()) {
+ if (GeneralSettings::browseThroughArchives() && item.isFile() && url.isLocalFile()) {
// Generic mechanism for redirecting to tar:/<path>/ when clicking on a tar file,
// zip:/<path>/ when clicking on a zip file, etc.
// The .protocol file specifies the mimetype that the kioslave handles.
void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
{
- DolphinSettings& settings = DolphinSettings::instance();
- settings.generalSettings()->setUrlCompletionMode(completion);
- settings.save();
+ GeneralSettings::setUrlCompletionMode(completion);
}
void DolphinViewContainer::slotHistoryChanged()
#include "folderspanel.h"
-#include "settings/dolphinsettings.h"
#include "dolphin_folderspanelsettings.h"
#include "dolphin_generalsettings.h"
#include "paneltreeview.h"
#include "treeviewcontextmenu.h"
-#include <KFilePlacesModel>
#include <KDirLister>
#include <KFileItem>
#include <konq_operations.h>
void FoldersPanel::rename(const KFileItem& item)
{
- if (DolphinSettings::instance().generalSettings()->renameInline()) {
+ // TODO: Inline renaming is not supported anymore in Dolphin 2.0
+ if (false /* GeneralSettings::renameInline() */) {
//const QModelIndex dirIndex = m_dolphinModel->indexForItem(item);
//const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
//m_treeView->edit(proxyIndex);
#include "dolphin_informationpanelsettings.h"
#include "filemetadataconfigurationdialog.h"
-#include "settings/dolphinsettings.h"
#include "phononwidget.h"
#include "pixmapviewer.h"
+#include "views/dolphinplacesmodel.h"
InformationPanelContent::InformationPanelContent(QWidget* parent) :
QWidget(parent),
bool InformationPanelContent::applyPlace(const KUrl& url)
{
- KFilePlacesModel* placesModel = DolphinSettings::instance().placesModel();
- int count = placesModel->rowCount();
+ KFilePlacesModel* placesModel = DolphinPlacesModel::instance();
+ const int count = placesModel->rowCount();
for (int i = 0; i < count; ++i) {
QModelIndex index = placesModel->index(i, 0);
#include <dolphinapplication.h>
#include <dolphinmainwindow.h>
-#include "dolphinsettings.h"
#include "dolphin_generalsettings.h"
#include "general/generalsettingspage.h"
#include "navigation/navigationsettingspage.h"
emit settingsChanged();
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
if (settings->modifiedStartupSettings()) {
// Reset the modified startup settings hint. The changed startup settings
// have been applied already due to emitting settingsChanged().
#include "behaviorsettingspage.h"
#include "dolphin_generalsettings.h"
-#include <settings/dolphinsettings.h>
#include <KDialog>
#include <KLocale>
void BehaviorSettingsPage::restoreDefaults()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
void BehaviorSettingsPage::loadSettings()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- if (settings->globalViewProps()) {
+ if (GeneralSettings::globalViewProps()) {
m_globalProps->setChecked(true);
} else {
m_localProps->setChecked(true);
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_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs());
+ m_renameInline->setChecked(GeneralSettings::renameInline());
+ m_showToolTips->setChecked(GeneralSettings::showToolTips());
+ m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_naturalSorting->setChecked(KGlobalSettings::naturalSorting());
}
#include "contextmenusettingspage.h"
-#include <settings/dolphinsettings.h>
#include <dolphin_generalsettings.h>
#include <KDialog>
configGroup.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
configGroup.sync();
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked());
- settings->writeConfig();
+ GeneralSettings::setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked());
+ GeneralSettings::self()->writeConfig();
}
void ContextMenuSettingsPage::restoreDefaults()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
KConfigGroup configGroup(globalConfig, "KDE");
m_showDeleteCommand->setChecked(configGroup.readEntry("ShowDeleteCommand", SHOW_DELETE));
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu());
+ m_showCopyMoveMenu->setChecked(GeneralSettings::showCopyMoveMenu());
}
#include "contextmenusettingspage.moc"
#include <KServiceTypeTrader>
#include <KService>
-#include <settings/dolphinsettings.h>
#include <settings/serviceitemdelegate.h>
#include <settings/servicemodel.h>
#include <KLocale>
#include <KVBox>
-#include <settings/dolphinsettings.h>
-
#include <QCheckBox>
#include <QVBoxLayout>
void StatusBarSettingsPage::applySettings()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->setShowZoomSlider(m_showZoomSlider->isChecked());
settings->setShowSpaceInfo(m_showSpaceInfo->isChecked());
settings->writeConfig();
void StatusBarSettingsPage::restoreDefaults()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
void StatusBarSettingsPage::loadSettings()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- m_showZoomSlider->setChecked(settings->showZoomSlider());
- m_showSpaceInfo->setChecked(settings->showSpaceInfo());
+ m_showZoomSlider->setChecked(GeneralSettings::showZoomSlider());
+ m_showSpaceInfo->setChecked(GeneralSettings::showSpaceInfo());
}
#include "statusbarsettingspage.moc"
#include "navigationsettingspage.h"
-#include "settings/dolphinsettings.h"
-
#include "dolphin_generalsettings.h"
#include <KDialog>
config.sync();
KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_MOUSE);
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->setBrowseThroughArchives(m_openArchivesAsFolder->isChecked());
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
void NavigationSettingsPage::restoreDefaults()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
const bool singleClick = KGlobalSettings::singleClick();
m_singleClick->setChecked(singleClick);
m_doubleClick->setChecked(!singleClick);
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- m_openArchivesAsFolder->setChecked(settings->browseThroughArchives());
- m_autoExpandFolders->setChecked(settings->autoExpandFolders());
+ m_openArchivesAsFolder->setChecked(GeneralSettings::browseThroughArchives());
+ m_autoExpandFolders->setChecked(GeneralSettings::autoExpandFolders());
}
#include "navigationsettingspage.moc"
#include "startupsettingspage.h"
-#include "settings/dolphinsettings.h"
#include "dolphinmainwindow.h"
#include "dolphinviewcontainer.h"
void StartupSettingsPage::applySettings()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
const KUrl url(m_homeUrl->text());
KFileItem fileItem(KFileItem::Unknown, KFileItem::Unknown, url);
void StartupSettingsPage::restoreDefaults()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->useDefaults(true);
loadSettings();
settings->useDefaults(false);
// Provide a hint that the startup settings have been changed. This allows the views
// to apply the startup settings only if they have been explicitly changed by the user
// (see bug #254947).
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- settings->setModifiedStartupSettings(true);
-
+ GeneralSettings::setModifiedStartupSettings(true);
emit changed();
}
void StartupSettingsPage::loadSettings()
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- KUrl url(settings->homeUrl());
+ const KUrl url(GeneralSettings::homeUrl());
m_homeUrl->setText(url.prettyUrl());
- m_splitView->setChecked(settings->splitView());
- m_editableUrl->setChecked(settings->editableUrl());
- m_showFullPath->setChecked(settings->showFullPath());
- m_filterBar->setChecked(settings->filterBar());
+ m_splitView->setChecked(GeneralSettings::splitView());
+ m_editableUrl->setChecked(GeneralSettings::editableUrl());
+ m_showFullPath->setChecked(GeneralSettings::showFullPath());
+ m_filterBar->setChecked(GeneralSettings::filterBar());
}
#include "startupsettingspage.moc"
#include <KDialog>
#include <KVBox>
-#include <settings/dolphinsettings.h>
-
#include <QVBoxLayout>
TrashSettingsPage::TrashSettingsPage(QWidget* parent) :
#include "additionalinfodialog.h"
#include "views/dolphinview.h"
-#include "settings/dolphinsettings.h"
#include "dolphin_generalsettings.h"
#include "dolphin_iconsmodesettings.h"
#include "viewpropsprogressinfo.h"
m_useAsDefault(0)
{
Q_ASSERT(dolphinView);
- const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
+ const bool useGlobalViewProps = GeneralSettings::globalViewProps();
setCaption(i18nc("@title:window", "View Properties"));
setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
// For directories where no .directory file is available, the .directory
// file stored for the global view properties is used as fallback. To update
// this file we temporary turn on the global view properties mode.
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- Q_ASSERT(!settings->globalViewProps());
+ Q_ASSERT(!GeneralSettings::globalViewProps());
- settings->setGlobalViewProps(true);
+ GeneralSettings::setGlobalViewProps(true);
ViewProperties defaultProps(m_dolphinView->url());
defaultProps.setDirProperties(*m_viewProps);
defaultProps.save();
- settings->setGlobalViewProps(false);
+ GeneralSettings::setGlobalViewProps(false);
}
if (applyToAllFolders) {
// Updating the global view properties time stamp in the general settings makes
// all existing viewproperties invalid, as they have a smaller time stamp.
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
settings->setViewPropsTimestamp(QDateTime::currentDateTime());
+ settings->writeConfig();
}
m_dolphinView->setMode(m_viewProps->viewMode());
#include <KMenu>
#include <KVBox>
-#include "settings/dolphinsettings.h"
#include "statusbarspaceinfo.h"
#include <QApplication>
default: break;
}
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
-
QAction* showZoomSliderAction = menu.addAction(i18nc("@action:inmenu", "Show Zoom Slider"));
showZoomSliderAction->setCheckable(true);
- showZoomSliderAction->setChecked(settings->showZoomSlider());
+ showZoomSliderAction->setChecked(GeneralSettings::showZoomSlider());
QAction* showSpaceInfoAction = menu.addAction(i18nc("@action:inmenu", "Show Space Information"));
showSpaceInfoAction->setCheckable(true);
- showSpaceInfoAction->setChecked(settings->showSpaceInfo());
+ showSpaceInfoAction->setChecked(GeneralSettings::showSpaceInfo());
const QAction* action = menu.exec(QCursor::pos());
if (action == copyAction) {
QApplication::clipboard()->setMimeData(mimeData);
} else if (action == showZoomSliderAction) {
const bool visible = showZoomSliderAction->isChecked();
- settings->setShowZoomSlider(visible);
+ GeneralSettings::setShowZoomSlider(visible);
m_zoomSlider->setVisible(visible);
} else if (action == showSpaceInfoAction) {
const bool visible = showSpaceInfoAction->isChecked();
- settings->setShowSpaceInfo(visible);
+ GeneralSettings::setShowSpaceInfo(visible);
m_spaceInfo->setVisible(visible);
}
}
bool showSpaceInfo = visible;
bool showZoomSlider = visible;
if (visible) {
- const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- showSpaceInfo = settings->showSpaceInfo();
- showZoomSlider = settings->showZoomSlider();
+ showSpaceInfo = GeneralSettings::showSpaceInfo();
+ showZoomSlider = GeneralSettings::showZoomSlider();
}
m_spaceInfo->setVisible(showSpaceInfo);
m_zoomSlider->setVisible(showZoomSlider);
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at), *
- * Cvetoslav Ludmiloff and Patrice Tremblay *
+ * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "dolphinsettings.h"
+#include "dolphinplacesmodel.h"
#include <KFilePlacesModel>
-#include <KComponentData>
-#include <KLocale>
-#include <KStandardDirs>
-#include "dolphin_detailsmodesettings.h"
-#include "dolphin_generalsettings.h"
-#include "dolphin_iconsmodesettings.h"
+KFilePlacesModel* DolphinPlacesModel::m_filePlacesModel = 0;
-class DolphinSettingsSingleton
+KFilePlacesModel* DolphinPlacesModel::instance()
{
-public:
- DolphinSettings instance;
-};
-K_GLOBAL_STATIC(DolphinSettingsSingleton, s_settings)
-
-DolphinSettings& DolphinSettings::instance()
-{
- return s_settings->instance;
-}
-
-void DolphinSettings::save()
-{
- m_generalSettings->writeConfig();
-}
-
-DolphinSettings::DolphinSettings()
-{
- m_generalSettings = GeneralSettings::self();
- m_placesModel = new KFilePlacesModel();
+ return m_filePlacesModel;
}
-DolphinSettings::~DolphinSettings()
+void DolphinPlacesModel::setModel(KFilePlacesModel* model)
{
- delete m_placesModel;
- m_placesModel = 0;
+ m_filePlacesModel = model;
}
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
- * peter.penz@gmx.at *
+ * Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef DOLPHINSETTINGS_H
-#define DOLPHINSETTINGS_H
+#ifndef DOLPHIN_PLACES_MODEL_H
+#define DOLPHIN_PLACES_MODEL_H
#include <libdolphin_export.h>
-class GeneralSettings;
class KFilePlacesModel;
-// TODO: Remove this class completely and just work with the settings directly instead
-
/**
- * @brief Manages and stores all settings from Dolphin.
- *
- * The following properties are stored:
- * - home URL
- * - default view mode
- * - URL navigator state (editable or not)
- * - Text completion state
- * - split view
- * - properties for views
+ * @brief Allows global access to the places-model of Dolphin
+ * that is shown in the "Places" panel.
*/
-class LIBDOLPHINPRIVATE_EXPORT DolphinSettings
+class LIBDOLPHINPRIVATE_EXPORT DolphinPlacesModel
{
public:
- static DolphinSettings& instance();
-
- GeneralSettings* generalSettings() const;
- KFilePlacesModel* placesModel() const;
- virtual void save();
-
-protected:
- DolphinSettings();
- virtual ~DolphinSettings();
- friend class DolphinSettingsSingleton;
+ static KFilePlacesModel* instance();
private:
- GeneralSettings* m_generalSettings;
- KFilePlacesModel* m_placesModel;
-};
+ static void setModel(KFilePlacesModel* model);
+ static KFilePlacesModel* m_filePlacesModel;
-inline GeneralSettings* DolphinSettings::generalSettings() const
-{
- return m_generalSettings;
-}
-
-inline KFilePlacesModel* DolphinSettings::placesModel() const
-{
- return m_placesModel;
-}
+ friend class DolphinMainWindow; // Sets the model with setModel()
+};
#endif
#include "dolphinitemlistcontainer.h"
#include "draganddrophelper.h"
#include "renamedialog.h"
-#include "settings/dolphinsettings.h"
#include "versioncontrol/versioncontrolobserver.h"
#include "viewmodecontroller.h"
#include "viewproperties.h"
return "details";
case DolphinView::CompactView:
return "compact";
+ default:
+ Q_ASSERT(false);
+ break;
}
return QString(); // can't happen
}
#include <QFile>
#include <QFileInfo>
-#include "settings/dolphinsettings.h"
-
namespace {
// String representation to mark the additional properties of
// the details view as customized by the user. See
m_autoSave(true),
m_node(0)
{
- GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ GeneralSettings* settings = GeneralSettings::self();
const bool useGlobalViewProps = settings->globalViewProps();
bool useDetailsViewWithPath = false;