Commit a3e63345 authored by Pino Toscano's avatar Pino Toscano
Browse files

scripting: properly enable line numbers

use the KTextEditor ConfigInterface to enable the line numbers, instead
of trying to trigger the action for it
parent 51033a10
......@@ -31,6 +31,7 @@
#include <KIconEngine>
#include <KHelpClient>
#include <KTextEditor/ConfigInterface>
#include <KTextEditor/Document>
#include <KTextEditor/Editor>
#include <KTextEditor/View>
......@@ -104,10 +105,10 @@ NewScriptWizard::NewScriptWizard( QWidget* parent, ScriptModeBase* mode, KIconLo
lay2->addWidget( docview );
// displaying the left border with line numbers
QAction *a = docview->actionCollection()->action( QStringLiteral("view_line_numbers") );
if ( a )
KTextEditor::ConfigInterface* cfgiface = qobject_cast<KTextEditor::ConfigInterface*>( docview );
if ( cfgiface )
{
a->trigger();
cfgiface->setConfigValue( QStringLiteral( "line-numbers" ), true );
}
// creating the popup menu
......
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