Changeset View
Changeset View
Standalone View
Standalone View
addons/backtracebrowser/katebacktracebrowser.cpp
Show All 35 Lines | |||||
36 | #include <QFileInfo> | 36 | #include <QFileInfo> | ||
37 | #include <QFileDialog> | 37 | #include <QFileDialog> | ||
38 | #include <QDataStream> | 38 | #include <QDataStream> | ||
39 | #include <QStandardPaths> | 39 | #include <QStandardPaths> | ||
40 | #include <QTimer> | 40 | #include <QTimer> | ||
41 | #include <QClipboard> | 41 | #include <QClipboard> | ||
42 | #include <QDialogButtonBox> | 42 | #include <QDialogButtonBox> | ||
43 | #include <QUrl> | 43 | #include <QUrl> | ||
44 | #include <QTreeWidget> | ||||
44 | //END Includes | 45 | //END Includes | ||
45 | 46 | | |||
46 | K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();) | 47 | K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();) | ||
47 | 48 | | |||
48 | KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = nullptr; | 49 | KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = nullptr; | ||
49 | static QStringList fileExtensions = | 50 | static QStringList fileExtensions = | ||
50 | QStringList() << QStringLiteral("*.cpp") << QStringLiteral("*.cxx") << | 51 | QStringList() << QStringLiteral("*.cpp") << QStringLiteral("*.cxx") << | ||
51 | QStringLiteral("*.c") << QStringLiteral("*.cc") << QStringLiteral("*.h") << | 52 | QStringLiteral("*.c") << QStringLiteral("*.cc") << QStringLiteral("*.h") << | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 133 | { | |||
133 | // init console | 134 | // init console | ||
134 | QWidget *toolview = mainWindow->createToolView(plugin, | 135 | QWidget *toolview = mainWindow->createToolView(plugin, | ||
135 | QStringLiteral("kate_private_plugin_katebacktracebrowserplugin"), | 136 | QStringLiteral("kate_private_plugin_katebacktracebrowserplugin"), | ||
136 | KTextEditor::MainWindow::Bottom, | 137 | KTextEditor::MainWindow::Bottom, | ||
137 | QIcon::fromTheme(QStringLiteral("kbugbuster")), | 138 | QIcon::fromTheme(QStringLiteral("kbugbuster")), | ||
138 | i18n("Backtrace Browser")); | 139 | i18n("Backtrace Browser")); | ||
139 | m_widget = new KateBtBrowserWidget(mainWindow, toolview); | 140 | m_widget = new KateBtBrowserWidget(mainWindow, toolview); | ||
140 | 141 | | |||
141 | connect(plugin, SIGNAL(newStatus(QString)), | 142 | connect(plugin, &KateBtBrowserPlugin::newStatus, m_widget, &KateBtBrowserWidget::setStatus); | ||
142 | m_widget, SLOT(setStatus(QString))); | | |||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | KateBtBrowserPluginView::~KateBtBrowserPluginView() | 145 | KateBtBrowserPluginView::~KateBtBrowserPluginView() | ||
146 | { | 146 | { | ||
147 | // cleanup, kill toolview + widget | 147 | // cleanup, kill toolview + widget | ||
148 | QWidget *toolview = m_widget->parentWidget(); | 148 | QWidget *toolview = m_widget->parentWidget(); | ||
149 | delete m_widget; | 149 | delete m_widget; | ||
150 | delete toolview; | 150 | delete toolview; | ||
151 | } | 151 | } | ||
152 | 152 | | |||
153 | 153 | | |||
154 | 154 | | |||
155 | 155 | | |||
156 | 156 | | |||
157 | 157 | | |||
158 | KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget *parent) | 158 | KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget *parent) | ||
159 | : QWidget(parent) | 159 | : QWidget(parent) | ||
160 | , mw(mainwindow) | 160 | , mw(mainwindow) | ||
161 | { | 161 | { | ||
162 | setupUi(this); | 162 | setupUi(this); | ||
163 | 163 | | |||
164 | timer.setSingleShot(true); | 164 | timer.setSingleShot(true); | ||
165 | connect(&timer, SIGNAL(timeout()), this, SLOT(clearStatus())); | 165 | connect(&timer, &QTimer::timeout, this, &KateBtBrowserWidget::clearStatus); | ||
166 | 166 | connect(btnBacktrace, &QPushButton::clicked, this, &KateBtBrowserWidget::loadFile); | |||
167 | connect(btnBacktrace, SIGNAL(clicked()), this, SLOT(loadFile())); | 167 | connect(btnClipboard, &QPushButton::clicked, this, &KateBtBrowserWidget::loadClipboard); | ||
168 | connect(btnClipboard, SIGNAL(clicked()), this, SLOT(loadClipboard())); | 168 | connect(btnConfigure, &QPushButton::clicked, this, &KateBtBrowserWidget::configure); | ||
169 | connect(btnConfigure, SIGNAL(clicked()), this, SLOT(configure())); | 169 | connect(lstBacktrace, &QTreeWidget::itemActivated, this, &KateBtBrowserWidget::itemActivated); | ||
170 | connect(lstBacktrace, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(itemActivated(QTreeWidgetItem *, int))); | | |||
171 | } | 170 | } | ||
172 | 171 | | |||
173 | KateBtBrowserWidget::~KateBtBrowserWidget() | 172 | KateBtBrowserWidget::~KateBtBrowserWidget() | ||
174 | { | 173 | { | ||
175 | } | 174 | } | ||
176 | 175 | | |||
177 | void KateBtBrowserWidget::loadFile() | 176 | void KateBtBrowserWidget::loadFile() | ||
178 | { | 177 | { | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 290 | KateBtConfigWidget::KateBtConfigWidget(QWidget *parent) | |||
292 | : KTextEditor::ConfigPage(parent) | 291 | : KTextEditor::ConfigPage(parent) | ||
293 | { | 292 | { | ||
294 | setupUi(this); | 293 | setupUi(this); | ||
295 | edtUrl->setMode(KFile::Directory); | 294 | edtUrl->setMode(KFile::Directory); | ||
296 | edtUrl->setUrl(QUrl(QDir().absolutePath())); | 295 | edtUrl->setUrl(QUrl(QDir().absolutePath())); | ||
297 | 296 | | |||
298 | reset(); | 297 | reset(); | ||
299 | 298 | | |||
300 | connect(btnAdd, SIGNAL(clicked()), this, SLOT(add())); | 299 | connect(btnAdd, &QPushButton::clicked, this, &KateBtConfigWidget::add); | ||
301 | connect(btnRemove, SIGNAL(clicked()), this, SLOT(remove())); | 300 | connect(btnRemove, &QPushButton::clicked, this, &KateBtConfigWidget::remove); | ||
302 | connect(edtExtensions, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); | 301 | connect(edtExtensions, &QLineEdit::textChanged, this, &KateBtConfigWidget::textChanged); | ||
303 | 302 | | |||
304 | m_changed = false; | 303 | m_changed = false; | ||
305 | } | 304 | } | ||
306 | 305 | | |||
307 | KateBtConfigWidget::~KateBtConfigWidget() | 306 | KateBtConfigWidget::~KateBtConfigWidget() | ||
308 | { | 307 | { | ||
309 | } | 308 | } | ||
310 | 309 | | |||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 393 | { | |||
400 | QVBoxLayout *layout = new QVBoxLayout(this); | 399 | QVBoxLayout *layout = new QVBoxLayout(this); | ||
401 | 400 | | |||
402 | QDialogButtonBox *box = new QDialogButtonBox(this); | 401 | QDialogButtonBox *box = new QDialogButtonBox(this); | ||
403 | box->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); | 402 | box->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); | ||
404 | 403 | | |||
405 | layout->addWidget(m_configWidget); | 404 | layout->addWidget(m_configWidget); | ||
406 | layout->addWidget(box); | 405 | layout->addWidget(box); | ||
407 | 406 | | |||
408 | connect(this, SIGNAL(accepted()), m_configWidget, SLOT(apply())); | 407 | connect(this, &KateBtConfigDialog::accepted, m_configWidget, &KateBtConfigWidget::apply); | ||
409 | connect(box, SIGNAL(accepted()), this, SLOT(accept())); | 408 | connect(box, &QDialogButtonBox::accepted, this, &KateBtConfigDialog::accept); | ||
410 | connect(box, SIGNAL(rejected()), this, SLOT(reject())); | 409 | connect(box, &QDialogButtonBox::rejected, this, &KateBtConfigDialog::reject); | ||
411 | } | 410 | } | ||
412 | 411 | | |||
413 | KateBtConfigDialog::~KateBtConfigDialog() | 412 | KateBtConfigDialog::~KateBtConfigDialog() | ||
414 | { | 413 | { | ||
415 | } | 414 | } | ||
416 | 415 | | |||
417 | #include "katebacktracebrowser.moc" | 416 | #include "katebacktracebrowser.moc" | ||
418 | 417 | | |||
419 | // kate: space-indent on; indent-width 4; replace-tabs on; | 418 | // kate: space-indent on; indent-width 4; replace-tabs on; |