mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Delete obsolete class DolphinSettings
This commit is contained in:
parent
4fcb5662a7
commit
3c77ffe832
|
@ -41,16 +41,16 @@ set(dolphinprivate_LIB_SRCS
|
|||
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
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "dolphinapplication.h"
|
||||
#include "dolphinmainwindow.h"
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "settings/dolphinsettings.h"
|
||||
|
||||
#include <KCmdLineArgs>
|
||||
#include <KDebug>
|
||||
|
@ -38,12 +37,11 @@ DolphinApplication::DolphinApplication() :
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -68,7 +66,7 @@ DolphinApplication::DolphinApplication() :
|
|||
args->clear();
|
||||
|
||||
if (resetSplitSettings) {
|
||||
generalSettings->setSplitView(false);
|
||||
GeneralSettings::setSplitView(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "dolphinmainwindow.h"
|
||||
#include "dolphinnewfilemenu.h"
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "dolphinviewcontainer.h"
|
||||
#include "dolphin_generalsettings.h"
|
||||
|
||||
|
@ -55,6 +54,7 @@
|
|||
#include <QClipboard>
|
||||
#include <QDir>
|
||||
|
||||
#include "views/dolphinplacesmodel.h"
|
||||
#include "views/dolphinview.h"
|
||||
#include "views/viewmodecontroller.h"
|
||||
|
||||
|
@ -194,9 +194,9 @@ void DolphinContextMenu::openTrashContextMenu()
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
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);
|
||||
|
@ -307,8 +307,8 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
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;
|
||||
|
@ -368,7 +368,7 @@ void DolphinContextMenu::openViewportContextMenu()
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ QString DolphinContextMenu::placesName(const KUrl& url) const
|
|||
|
||||
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) {
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#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"
|
||||
|
@ -88,6 +87,8 @@
|
|||
#include <KUrlComboBox>
|
||||
#include <KToolInvocation>
|
||||
|
||||
#include "views/dolphinplacesmodel.h"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QDBusMessage>
|
||||
#include <QKeyEvent>
|
||||
|
@ -143,6 +144,10 @@ DolphinMainWindow::DolphinMainWindow() :
|
|||
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):
|
||||
|
@ -163,8 +168,6 @@ DolphinMainWindow::DolphinMainWindow() :
|
|||
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);
|
||||
|
@ -278,8 +281,7 @@ void DolphinMainWindow::openDirectories(const QList<KUrl>& dirs)
|
|||
|
||||
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.
|
||||
|
@ -507,8 +509,7 @@ void DolphinMainWindow::openNewTab(const KUrl& url)
|
|||
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);
|
||||
|
@ -596,8 +597,6 @@ void DolphinMainWindow::showEvent(QShowEvent* event)
|
|||
|
||||
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;
|
||||
|
@ -606,7 +605,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
|
|||
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
|
||||
|
@ -632,7 +631,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
|
|||
KMessageBox::Notify);
|
||||
|
||||
if (doNotAskAgainCheckboxResult) {
|
||||
generalSettings->setConfirmClosingMultipleTabs(false);
|
||||
GeneralSettings::setConfirmClosingMultipleTabs(false);
|
||||
}
|
||||
|
||||
switch (result) {
|
||||
|
@ -648,8 +647,8 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
generalSettings->setVersion(CurrentDolphinVersion);
|
||||
generalSettings->writeConfig();
|
||||
GeneralSettings::setVersion(CurrentDolphinVersion);
|
||||
GeneralSettings::self()->writeConfig();
|
||||
|
||||
if (m_searchDockIsTemporaryVisible) {
|
||||
QDockWidget* searchDock = findChild<QDockWidget*>("searchDock");
|
||||
|
@ -948,9 +947,7 @@ void DolphinMainWindow::replaceLocation()
|
|||
|
||||
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) {
|
||||
|
@ -958,7 +955,7 @@ void DolphinMainWindow::togglePanelLockState()
|
|||
}
|
||||
}
|
||||
|
||||
generalSettings->setLockPanels(newLockState);
|
||||
GeneralSettings::setLockPanels(newLockState);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::slotPlacesPanelVisibilityChanged(bool visible)
|
||||
|
@ -1405,8 +1402,6 @@ void DolphinMainWindow::updateToolBarMenu()
|
|||
// by connecting to the aboutToHide() signal from the parent-menu.
|
||||
menu->clear();
|
||||
|
||||
const GeneralSettings* generalSettings = DolphinSettings::instance().generalSettings();
|
||||
|
||||
KActionCollection* ac = actionCollection();
|
||||
|
||||
// Add "Edit" actions
|
||||
|
@ -1420,7 +1415,7 @@ void DolphinMainWindow::updateToolBarMenu()
|
|||
}
|
||||
|
||||
// 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();
|
||||
|
@ -1743,7 +1738,7 @@ void DolphinMainWindow::setupActions()
|
|||
|
||||
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"));
|
||||
|
@ -1832,7 +1827,7 @@ void DolphinMainWindow::setupDockWidgets()
|
|||
searchPanel, SLOT(setUrl(KUrl)));
|
||||
#endif
|
||||
|
||||
if (DolphinSettings::instance().generalSettings()->version() < 200) {
|
||||
if (GeneralSettings::version() < 200) {
|
||||
infoDock->hide();
|
||||
foldersDock->hide();
|
||||
#ifndef Q_OS_WIN
|
||||
|
@ -1856,7 +1851,7 @@ void DolphinMainWindow::setupDockWidgets()
|
|||
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);
|
||||
|
||||
|
@ -2056,11 +2051,10 @@ void DolphinMainWindow::refreshViews()
|
|||
|
||||
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);
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <KInputDialog>
|
||||
#include <KProtocolInfo>
|
||||
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "views/dolphinview.h"
|
||||
#include "views/dolphinviewactionhandler.h"
|
||||
#include "views/dolphinnewfilemenuobserver.h"
|
||||
|
@ -129,7 +128,6 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
|
|||
|
||||
DolphinPart::~DolphinPart()
|
||||
{
|
||||
DolphinSettings::instance().save();
|
||||
DolphinNewFileMenuObserver::instance().detach(m_newFileMenu);
|
||||
}
|
||||
|
||||
|
|
|
@ -193,6 +193,12 @@ Icon=view-list-icons
|
|||
# Dummy
|
||||
Exec=dolphin
|
||||
|
||||
[Desktop Action compact]
|
||||
Name=Compact
|
||||
Icon=view-list-details
|
||||
# Dummy
|
||||
Exec=dolphin
|
||||
|
||||
[Desktop Action details]
|
||||
Name=Details
|
||||
Name[af]=Besonderhede
|
||||
|
@ -279,98 +285,6 @@ Name[wa]=Detays
|
|||
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
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <KDesktopFile>
|
||||
#include <KFileItemDelegate>
|
||||
#include <KFilePlacesModel>
|
||||
#include <KGlobalSettings>
|
||||
#include <KLocale>
|
||||
#include <KIconEffect>
|
||||
#include <KIO/NetAccess>
|
||||
|
@ -48,8 +47,8 @@
|
|||
#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"
|
||||
|
||||
|
@ -70,7 +69,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
|
|||
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()),
|
||||
|
@ -78,7 +77,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
|
|||
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()));
|
||||
|
@ -213,14 +212,13 @@ DolphinSearchBox* DolphinViewContainer::searchBox()
|
|||
|
||||
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();
|
||||
|
@ -381,9 +379,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item)
|
|||
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.
|
||||
|
@ -564,9 +560,7 @@ void DolphinViewContainer::requestFocus()
|
|||
|
||||
void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
|
||||
{
|
||||
DolphinSettings& settings = DolphinSettings::instance();
|
||||
settings.generalSettings()->setUrlCompletionMode(completion);
|
||||
settings.save();
|
||||
GeneralSettings::setUrlCompletionMode(completion);
|
||||
}
|
||||
|
||||
void DolphinViewContainer::slotHistoryChanged()
|
||||
|
|
|
@ -19,13 +19,11 @@
|
|||
|
||||
#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>
|
||||
|
@ -95,7 +93,8 @@ bool FoldersPanel::autoScrolling() const
|
|||
|
||||
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);
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
|
||||
#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),
|
||||
|
@ -352,8 +352,8 @@ void InformationPanelContent::refreshMetaData()
|
|||
|
||||
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);
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include <dolphinapplication.h>
|
||||
#include <dolphinmainwindow.h>
|
||||
#include "dolphinsettings.h"
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "general/generalsettingspage.h"
|
||||
#include "navigation/navigationsettingspage.h"
|
||||
|
@ -132,7 +131,7 @@ void DolphinSettingsDialog::applySettings()
|
|||
|
||||
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().
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "behaviorsettingspage.h"
|
||||
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include <settings/dolphinsettings.h>
|
||||
|
||||
#include <KDialog>
|
||||
#include <KLocale>
|
||||
|
@ -156,7 +155,7 @@ void BehaviorSettingsPage::applySettings()
|
|||
|
||||
void BehaviorSettingsPage::restoreDefaults()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
settings->useDefaults(true);
|
||||
loadSettings();
|
||||
settings->useDefaults(false);
|
||||
|
@ -166,8 +165,7 @@ void BehaviorSettingsPage::restoreDefaults()
|
|||
|
||||
void BehaviorSettingsPage::loadSettings()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
if (settings->globalViewProps()) {
|
||||
if (GeneralSettings::globalViewProps()) {
|
||||
m_globalProps->setChecked(true);
|
||||
} else {
|
||||
m_localProps->setChecked(true);
|
||||
|
@ -178,10 +176,10 @@ void BehaviorSettingsPage::loadSettings()
|
|||
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());
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "contextmenusettingspage.h"
|
||||
|
||||
#include <settings/dolphinsettings.h>
|
||||
#include <dolphin_generalsettings.h>
|
||||
|
||||
#include <KDialog>
|
||||
|
@ -68,14 +67,13 @@ void ContextMenuSettingsPage::applySettings()
|
|||
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);
|
||||
|
@ -88,8 +86,7 @@ void ContextMenuSettingsPage::loadSettings()
|
|||
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"
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <KServiceTypeTrader>
|
||||
#include <KService>
|
||||
|
||||
#include <settings/dolphinsettings.h>
|
||||
#include <settings/serviceitemdelegate.h>
|
||||
#include <settings/servicemodel.h>
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <KLocale>
|
||||
#include <KVBox>
|
||||
|
||||
#include <settings/dolphinsettings.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
@ -62,7 +60,7 @@ StatusBarSettingsPage::~StatusBarSettingsPage()
|
|||
|
||||
void StatusBarSettingsPage::applySettings()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
settings->setShowZoomSlider(m_showZoomSlider->isChecked());
|
||||
settings->setShowSpaceInfo(m_showSpaceInfo->isChecked());
|
||||
settings->writeConfig();
|
||||
|
@ -70,7 +68,7 @@ void StatusBarSettingsPage::applySettings()
|
|||
|
||||
void StatusBarSettingsPage::restoreDefaults()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
settings->useDefaults(true);
|
||||
loadSettings();
|
||||
settings->useDefaults(false);
|
||||
|
@ -78,9 +76,8 @@ void StatusBarSettingsPage::restoreDefaults()
|
|||
|
||||
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"
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
#include "navigationsettingspage.h"
|
||||
|
||||
#include "settings/dolphinsettings.h"
|
||||
|
||||
#include "dolphin_generalsettings.h"
|
||||
|
||||
#include <KDialog>
|
||||
|
@ -88,7 +86,7 @@ void NavigationSettingsPage::applySettings()
|
|||
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());
|
||||
|
||||
|
@ -97,7 +95,7 @@ void NavigationSettingsPage::applySettings()
|
|||
|
||||
void NavigationSettingsPage::restoreDefaults()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
settings->useDefaults(true);
|
||||
loadSettings();
|
||||
settings->useDefaults(false);
|
||||
|
@ -113,9 +111,8 @@ void NavigationSettingsPage::loadSettings()
|
|||
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"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "startupsettingspage.h"
|
||||
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "dolphinmainwindow.h"
|
||||
#include "dolphinviewcontainer.h"
|
||||
|
||||
|
@ -111,7 +110,7 @@ StartupSettingsPage::~StartupSettingsPage()
|
|||
|
||||
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);
|
||||
|
@ -131,7 +130,7 @@ void StartupSettingsPage::applySettings()
|
|||
|
||||
void StartupSettingsPage::restoreDefaults()
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
settings->useDefaults(true);
|
||||
loadSettings();
|
||||
settings->useDefaults(false);
|
||||
|
@ -142,9 +141,7 @@ void StartupSettingsPage::slotSettingsChanged()
|
|||
// 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();
|
||||
}
|
||||
|
||||
|
@ -171,13 +168,12 @@ void StartupSettingsPage::useDefaultLocation()
|
|||
|
||||
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"
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
#include <KDialog>
|
||||
#include <KVBox>
|
||||
|
||||
#include <settings/dolphinsettings.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
TrashSettingsPage::TrashSettingsPage(QWidget* parent) :
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "additionalinfodialog.h"
|
||||
#include "views/dolphinview.h"
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "dolphin_iconsmodesettings.h"
|
||||
#include "viewpropsprogressinfo.h"
|
||||
|
@ -73,7 +72,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
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);
|
||||
|
@ -348,14 +347,13 @@ void ViewPropertiesDialog::applyViewProperties()
|
|||
// 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) {
|
||||
|
@ -366,8 +364,9 @@ void ViewPropertiesDialog::applyViewProperties()
|
|||
|
||||
// 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());
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <KMenu>
|
||||
#include <KVBox>
|
||||
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "statusbarspaceinfo.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
@ -278,15 +277,13 @@ void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
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) {
|
||||
|
@ -295,11 +292,11 @@ void DolphinStatusBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
@ -356,9 +353,8 @@ void DolphinStatusBar::setExtensionsVisible(bool 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);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* 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 *
|
||||
|
@ -18,42 +17,18 @@
|
|||
* 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;
|
||||
return m_filePlacesModel;
|
||||
}
|
||||
|
||||
void DolphinSettings::save()
|
||||
void DolphinPlacesModel::setModel(KFilePlacesModel* model)
|
||||
{
|
||||
m_generalSettings->writeConfig();
|
||||
}
|
||||
|
||||
DolphinSettings::DolphinSettings()
|
||||
{
|
||||
m_generalSettings = GeneralSettings::self();
|
||||
m_placesModel = new KFilePlacesModel();
|
||||
}
|
||||
|
||||
DolphinSettings::~DolphinSettings()
|
||||
{
|
||||
delete m_placesModel;
|
||||
m_placesModel = 0;
|
||||
m_filePlacesModel = model;
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
/***************************************************************************
|
||||
* 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 *
|
||||
|
@ -18,54 +17,27 @@
|
|||
* 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;
|
||||
|
||||
friend class DolphinMainWindow; // Sets the model with setModel()
|
||||
};
|
||||
|
||||
inline GeneralSettings* DolphinSettings::generalSettings() const
|
||||
{
|
||||
return m_generalSettings;
|
||||
}
|
||||
|
||||
inline KFilePlacesModel* DolphinSettings::placesModel() const
|
||||
{
|
||||
return m_placesModel;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -64,7 +64,6 @@
|
|||
#include "dolphinitemlistcontainer.h"
|
||||
#include "draganddrophelper.h"
|
||||
#include "renamedialog.h"
|
||||
#include "settings/dolphinsettings.h"
|
||||
#include "versioncontrol/versioncontrolobserver.h"
|
||||
#include "viewmodecontroller.h"
|
||||
#include "viewproperties.h"
|
||||
|
|
|
@ -314,6 +314,9 @@ QString DolphinViewActionHandler::currentViewModeActionName() const
|
|||
return "details";
|
||||
case DolphinView::CompactView:
|
||||
return "compact";
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
return QString(); // can't happen
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#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
|
||||
|
@ -47,7 +45,7 @@ ViewProperties::ViewProperties(const KUrl& url) :
|
|||
m_autoSave(true),
|
||||
m_node(0)
|
||||
{
|
||||
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
|
||||
GeneralSettings* settings = GeneralSettings::self();
|
||||
const bool useGlobalViewProps = settings->globalViewProps();
|
||||
bool useDetailsViewWithPath = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue