forked from qt-creator/qt-creator
Add "Add Library" action to project explorer's context menu
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com> Task-number: QTCREATORBUG-4127
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "profileeditorfactory.h"
|
||||
#include "addlibrarywizard.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -244,26 +243,6 @@ void ProFileEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
highlighter->rehighlight();
|
||||
}
|
||||
|
||||
void ProFileEditorWidget::addLibrary()
|
||||
{
|
||||
AddLibraryWizard wizard(file()->fileName(), this);
|
||||
if (wizard.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
TextEditor::BaseTextEditor *editable = editor();
|
||||
const int endOfDoc = editable->position(TextEditor::ITextEditor::EndOfDoc);
|
||||
editable->setCursorPosition(endOfDoc);
|
||||
QString snippet = wizard.snippet();
|
||||
|
||||
// add extra \n in case the last line is not empty
|
||||
int line, column;
|
||||
editable->convertPosition(endOfDoc, &line, &column);
|
||||
if (!editable->textAt(endOfDoc - column, column).simplified().isEmpty())
|
||||
snippet = QLatin1Char('\n') + snippet;
|
||||
|
||||
editable->insert(snippet);
|
||||
}
|
||||
|
||||
void ProFileEditorWidget::jumpToFile()
|
||||
{
|
||||
openLink(findLinkAt(textCursor()));
|
||||
|
||||
Reference in New Issue
Block a user