Changeset View
Changeset View
Standalone View
Standalone View
addons/xmlcheck/plugin_katexmlcheck.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 116 | { | |||
---|---|---|---|---|---|
117 | KXMLGUIClient::setComponentName(QLatin1String("katexmlcheck"), i18n ("Kate XML check")); // where i18n resources? | 117 | KXMLGUIClient::setComponentName(QLatin1String("katexmlcheck"), i18n ("Kate XML check")); // where i18n resources? | ||
118 | setXMLFile(QLatin1String("ui.rc")); | 118 | setXMLFile(QLatin1String("ui.rc")); | ||
119 | 119 | | |||
120 | dock = m_mainWindow->createToolView(plugin, "kate_plugin_xmlcheck_ouputview", KTextEditor::MainWindow::Bottom, QIcon::fromTheme("misc"), i18n("XML Checker Output")); | 120 | dock = m_mainWindow->createToolView(plugin, "kate_plugin_xmlcheck_ouputview", KTextEditor::MainWindow::Bottom, QIcon::fromTheme("misc"), i18n("XML Checker Output")); | ||
121 | listview = new QTreeWidget( dock ); | 121 | listview = new QTreeWidget( dock ); | ||
122 | m_tmp_file=nullptr; | 122 | m_tmp_file=nullptr; | ||
123 | QAction *a = actionCollection()->addAction("xml_check"); | 123 | QAction *a = actionCollection()->addAction("xml_check"); | ||
124 | a->setText(i18n("Validate XML")); | 124 | a->setText(i18n("Validate XML")); | ||
125 | connect(a, SIGNAL(triggered()), this, SLOT(slotValidate())); | 125 | connect(a, &QAction::triggered, this, &PluginKateXMLCheckView::slotValidate); | ||
126 | // TODO?: | 126 | // TODO?: | ||
127 | //(void) new KAction ( i18n("Indent XML"), KShortcut(), this, | 127 | //(void) new KAction ( i18n("Indent XML"), KShortcut(), this, | ||
128 | // SLOT(slotIndent()), actionCollection(), "xml_indent" ); | 128 | // SLOT(slotIndent()), actionCollection(), "xml_indent" ); | ||
129 | 129 | | |||
130 | listview->setFocusPolicy(Qt::NoFocus); | 130 | listview->setFocusPolicy(Qt::NoFocus); | ||
131 | QStringList headers; | 131 | QStringList headers; | ||
132 | headers << i18n("#"); | 132 | headers << i18n("#"); | ||
133 | headers << i18n("Line"); | 133 | headers << i18n("Line"); | ||
134 | headers << i18n("Column"); | 134 | headers << i18n("Column"); | ||
135 | headers << i18n("Message"); | 135 | headers << i18n("Message"); | ||
136 | listview->setHeaderLabels(headers); | 136 | listview->setHeaderLabels(headers); | ||
137 | listview->setRootIsDecorated(false); | 137 | listview->setRootIsDecorated(false); | ||
138 | connect(listview, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(slotClicked(QTreeWidgetItem*,int))); | 138 | connect(listview, &QTreeWidget::itemClicked, this, &PluginKateXMLCheckView::slotClicked); | ||
139 | 139 | | |||
140 | QHeaderView *header = listview->header(); | 140 | QHeaderView *header = listview->header(); | ||
141 | header->setSectionResizeMode(0, QHeaderView::ResizeToContents); | 141 | header->setSectionResizeMode(0, QHeaderView::ResizeToContents); | ||
142 | header->setSectionResizeMode(1, QHeaderView::ResizeToContents); | 142 | header->setSectionResizeMode(1, QHeaderView::ResizeToContents); | ||
143 | header->setSectionResizeMode(2, QHeaderView::ResizeToContents); | 143 | header->setSectionResizeMode(2, QHeaderView::ResizeToContents); | ||
144 | 144 | | |||
145 | /* TODO?: invalidate the listview when document has changed | 145 | /* TODO?: invalidate the listview when document has changed | ||
146 | Kate::View *kv = application()->activeMainWindow()->activeView(); | 146 | Kate::View *kv = application()->activeMainWindow()->activeView(); | ||
147 | if( ! kv ) { | 147 | if( ! kv ) { | ||
148 | qDebug() << "Warning: no Kate::View"; | 148 | qDebug() << "Warning: no Kate::View"; | ||
149 | return; | 149 | return; | ||
150 | } | 150 | } | ||
151 | connect(kv, SIGNAL(modifiedChanged()), this, SLOT(slotUpdate())); | 151 | connect(kv, SIGNAL(modifiedChanged()), this, SLOT(slotUpdate())); | ||
152 | */ | 152 | */ | ||
153 | 153 | | |||
154 | connect(&m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotProcExited(int,QProcess::ExitStatus))); | 154 | connect(&m_proc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &PluginKateXMLCheckView::slotProcExited); | ||
155 | // we currently only want errors: | 155 | // we currently only want errors: | ||
156 | m_proc.setProcessChannelMode(QProcess::SeparateChannels); | 156 | m_proc.setProcessChannelMode(QProcess::SeparateChannels); | ||
157 | // m_proc.setProcessChannelMode(QProcess::ForwardedChannels); // For Debugging. Do not use this. | 157 | // m_proc.setProcessChannelMode(QProcess::ForwardedChannels); // For Debugging. Do not use this. | ||
158 | mainwin->guiFactory()->addClient(this); | 158 | mainwin->guiFactory()->addClient(this); | ||
159 | } | 159 | } | ||
160 | 160 | | |||
161 | PluginKateXMLCheckView::~PluginKateXMLCheckView() | 161 | PluginKateXMLCheckView::~PluginKateXMLCheckView() | ||
162 | { | 162 | { | ||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |