* only randomize parsing order of source files for multithreaded indexing * fixed overview not displayed when switching projects due to MessageScrollCode being dispatched * avoid adding duplicate TokenLocations that causes highlighting to break in QtCodeArea * clear all controllers when switching project * maximize unindexed file when clicking title instead of activating it
37 lines
505 B
C++
37 lines
505 B
C++
#ifndef CONTROLLER_H
|
|
#define CONTROLLER_H
|
|
|
|
#include "component/Component.h"
|
|
|
|
class Controller
|
|
{
|
|
public:
|
|
Controller();
|
|
virtual ~Controller();
|
|
|
|
void setComponent(Component* component);
|
|
|
|
virtual void clear() = 0;
|
|
|
|
protected:
|
|
template <typename ViewType>
|
|
ViewType* getView() const;
|
|
|
|
private:
|
|
Component* m_component;
|
|
};
|
|
|
|
|
|
template <typename ViewType>
|
|
ViewType* Controller::getView() const
|
|
{
|
|
if (m_component)
|
|
{
|
|
return m_component->getView<ViewType>();
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
#endif // CONTROLLER_H
|