Changeset View
Changeset View
Standalone View
Standalone View
utils/okteta/kastentoolviewwidget.cpp
Show All 19 Lines | 1 | /* | |||
---|---|---|---|---|---|
20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #include "kastentoolviewwidget.h" | 23 | #include "kastentoolviewwidget.h" | ||
24 | 24 | | |||
25 | // plugin | 25 | // plugin | ||
26 | #include "oktetaview.h" | 26 | #include "oktetaview.h" | ||
27 | // Okteta Kasten | 27 | // Okteta Kasten | ||
28 | #include <bytearrayview.h> | 28 | #include "kasten/okteta/bytearrayview.h" | ||
kossebau: If you prefer, CamelCase includes should now be possible for all classes, so e.g. here
```… | |||||
I don't want to fix this. Maybe it would be prettier, but the required work is not worth it. apuzio: I don't want to fix this. Maybe it would be prettier, but the required work is not worth it. | |||||
29 | // Kasten | 29 | // Kasten | ||
30 | #if KASTEN_VERSION == 2 | | |||
31 | #include <Kasten2/AbstractToolView> | | |||
32 | #include <Kasten2/AbstractTool> | | |||
33 | #elif KASTEN_VERSION == 1 | | |||
34 | #include <Kasten1/AbstractToolView> | | |||
35 | #include <Kasten1/AbstractTool> | | |||
36 | #else | | |||
37 | #include <Kasten/AbstractToolView> | 30 | #include <Kasten/AbstractToolView> | ||
38 | #include <Kasten/AbstractTool> | 31 | #include <Kasten/AbstractTool> | ||
39 | #endif | | |||
40 | // KDev | 32 | // KDev | ||
41 | #include <interfaces/icore.h> | 33 | #include <interfaces/icore.h> | ||
42 | #include <interfaces/iuicontroller.h> | 34 | #include <interfaces/iuicontroller.h> | ||
43 | #include <sublime/mainwindow.h> | 35 | #include <sublime/mainwindow.h> | ||
44 | #include <sublime/controller.h> | 36 | #include <sublime/controller.h> | ||
45 | // Qt | 37 | // Qt | ||
46 | #include <QVBoxLayout> | 38 | #include <QVBoxLayout> | ||
47 | 39 | | |||
48 | namespace KDevelop | 40 | namespace KDevelop | ||
49 | { | 41 | { | ||
50 | 42 | | |||
51 | // TODO: find if hiddden, than unset target model | 43 | // TODO: find if hiddden, than unset target model | ||
52 | KastenToolViewWidget::KastenToolViewWidget( Kasten::AbstractToolView* toolView, QWidget* parent ) | 44 | KastenToolViewWidget::KastenToolViewWidget( Kasten::AbstractToolView* toolView, QWidget* parent ) | ||
53 | : QWidget( parent ), | 45 | : QWidget( parent ), | ||
54 | mToolView( toolView ) | 46 | mToolView( toolView ) | ||
55 | { | 47 | { | ||
56 | Sublime::Controller* controller = ICore::self()->uiController()->controller(); | 48 | Sublime::Controller* controller = ICore::self()->uiController()->controller(); | ||
57 | connect( controller, SIGNAL(mainWindowAdded(Sublime::MainWindow*)), | 49 | connect( controller, &Sublime::Controller::mainWindowAdded, | ||
58 | SLOT(onMainWindowAdded(Sublime::MainWindow*)) ); | 50 | this, &KastenToolViewWidget::onMainWindowAdded ); | ||
59 | const QList<Sublime::MainWindow*>& mainWindows = controller->mainWindows(); | 51 | const QList<Sublime::MainWindow*>& mainWindows = controller->mainWindows(); | ||
60 | foreach( Sublime::MainWindow* mainWindow, mainWindows ) | 52 | foreach( Sublime::MainWindow* mainWindow, mainWindows ) | ||
61 | onMainWindowAdded( mainWindow ); | 53 | onMainWindowAdded( mainWindow ); | ||
62 | 54 | | |||
63 | QVBoxLayout* layout = new QVBoxLayout( this ); | 55 | QVBoxLayout* layout = new QVBoxLayout( this ); | ||
64 | layout->setMargin( 0 ); | 56 | layout->setMargin( 0 ); | ||
65 | layout->addWidget( mToolView->widget() ); | 57 | layout->addWidget( mToolView->widget() ); | ||
66 | } | 58 | } | ||
67 | 59 | | |||
68 | void KastenToolViewWidget::onMainWindowAdded( Sublime::MainWindow* mainWindow ) | 60 | void KastenToolViewWidget::onMainWindowAdded( Sublime::MainWindow* mainWindow ) | ||
69 | { | 61 | { | ||
70 | connect( mainWindow, SIGNAL(activeViewChanged(Sublime::View*)), | 62 | connect( mainWindow, &Sublime::MainWindow::activeViewChanged, | ||
71 | SLOT(onActiveViewChanged(Sublime::View*)) ); | 63 | this, &KastenToolViewWidget::onActiveViewChanged ); | ||
72 | onActiveViewChanged( mainWindow->activeView() ); | 64 | onActiveViewChanged( mainWindow->activeView() ); | ||
73 | } | 65 | } | ||
74 | 66 | | |||
75 | void KastenToolViewWidget::onActiveViewChanged( Sublime::View* view ) | 67 | void KastenToolViewWidget::onActiveViewChanged( Sublime::View* view ) | ||
76 | { | 68 | { | ||
77 | // TODO: check if own mainWindow | 69 | // TODO: check if own mainWindow | ||
78 | OktetaView* oktetaView = qobject_cast<OktetaView*>( view ); | 70 | OktetaView* oktetaView = qobject_cast<OktetaView*>( view ); | ||
79 | Kasten::ByteArrayView* byteArrayView = oktetaView ? oktetaView->byteArrayView() : 0; | 71 | Kasten::ByteArrayView* byteArrayView = oktetaView ? oktetaView->byteArrayView() : 0; | ||
Show All 11 Lines |
If you prefer, CamelCase includes should now be possible for all classes, so e.g. here
and similar for all other includes.
But plain header includes like you kept using for now work of course as well. Just in case you preferred them, for consistency :)