Commit 43931638 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring everywhere Genreal config group used to store main windows settings in RC file

Ensure that full screen settings is loaded at initialization of AlbumGUI.
CCBUGS: 320371
CCBUGS: 320016
CCBUGS: 319876
parent 6dee8c0d
......@@ -190,7 +190,9 @@ DigikamApp::DigikamApp()
setObjectName("Digikam");
if (d->config->group("General Settings").readEntry("Show Splash", true) &&
KConfigGroup group = AlbumSettings::instance()->generalConfigGroup();
if (group.readEntry("Show Splash", true) &&
!kapp->isSessionRestored())
{
d->splashScreen = new SplashScreen();
......@@ -208,7 +210,7 @@ DigikamApp::DigikamApp()
+ QString::number(QCoreApplication::instance()->applicationPid()));
// collection scan
if (d->config->group("General Settings").readEntry("Scan At Start", true) ||
if (group.readEntry("Scan At Start", true) ||
!CollectionScanner::databaseInitialScanDone())
{
ScanController::instance()->completeCollectionScanDeferFiles(d->splashScreen);
......@@ -220,7 +222,6 @@ DigikamApp::DigikamApp()
}
// ensure creation
AlbumSettings::instance();
AlbumManager::instance();
LoadingCacheInterface::initialize();
IccSettings::instance()->loadAllProfilesProperties();
......@@ -266,7 +267,7 @@ DigikamApp::DigikamApp()
// This manager must be created after collection setup.
d->tagsActionManager = new TagsActionMngr(this);
applyMainWindowSettings(d->config->group("General Settings"));
applyMainWindowSettings(group);
// Check ICC profiles repository availability
......@@ -291,10 +292,11 @@ DigikamApp::DigikamApp()
// preload additional windows
preloadWindows();
setAutoSaveSettings("General Settings", true);
readFullScreenSettings(group);
setAutoSaveSettings(group, true);
// Now, enable finished the collection scan as deferred process
NewItemsFinder* tool = new NewItemsFinder(NewItemsFinder::ScanDeferredFiles);
NewItemsFinder* const tool = new NewItemsFinder(NewItemsFinder::ScanDeferredFiles);
tool->start();
LoadSaveThread::setInfoProvider(new DatabaseLoadSaveFileInfoProvider);
......@@ -2414,7 +2416,7 @@ void DigikamApp::slotSetupChanged()
}
// Load full-screen options
KConfigGroup group = AlbumSettings::instance()->defaultConfigGroup();
KConfigGroup group = AlbumSettings::instance()->generalConfigGroup();
readFullScreenSettings(group);
d->view->applySettings();
......@@ -2446,7 +2448,7 @@ void DigikamApp::slotEditKeys()
void DigikamApp::slotConfToolbars()
{
saveMainWindowSettings(d->config->group("General Settings"));
saveMainWindowSettings(AlbumSettings::instance()->generalConfigGroup());
KEditToolBar dlg(factory(), this);
connect(&dlg, SIGNAL(newToolBarConfig()),
......@@ -2457,7 +2459,7 @@ void DigikamApp::slotConfToolbars()
void DigikamApp::slotNewToolbarConfig()
{
applyMainWindowSettings(d->config->group("General Settings"));
applyMainWindowSettings(AlbumSettings::instance()->generalConfigGroup());
}
void DigikamApp::slotConfNotifications()
......
......@@ -552,9 +552,9 @@ void AlbumSettings::init()
this, SLOT(applyNepomukSettings()));
}
KConfigGroup AlbumSettings::defaultConfigGroup() const
KConfigGroup AlbumSettings::generalConfigGroup() const
{
return d->config->group(d->configGroupDefault);
return d->config->group(d->configGroupGeneral);
}
void AlbumSettings::readSettings()
......@@ -563,7 +563,7 @@ void AlbumSettings::readSettings()
// ---------------------------------------------------------------------
KConfigGroup group = defaultConfigGroup();
KConfigGroup group = config->group(d->configGroupDefault);
QStringList collectionList = group.readEntry(d->configAlbumCollectionsEntry, QStringList());
......@@ -655,7 +655,7 @@ void AlbumSettings::readSettings()
// ---------------------------------------------------------------------
group = config->group(d->configGroupGeneral);
group = generalConfigGroup();
d->showSplash = group.readEntry(d->configShowSplashEntry, true);
d->useTrash = group.readEntry(d->configUseTrashEntry, true);
......@@ -701,7 +701,7 @@ void AlbumSettings::saveSettings()
// ---------------------------------------------------------------------
KConfigGroup group = defaultConfigGroup();
KConfigGroup group = config->group(d->configGroupDefault);
group.writeEntry(d->configAlbumCollectionsEntry, d->albumCategoryNames);
group.writeEntry(d->configAlbumSortOrderEntry, (int)d->albumSortOrder);
......@@ -775,7 +775,7 @@ void AlbumSettings::saveSettings()
// ---------------------------------------------------------------------
group = config->group(d->configGroupGeneral);
group = generalConfigGroup();
group.writeEntry(d->configShowSplashEntry, d->showSplash);
group.writeEntry(d->configUseTrashEntry, d->useTrash);
......
......@@ -393,7 +393,7 @@ public:
void setApplicationStyle(const QString& style);
QString getApplicationStyle() const;
KConfigGroup defaultConfigGroup() const;
KConfigGroup generalConfigGroup() const;
public Q_SLOTS:
......
......@@ -110,11 +110,11 @@ public:
SetupAlbumView::SetupAlbumView(QWidget* const parent)
: QScrollArea(parent), d(new Private)
{
QWidget* panel = new QWidget(viewport());
QWidget* const panel = new QWidget(viewport());
setWidget(panel);
setWidgetResizable(true);
QVBoxLayout* layout = new QVBoxLayout(panel);
QVBoxLayout* const layout = new QVBoxLayout(panel);
// --------------------------------------------------------
......@@ -306,7 +306,7 @@ void SetupAlbumView::applySettings()
settings->setShowFolderTreeViewItemsCount(d->showFolderTreeViewItemsCount->isChecked());
settings->saveSettings();
KConfigGroup group = settings->defaultConfigGroup();
KConfigGroup group = settings->generalConfigGroup();
d->fullScreenSettings->saveSettings(group);
}
......@@ -357,7 +357,7 @@ void SetupAlbumView::readSettings()
d->previewShowIcons->setChecked(settings->getPreviewShowIcons());
d->showFolderTreeViewItemsCount->setChecked(settings->getShowFolderTreeViewItemsCount());
KConfigGroup group = settings->defaultConfigGroup();
KConfigGroup group = settings->generalConfigGroup();
d->fullScreenSettings->readSettings(group);
}
......
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