Commit f05f0355 authored by Gregor Mi's avatar Gregor Mi

apply coding suggestions from REVIEW:115291

parent 5bd7d753
......@@ -149,7 +149,7 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent, KTextEditor::View *vi
sessionConfigUi->restoreVC->setChecked( cgGeneral.readEntry("Restore Window Configuration", true) );
connect(sessionConfigUi->restoreVC, SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
sessionConfigUi->spinBoxRecentFilesCount->setValue(readRecentFilesMaxCount(config));
sessionConfigUi->spinBoxRecentFilesCount->setValue(recentFilesMaxCount());
connect(sessionConfigUi->spinBoxRecentFilesCount, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
QString sesStart (cgGeneral.readEntry ("Startup Session", "manual"));
......@@ -383,9 +383,9 @@ void KateConfigDialog::slotHelp()
QDesktopServices::openUrl(QUrl(QStringLiteral("help:/")));
}
int KateConfigDialog::readRecentFilesMaxCount(KSharedConfig::Ptr config)
int KateConfigDialog::recentFilesMaxCount()
{
int maxItems = KConfigGroup(config, "General").readEntry("Recent File List Entry Count", 10);
int maxItems = KConfigGroup(KSharedConfig::openConfig(), "General").readEntry("Recent File List Entry Count", 10);
return maxItems;
}
......@@ -29,7 +29,6 @@
#include <KTextEditor/View>
#include <KPageDialog>
#include <KSharedConfig>
class QCheckBox;
class QSpinBox;
......@@ -60,7 +59,7 @@ public: // static
* Reads the value from the given open config. If not present in config yet then
* the default value 10 is used.
*/
static int readRecentFilesMaxCount(KSharedConfig::Ptr config);
static int recentFilesMaxCount();
public:
void addPluginPage(KTextEditor::Plugin *plugin);
......
......@@ -277,7 +277,7 @@ void KateMainWindow::setupActions()
->setWhatsThis(i18n("Open an existing document for editing"));
m_fileOpenRecent = KStandardAction::openRecent(m_viewManager, SLOT(openUrl(QUrl)), this);
m_fileOpenRecent->setMaxItems(KateConfigDialog::readRecentFilesMaxCount(KSharedConfig::openConfig()));
m_fileOpenRecent->setMaxItems(KateConfigDialog::recentFilesMaxCount());
actionCollection()->addAction(m_fileOpenRecent->objectName(), m_fileOpenRecent);
m_fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
......@@ -726,7 +726,7 @@ void KateMainWindow::showPluginConfigPage(KTextEditor::ConfigPageInterface *conf
}
if (dlg->exec() == QDialog::Accepted) {
m_fileOpenRecent->setMaxItems(KateConfigDialog::readRecentFilesMaxCount(KSharedConfig::openConfig()));
m_fileOpenRecent->setMaxItems(KateConfigDialog::recentFilesMaxCount());
}
delete dlg;
......
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