summaryrefslogtreecommitdiffstats
path: root/sigmodr/ScriptWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmodr/ScriptWidget.cpp')
-rw-r--r--sigmodr/ScriptWidget.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/sigmodr/ScriptWidget.cpp b/sigmodr/ScriptWidget.cpp
index d3df997c..75857d98 100644
--- a/sigmodr/ScriptWidget.cpp
+++ b/sigmodr/ScriptWidget.cpp
@@ -47,7 +47,7 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigmod::Script& value
languages["PHP"] = "php";
languages["Python"] = "python";
languages["Ruby"] = "ruby";
- QList<QString> langs = languages.keys();
+ QStringList langs = languages.keys();
foreach (const QString& language, langs)
varInterpreter->addItem(language, languages[language]);
if (!m_editor)
@@ -55,9 +55,9 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigmod::Script& value
KMessageBox::error(this, "A KDE text-editor component could not be found;\nplease check your KDE installation.");
KApplication::kApplication()->exit(1);
}
- m_editor->readConfig(NULL);
- m_document = m_editor->createDocument(NULL);
- m_view = m_document->createView(NULL);
+ m_editor->readConfig();
+ m_document = m_editor->createDocument(this);
+ m_view = m_document->createView(this);
KActionCollection* collection = m_view->actionCollection();
collection->action("file_save")->setVisible(false);
collection->action("file_save")->setEnabled(false);
@@ -75,7 +75,7 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigmod::Script& value
KXmlGuiWindow* topLevel = qobject_cast<KXmlGuiWindow*>(KApplication::kApplication()->activeWindow());
if (topLevel)
{
- QMenu *menu = qobject_cast<KMenu*>(topLevel->factory()->container("ktexteditor_popup", topLevel));
+ KMenu *menu = qobject_cast<KMenu*>(topLevel->factory()->container("ktexteditor_popup", topLevel));
if (menu)
m_view->setContextMenu(menu);
}
@@ -90,7 +90,6 @@ Sigmodr::ScriptWidget::ScriptWidget(QWidget* parent, const Sigmod::Script& value
Sigmodr::ScriptWidget::~ScriptWidget()
{
m_editor->writeConfig(NULL);
-// delete m_document;
}
Sigmod::Script Sigmodr::ScriptWidget::value() const
@@ -109,10 +108,11 @@ void Sigmodr::ScriptWidget::setGui()
void Sigmodr::ScriptWidget::setValue(const Sigmod::Script& value)
{
- if (m_value == value)
- return;
- m_value = value;
- emit(valueChanged(m_value));
+ if (m_value != value)
+ {
+ m_value = value;
+ emit(valueChanged(m_value));
+ }
}
void Sigmodr::ScriptWidget::on_varInterpreter_activated()
@@ -143,6 +143,6 @@ void Sigmodr::ScriptWidget::unfocused(KTextEditor::View* view)
KXmlGuiWindow* topLevel = qobject_cast<KXmlGuiWindow*>(KApplication::kApplication()->activeWindow());
QWidget* focused = KApplication::focusWidget();
// FIXME: Does this fail with non-Kate KTextEditor implementations?
- if (topLevel && focused && ((focused->metaObject()->className() != QString("KateViewInternal")) || ((QString(focused->metaObject()->className()) == view->metaObject()->className()) && (focused != view))))
+ if (topLevel && focused && ((focused->metaObject()->className() != QString("KateViewInternal")) || ((focused != view) && (QString(focused->metaObject()->className()) == view->metaObject()->className()))))
topLevel->guiFactory()->removeClient(view);
}