Commit 52d433d3 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Don't raise Projects tool view upon document activation

When Locate Current Document action is checked, opening a document or
switching between open documents shows Projects tool view if it is
hidden. This sudden tool view appearance is very annoying and forces me
to keep the Locate Current Document action disabled by carefully
double-clicking on it each time I look for the current document in the
project tree. In this way 667a9ac4 made
locating the current document less convenient.

With this fix, one can reasonably compare the convenience of keeping the
Locate Current Document action checked versus unchecked.
parent 72b925d1
......@@ -235,14 +235,18 @@ void ProjectManagerView::toggleSyncCurrentDocument(bool sync)
KConfigGroup pmviewConfig(ICore::self()->activeSession()->config(), sessionConfigGroup);
pmviewConfig.writeEntry<bool>(syncCurrentDocumentKey, sync);
if (sync) {
locateCurrentDocument();
raiseAndLocateCurrentDocument();
}
}
void ProjectManagerView::locateCurrentDocument()
void ProjectManagerView::raiseAndLocateCurrentDocument()
{
ICore::self()->uiController()->raiseToolView(this);
locateCurrentDocument();
}
void ProjectManagerView::locateCurrentDocument()
{
KDevelop::IDocument *doc = ICore::self()->documentController()->activeDocument();
if (!doc) {
......
......@@ -60,13 +60,14 @@ protected:
private Q_SLOTS:
void selectionChanged();
void locateCurrentDocument();
void raiseAndLocateCurrentDocument();
void updateSyncAction();
void open( const KDevelop::Path& );
void toggleHideTargets(bool hidden);
void toggleSyncCurrentDocument(bool sync);
private:
void locateCurrentDocument();
QModelIndex indexFromView(const QModelIndex& index) const;
QModelIndex indexToView(const QModelIndex& index) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment