コード例 #1
0
Recorder::Recorder(KTextEditor::View *view, Manager *manager) : QObject(view), m_manager(manager), m_view(view)
{
	connect(m_manager, SIGNAL(watchedKeySequencesChanged()), this, SLOT(reloadWatchedKeySequences()));
	connect(this, SIGNAL(detectedTypedKeySequence(const QString&)), m_manager, SLOT(keySequenceTyped(const QString&)));
	KTextEditor::Cursor cursor = m_view->cursorPosition();
	m_oldLine = cursor.line();
	m_oldCol = cursor.column();

	reloadWatchedKeySequences();
}
コード例 #2
0
	void Manager::addActionMap(const QMap<QString, Action*>& map) {
		bool changed = false;
		for(QMap<QString, Action*>::const_iterator i = map.begin(); i != map.end(); ++i) {
			if(i.key().isEmpty()) {
				continue;
			}
			if(m_actionMap[i.key()] != i.data()) {
				m_actionMap[i.key()] = i.data();
				changed = true;
			}
		}
		if(changed) {
			emit watchedKeySequencesChanged();
		}
	}
コード例 #3
0
Recorder::Recorder(Kate::View *view, Manager *manager) : QObject(view), m_manager(manager), m_view(view) {
	connect(m_manager, SIGNAL(watchedKeySequencesChanged()), this, SLOT(reloadWatchedKeySequences()));
	connect(this, SIGNAL(detectedTypedKeySequence(const QString&)), m_manager, SLOT(keySequenceTyped(const QString&)));
	m_view->cursorPositionReal(&m_oldLine, &m_oldCol);
	reloadWatchedKeySequences();
}
コード例 #4
0
	void Manager::clear() {
		m_watchedKeySequencesList.clear();
		m_actionMap.clear();
		emit watchedKeySequencesChanged();
	}