File indexing completed on 2024-04-28 04:37:24
0001 /* 0002 SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "selectioncontroller.h" 0008 0009 #include <interfaces/context.h> 0010 0011 namespace KDevelop 0012 { 0013 0014 class SelectionControllerPrivate 0015 { 0016 public: 0017 QScopedPointer<Context> currentSelection; 0018 }; 0019 0020 SelectionController::SelectionController( QObject* o ) 0021 : ISelectionController(o) 0022 , d_ptr(new SelectionControllerPrivate) 0023 { 0024 } 0025 0026 SelectionController::~SelectionController() = default; 0027 0028 Context* SelectionController::currentSelection() 0029 { 0030 Q_D(SelectionController); 0031 0032 return d->currentSelection.data(); 0033 } 0034 0035 void SelectionController::updateSelection( Context* ctx ) 0036 { 0037 Q_D(SelectionController); 0038 0039 d->currentSelection.reset(ctx); 0040 emit selectionChanged(d->currentSelection.data()); 0041 } 0042 0043 void SelectionController::initialize() 0044 { 0045 } 0046 0047 void SelectionController::cleanup() 0048 { 0049 } 0050 0051 } 0052 0053 #include "moc_selectioncontroller.cpp"