aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-11-01 16:29:45 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-11-01 16:29:45 +0100
commit6063fb84c20e7c877558210f6492f67a7fd17214 (patch)
treeee5a901c7a4b59f9d9a43c69c9475a345e86db8b
parentbeaff08200db600a26dfdfc6107ef97e3c0e92fe (diff)
Fix exported headers in Core and TextEditor.
- Unexport Core::Internal::MainWindow and remove its includes. - Move RssFetcher from Core::Internal to Core. - Unexport CopyTaskHandler. - Move TextEditor's completion support and Refactor Overlay helper classes from TextEditor::Internal to TextEditor as they are exported. - Move internal BaseTextBlockSelection into private header. - Unexport TextEditorOverlay as they are not used.
-rw-r--r--src/plugins/coreplugin/fancyactionbar.cpp1
-rw-r--r--src/plugins/coreplugin/generalsettings.cpp2
-rw-r--r--src/plugins/coreplugin/mainwindow.h3
-rw-r--r--src/plugins/coreplugin/rssfetcher.cpp7
-rw-r--r--src/plugins/coreplugin/rssfetcher.h6
-rw-r--r--src/plugins/cppeditor/cppplugin.cpp4
-rw-r--r--src/plugins/fakevim/fakevimplugin.cpp2
-rw-r--r--src/plugins/projectexplorer/copytaskhandler.h4
-rw-r--r--src/plugins/projectexplorer/miniprojecttargetselector.cpp2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp2
-rw-r--r--src/plugins/projectexplorer/projectwelcomepagewidget.cpp1
-rw-r--r--src/plugins/projectexplorer/userfileaccessor.cpp2
-rw-r--r--src/plugins/qmljseditor/qmljseditor.cpp16
-rw-r--r--src/plugins/qmljseditor/qmljseditor.h2
-rw-r--r--src/plugins/qmljseditor/qmljseditorplugin.cpp4
-rw-r--r--src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp11
-rw-r--r--src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.h14
-rw-r--r--src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp2
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp4
-rw-r--r--src/plugins/texteditor/basetexteditor.h31
-rw-r--r--src/plugins/texteditor/basetexteditor_p.h21
-rw-r--r--src/plugins/texteditor/completionsupport.cpp124
-rw-r--r--src/plugins/texteditor/completionsupport.h16
-rw-r--r--src/plugins/texteditor/completionwidget.h2
-rw-r--r--src/plugins/texteditor/refactoroverlay.cpp42
-rw-r--r--src/plugins/texteditor/refactoroverlay.h39
-rw-r--r--src/plugins/texteditor/texteditoroverlay.cpp3
-rw-r--r--src/plugins/texteditor/texteditoroverlay.h36
-rw-r--r--src/plugins/welcome/communitywelcomepagewidget.cpp4
-rw-r--r--src/plugins/welcome/communitywelcomepagewidget.h6
30 files changed, 237 insertions, 176 deletions
diff --git a/src/plugins/coreplugin/fancyactionbar.cpp b/src/plugins/coreplugin/fancyactionbar.cpp
index 6b7bbe0789..9d3d1c3696 100644
--- a/src/plugins/coreplugin/fancyactionbar.cpp
+++ b/src/plugins/coreplugin/fancyactionbar.cpp
@@ -34,7 +34,6 @@
#include <coreplugin/icore.h>
#include <coreplugin/imode.h>
-#include <coreplugin/mainwindow.h>
#include <QtGui/QHBoxLayout>
#include <QtGui/QPainter>
diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp
index f311896286..7904199b8f 100644
--- a/src/plugins/coreplugin/generalsettings.cpp
+++ b/src/plugins/coreplugin/generalsettings.cpp
@@ -125,6 +125,8 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
m_page->setupUi(w);
QSettings* settings = Core::ICore::instance()->settings();
+ Q_UNUSED(settings) // Windows
+
fillLanguageBox();
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h
index bd1708607e..8f29d03a0e 100644
--- a/src/plugins/coreplugin/mainwindow.h
+++ b/src/plugins/coreplugin/mainwindow.h
@@ -30,7 +30,6 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include "core_global.h"
#include "icontext.h"
#include "icore.h"
#include "dialogs/iwizard.h"
@@ -81,7 +80,7 @@ class StatusBarManager;
class VersionDialog;
class SystemEditor;
-class CORE_EXPORT MainWindow : public EventFilteringMainWindow
+class MainWindow : public EventFilteringMainWindow
{
Q_OBJECT
diff --git a/src/plugins/coreplugin/rssfetcher.cpp b/src/plugins/coreplugin/rssfetcher.cpp
index 114c6df41a..dd9c013faa 100644
--- a/src/plugins/coreplugin/rssfetcher.cpp
+++ b/src/plugins/coreplugin/rssfetcher.cpp
@@ -34,6 +34,7 @@
#include <QtCore/QSysInfo>
#include <QtCore/QLocale>
#include <QtCore/QEventLoop>
+#include <QtCore/QUrl>
#include <QtGui/QDesktopServices>
#include <QtGui/QLineEdit>
#include <QtNetwork/QNetworkReply>
@@ -48,7 +49,7 @@
#include <sys/utsname.h>
#endif
-using namespace Core::Internal;
+namespace Core {
static const QString getOsString()
{
@@ -119,7 +120,7 @@ RssFetcher::RssFetcher(int maxItems)
: QThread(0), m_maxItems(maxItems), m_items(0),
m_requestCount(0), m_networkAccessManager(0)
{
- qRegisterMetaType<RssItem>("RssItem");
+ qRegisterMetaType<Core::RssItem>("Core::RssItem");
moveToThread(this);
}
@@ -241,3 +242,5 @@ void RssFetcher::parseXml(QIODevice *device)
qPrintable(item.title));
}
}
+
+} // namespace Core
diff --git a/src/plugins/coreplugin/rssfetcher.h b/src/plugins/coreplugin/rssfetcher.h
index 87d0936c99..623e437254 100644
--- a/src/plugins/coreplugin/rssfetcher.h
+++ b/src/plugins/coreplugin/rssfetcher.h
@@ -33,16 +33,15 @@
#include "core_global.h"
#include <QtCore/QThread>
-#include <QtCore/QUrl>
QT_BEGIN_NAMESPACE
+class QUrl;
class QNetworkReply;
class QNetworkAccessManager;
class QIODevice;
QT_END_NAMESPACE
namespace Core {
-namespace Internal {
class CORE_EXPORT RssItem
{
@@ -64,7 +63,7 @@ public:
signals:
void newsItemReady(const QString& title, const QString& desciption, const QString& url);
- void rssItemReady(const RssItem& item);
+ void rssItemReady(const Core::RssItem& item);
void finished(bool error);
public slots:
@@ -84,7 +83,6 @@ private:
QNetworkAccessManager* m_networkAccessManager;
};
-} // namespace Core
} // namespace Internal
#endif // RSSFETCHER_H
diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp
index 3d11283627..d5ab777477 100644
--- a/src/plugins/cppeditor/cppplugin.cpp
+++ b/src/plugins/cppeditor/cppplugin.cpp
@@ -173,7 +173,7 @@ void CppPlugin::initializeEditor(CPPEditor *editor)
// auto completion
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
- TextEditor::Internal::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
+ TextEditor::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
// quick fix
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
@@ -400,7 +400,7 @@ void CppPlugin::quickFixNow()
if (editor->isOutdated())
m_quickFixTimer->start(QUICKFIX_INTERVAL);
else
- TextEditor::Internal::CompletionSupport::instance()->quickFix(m_currentTextEditable);
+ TextEditor::CompletionSupport::instance()->quickFix(m_currentTextEditable);
}
}
}
diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp
index c30a9d01c4..481020581a 100644
--- a/src/plugins/fakevim/fakevimplugin.cpp
+++ b/src/plugins/fakevim/fakevimplugin.cpp
@@ -906,7 +906,7 @@ void FakeVimPluginPrivate::triggerCompletions()
if (!handler)
return;
if (BaseTextEditor *bt = qobject_cast<BaseTextEditor *>(handler->widget()))
- TextEditor::Internal::CompletionSupport::instance()->
+ TextEditor::CompletionSupport::instance()->
autoComplete(bt->editableInterface(), false);
// bt->triggerCompletions();
}
diff --git a/src/plugins/projectexplorer/copytaskhandler.h b/src/plugins/projectexplorer/copytaskhandler.h
index 27e6beb465..578bdcefa5 100644
--- a/src/plugins/projectexplorer/copytaskhandler.h
+++ b/src/plugins/projectexplorer/copytaskhandler.h
@@ -30,14 +30,12 @@
#ifndef PROJECTEXPLORER_COPYTASKHANDLER_H
#define PROJECTEXPLORER_COPYTASKHANDLER_H
-#include "projectexplorer_export.h"
-
#include "itaskhandler.h"
namespace ProjectExplorer {
namespace Internal {
-class PROJECTEXPLORER_EXPORT CopyTaskHandler : public ITaskHandler
+class CopyTaskHandler : public ITaskHandler
{
Q_OBJECT
diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
index 9af697a0d6..d07fc06698 100644
--- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp
+++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
@@ -37,7 +37,6 @@
#include <utils/stylehelper.h>
#include <coreplugin/icore.h>
-#include <coreplugin/mainwindow.h>
#include <coreplugin/coreconstants.h>
#include <projectexplorer/projectexplorer.h>
@@ -57,6 +56,7 @@
#include <QtGui/QPainter>
#include <QtGui/QAction>
#include <QtGui/QItemDelegate>
+#include <QtGui/QMainWindow>
#include <QtGui/QApplication>
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 983cd10f03..5b52195219 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -81,7 +81,6 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/filemanager.h>
#include <coreplugin/icore.h>
-#include <coreplugin/mainwindow.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -112,6 +111,7 @@
#include <QtGui/QFileDialog>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
+#include <QtGui/QMainWindow>
Q_DECLARE_METATYPE(Core::IEditorFactory*);
Q_DECLARE_METATYPE(Core::IExternalEditor*);
diff --git a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp
index 22cfd95d2b..8530ec3609 100644
--- a/src/plugins/projectexplorer/projectwelcomepagewidget.cpp
+++ b/src/plugins/projectexplorer/projectwelcomepagewidget.cpp
@@ -36,7 +36,6 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/dialogs/iwizard.h>
-#include <coreplugin/mainwindow.h>
#include <coreplugin/filemanager.h>
#include <utils/stringutils.h>
diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp
index bee5edfc74..625e80e1d6 100644
--- a/src/plugins/projectexplorer/userfileaccessor.cpp
+++ b/src/plugins/projectexplorer/userfileaccessor.cpp
@@ -39,11 +39,11 @@
#include "toolchaintype.h"
#include <coreplugin/icore.h>
-#include <coreplugin/mainwindow.h>
#include <coreplugin/ifile.h>
#include <utils/qtcassert.h>
#include <QtGui/QApplication>
+#include <QtGui/QMainWindow>
#include <QtCore/QFile>
#include <QtGui/QMessageBox>
#include <QtNetwork/QHostInfo>
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index c621d81010..54cf860b63 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -751,8 +751,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
connect(m_semanticHighlighter, SIGNAL(changed(QmlJSEditor::Internal::SemanticInfo)),
this, SLOT(updateSemanticInfo(QmlJSEditor::Internal::SemanticInfo)));
- connect(this, SIGNAL(refactorMarkerClicked(TextEditor::Internal::RefactorMarker)),
- SLOT(onRefactorMarkerClicked(TextEditor::Internal::RefactorMarker)));
+ connect(this, SIGNAL(refactorMarkerClicked(TextEditor::RefactorMarker)),
+ SLOT(onRefactorMarkerClicked(TextEditor::RefactorMarker)));
setRequestMarkEnabled(true);
}
@@ -986,21 +986,21 @@ void QmlJSTextEditor::updateCursorPositionNow()
m_contextPane->apply(editableInterface(), semanticInfo().document, LookupContext::Ptr(),newNode, false);
if (m_contextPane->isAvailable(editableInterface(), semanticInfo().document, newNode) &&
!m_contextPane->widget()->isVisible()) {
- QList<TextEditor::Internal::RefactorMarker> markers;
+ QList<TextEditor::RefactorMarker> markers;
if (UiObjectMember *m = newNode->uiObjectMemberCast()) {
const int start = qualifiedTypeNameId(m)->identifierToken.begin();
for (UiQualifiedId *q = qualifiedTypeNameId(m); q; q = q->next) {
if (! q->next) {
const int end = q->identifierToken.end();
if (position() >= start && position() <= end) {
- TextEditor::Internal::RefactorMarker marker;
+ TextEditor::RefactorMarker marker;
QTextCursor tc(document());
tc.setPosition(end);
marker.cursor = tc;
marker.tooltip = tr("Show Qt Quick ToolBar");
markers.append(marker);
} else {
- QList<TextEditor::Internal::RefactorMarker> markers;
+ QList<TextEditor::RefactorMarker> markers;
setRefactorMarkers(markers);
}
}
@@ -1008,7 +1008,7 @@ void QmlJSTextEditor::updateCursorPositionNow()
}
setRefactorMarkers(markers);
} else if (oldNode != newNode) {
- QList<TextEditor::Internal::RefactorMarker> markers;
+ QList<TextEditor::RefactorMarker> markers;
setRefactorMarkers(markers);
}
m_oldCursorPosition = position();
@@ -1456,7 +1456,7 @@ void QmlJSTextEditor::showContextPane()
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
m_contextPane->apply(editableInterface(), m_semanticInfo.document, m_semanticInfo.lookupContext(), newNode, false, true);
m_oldCursorPosition = position();
- QList<TextEditor::Internal::RefactorMarker> markers;
+ QList<TextEditor::RefactorMarker> markers;
setRefactorMarkers(markers);
}
}
@@ -1814,7 +1814,7 @@ void QmlJSTextEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
setExtraSelections(CodeWarningsSelection, selections);
}
-void QmlJSTextEditor::onRefactorMarkerClicked(const TextEditor::Internal::RefactorMarker &)
+void QmlJSTextEditor::onRefactorMarkerClicked(const TextEditor::RefactorMarker &)
{
showContextPane();
}
diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h
index e0082c371d..4c625cf60c 100644
--- a/src/plugins/qmljseditor/qmljseditor.h
+++ b/src/plugins/qmljseditor/qmljseditor.h
@@ -278,7 +278,7 @@ private slots:
void forceSemanticRehighlight();
void updateSemanticInfo(const QmlJSEditor::Internal::SemanticInfo &semanticInfo);
void onCursorPositionChanged();
- void onRefactorMarkerClicked(const TextEditor::Internal::RefactorMarker &marker);
+ void onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker);
void performQuickFix(int index);
diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp
index 6268ee4973..0b1cc3f39a 100644
--- a/src/plugins/qmljseditor/qmljseditorplugin.cpp
+++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp
@@ -257,7 +257,7 @@ void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::Internal::QmlJSTextEditor
// auto completion
connect(editor, SIGNAL(requestAutoCompletion(TextEditor::ITextEditable*, bool)),
- TextEditor::Internal::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
+ TextEditor::CompletionSupport::instance(), SLOT(autoComplete(TextEditor::ITextEditable*, bool)));
// quick fix
connect(editor, SIGNAL(requestQuickFix(TextEditor::ITextEditable*)),
@@ -323,7 +323,7 @@ void QmlJSEditorPlugin::quickFixNow()
// ### FIXME: m_quickFixTimer->start(QUICKFIX_INTERVAL);
m_quickFixTimer->stop();
} else {
- TextEditor::Internal::CompletionSupport::instance()->quickFix(m_currentTextEditable);
+ TextEditor::CompletionSupport::instance()->quickFix(m_currentTextEditable);
}
}
}
diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
index c7b7c7a127..d4a27a5147 100644
--- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
+++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
@@ -34,7 +34,6 @@
#include <coreplugin/helpmanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
-#include <coreplugin/mainwindow.h>
#include <coreplugin/rssfetcher.h>
#include <projectexplorer/projectexplorer.h>
@@ -60,8 +59,6 @@
#include <QtGui/QMenu>
#include <QtGui/QDesktopServices>
-using namespace Core::Internal;
-
namespace Qt4ProjectManager {
namespace Internal {
@@ -119,8 +116,8 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
ui->openProjectButton->setIcon(
QIcon::fromTheme(QLatin1String("document-open"), ui->openProjectButton->icon()));
- m_rssFetcher = new RssFetcher;
- connect (m_rssFetcher, SIGNAL(rssItemReady(const RssItem&)), SLOT(addToFeatures(const RssItem&)));
+ m_rssFetcher = new Core::RssFetcher;
+ connect (m_rssFetcher, SIGNAL(rssItemReady(Core::RssItem)), SLOT(addToFeatures(Core::RssItem)));
connect (m_rssFetcher, SIGNAL(finished(bool)), SLOT(showFeature()), Qt::QueuedConnection);
connect(this, SIGNAL(startRssFetching(QUrl)), m_rssFetcher, SLOT(fetch(QUrl)), Qt::QueuedConnection);
m_rssFetcher->start(QThread::LowestPriority);
@@ -486,7 +483,7 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
return tips;
}
-void GettingStartedWelcomePageWidget::addToFeatures(const RssItem &feature)
+void GettingStartedWelcomePageWidget::addToFeatures(const Core::RssItem &feature)
{
m_featuredItems.append(feature);
ui->nextFeatureBtn->setEnabled(true);
@@ -503,7 +500,7 @@ void GettingStartedWelcomePageWidget::showFeature(int feature)
m_currentFeature = rand()%m_featuredItems.count();
}
- RssItem item = m_featuredItems.at(m_currentFeature);
+ const Core::RssItem &item = m_featuredItems.at(m_currentFeature);
ui->featuredTextLabel->setTextFormat(Qt::RichText);
QString text = QString::fromLatin1("<b style='color: rgb(85, 85, 85);'>%1</b><br><b>%2</b><br/><br/>%3").arg(item.category).arg(item.title).arg(item.description);
ui->featuredTextLabel->setText(text);
diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.h b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.h
index 461d24e88c..be3064d20c 100644
--- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.h
+++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.h
@@ -42,14 +42,10 @@ class QMenu;
QT_END_NAMESPACE
namespace Core {
- namespace Internal {
- class RssFetcher;
- class RssItem;
- }
+class RssFetcher;
+class RssItem;
}
-using namespace Core::Internal;
-
namespace Qt4ProjectManager {
namespace Internal {
@@ -98,7 +94,7 @@ private slots:
void slotNextFeature();
void slotPrevFeature();
void slotCreateNewProject();
- void addToFeatures(const RssItem&);
+ void addToFeatures(const Core::RssItem&);
void showFeature(int feature = -1);
signals:
@@ -111,8 +107,8 @@ private:
Ui::GettingStartedWelcomePageWidget *ui;
int m_currentTip;
int m_currentFeature;
- QList<Core::Internal::RssItem> m_featuredItems;
- Core::Internal::RssFetcher *m_rssFetcher;
+ QList<Core::RssItem> m_featuredItems;
+ Core::RssFetcher *m_rssFetcher;
};
} // namespace Internal
diff --git a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
index a22ab0473a..081a20d2ae 100644
--- a/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
@@ -38,7 +38,7 @@
#include "ui_qt4projectconfigwidget.h"
#include <coreplugin/icore.h>
-#include <coreplugin/mainwindow.h>
+
#include <projectexplorer/toolchain.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildconfiguration.h>
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 7a6d6f97df..e96298cf03 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -5655,10 +5655,10 @@ QString BaseTextEditorEditable::contextHelpId() const
void BaseTextEditor::setRefactorMarkers(const Internal::RefactorMarkers &markers)
{
- foreach (const Internal::RefactorMarker &marker, d->m_refactorOverlay->markers())
+ foreach (const RefactorMarker &marker, d->m_refactorOverlay->markers())
requestBlockUpdate(marker.cursor.block());
d->m_refactorOverlay->setMarkers(markers);
- foreach (const Internal::RefactorMarker &marker, markers)
+ foreach (const RefactorMarker &marker, markers)
requestBlockUpdate(marker.cursor.block());
}
diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h
index c544e23b6b..ec51a3f86b 100644
--- a/src/plugins/texteditor/basetexteditor.h
+++ b/src/plugins/texteditor/basetexteditor.h
@@ -50,36 +50,13 @@ namespace Utils {
namespace TextEditor {
class TabSettings;
+class RefactorOverlay;
+struct RefactorMarker;
namespace Internal {
class BaseTextEditorPrivate;
class TextEditorOverlay;
- class RefactorOverlay;
- struct RefactorMarker;
typedef QList<RefactorMarker> RefactorMarkers;
-
- class TEXTEDITOR_EXPORT BaseTextBlockSelection
- {
- public:
-
- bool isValid() const{ return !firstBlock.isNull() && !lastBlock.isNull(); }
- void clear() { firstBlock = lastBlock = QTextCursor(); }
-
- QTextCursor firstBlock; // defines the first block
- QTextCursor lastBlock; // defines the last block
- int firstVisualColumn; // defines the first visual column of the selection
- int lastVisualColumn; // defines the last visual column of the selection
- enum Anchor {TopLeft = 0, TopRight, BottomLeft, BottomRight} anchor;
- BaseTextBlockSelection():firstVisualColumn(0), lastVisualColumn(0), anchor(BottomRight){}
- void moveAnchor(int blockNumber, int visualColumn);
- inline int anchorColumnNumber() const { return (anchor % 2) ? lastVisualColumn : firstVisualColumn; }
- inline int anchorBlockNumber() const {
- return (anchor <= TopRight ? firstBlock.blockNumber() : lastBlock.blockNumber()); }
- QTextCursor selection(const TabSettings &ts) const;
- void fromSelection(const TabSettings &ts, const QTextCursor &selection);
- };
-
-
}
class ITextMarkable;
@@ -351,7 +328,7 @@ private:
Internal::BaseTextEditorPrivate *d;
friend class Internal::BaseTextEditorPrivate;
friend class Internal::TextEditorOverlay;
- friend class Internal::RefactorOverlay;
+ friend class RefactorOverlay;
public:
QWidget *extraArea() const;
@@ -387,7 +364,7 @@ public:
void setRefactorMarkers(const Internal::RefactorMarkers &markers);
signals:
- void refactorMarkerClicked(const TextEditor::Internal::RefactorMarker &marker);
+ void refactorMarkerClicked(const TextEditor::RefactorMarker &marker);
public:
diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h
index b15f15c53c..ccdae6c4d0 100644
--- a/src/plugins/texteditor/basetexteditor_p.h
+++ b/src/plugins/texteditor/basetexteditor_p.h
@@ -53,6 +53,27 @@ class TextEditorActionHandler;
namespace Internal {
+class TEXTEDITOR_EXPORT BaseTextBlockSelection
+{
+public:
+
+ bool isValid() const{ return !firstBlock.isNull() && !lastBlock.isNull(); }
+ void clear() { firstBlock = lastBlock = QTextCursor(); }
+
+ QTextCursor firstBlock; // defines the first block
+ QTextCursor lastBlock; // defines the last block
+ int firstVisualColumn; // defines the first visual column of the selection
+ int lastVisualColumn; // defines the last visual column of the selection
+ enum Anchor {TopLeft = 0, TopRight, BottomLeft, BottomRight} anchor;
+ BaseTextBlockSelection():firstVisualColumn(0), lastVisualColumn(0), anchor(BottomRight){}
+ void moveAnchor(int blockNumber, int visualColumn);
+ inline int anchorColumnNumber() const { return (anchor % 2) ? lastVisualColumn : firstVisualColumn; }
+ inline int anchorBlockNumber() const {
+ return (anchor <= TopRight ? firstBlock.blockNumber() : lastBlock.blockNumber()); }
+ QTextCursor selection(const TabSettings &ts) const;
+ void fromSelection(const TabSettings &ts, const QTextCursor &selection);
+};
+
//========== Pointers with reference count ==========
template <class T> class QRefCountData : public QSharedData
diff --git a/src/plugins/texteditor/completionsupport.cpp b/src/plugins/texteditor/completionsupport.cpp
index 8feb4bbd60..748d0f6c81 100644
--- a/src/plugins/texteditor/completionsupport.cpp
+++ b/src/plugins/texteditor/completionsupport.cpp
@@ -40,11 +40,7 @@
#include <QtCore/QString>
#include <QtCore/QList>
-#include <algorithm>
-
-using namespace TextEditor;
-using namespace TextEditor::Internal;
-
+namespace TextEditor {
CompletionSupport *CompletionSupport::instance()
{
@@ -54,48 +50,68 @@ CompletionSupport *CompletionSupport::instance()
return m_instance;
}
-CompletionSupport::CompletionSupport()
- : QObject(Core::ICore::instance()),
- m_completionList(0),
- m_startPosition(0),
- m_checkCompletionTrigger(false),
- m_editor(0),
- m_completionCollector(0)
+class CompletionSupportPrivate {
+public:
+ CompletionSupportPrivate();
+
+ Internal::CompletionWidget *m_completionList;
+ int m_startPosition;
+ bool m_checkCompletionTrigger; // Whether to check for completion trigger after cleanup
+ ITextEditable *m_editor;
+ const QList<ICompletionCollector *> m_completionCollectors;
+ ICompletionCollector *m_completionCollector;
+};
+
+CompletionSupportPrivate::CompletionSupportPrivate() :
+ m_completionList(0),
+ m_startPosition(0),
+ m_checkCompletionTrigger(false),
+ m_editor(0),
+ m_completionCollectors(ExtensionSystem::PluginManager::instance()
+ ->getObjects<ICompletionCollector>()),
+ m_completionCollector(0)
+{
+}
+
+CompletionSupport::CompletionSupport() :
+ QObject(Core::ICore::instance()), d(new CompletionSupportPrivate)
+{
+}
+
+CompletionSupport::~CompletionSupport()
{
- m_completionCollectors = ExtensionSystem::PluginManager::instance()
- ->getObjects<ICompletionCollector>();
}
void CompletionSupport::performCompletion(const CompletionItem &item)
{
- item.collector->complete(item, m_completionList->typedChar());
- m_checkCompletionTrigger = true;
+ item.collector->complete(item, d->m_completionList->typedChar());
+ d->m_checkCompletionTrigger = true;
}
void CompletionSupport::cleanupCompletions()
{
- if (m_completionList)
- disconnect(m_completionList, SIGNAL(destroyed(QObject*)),
+ if (d->m_completionList)
+ disconnect(d->m_completionList, SIGNAL(destroyed(QObject*)),
this, SLOT(cleanupCompletions()));
- if (m_checkCompletionTrigger)
- m_checkCompletionTrigger = m_completionCollector->shouldRestartCompletion();
+ if (d->m_checkCompletionTrigger)
+ d->m_checkCompletionTrigger = d->m_completionCollector->shouldRestartCompletion();
- m_completionList = 0;
- m_completionCollector->cleanup();
+ d->m_completionList = 0;
+ d->m_completionCollector->cleanup();
- if (m_checkCompletionTrigger) {
- m_checkCompletionTrigger = false;
+ if (d->m_checkCompletionTrigger) {
+ d->m_checkCompletionTrigger = false;
// Only check for completion trigger when some text was entered
- if (m_editor->position() > m_startPosition)
- autoComplete(m_editor, false);
+ if (d->m_editor->position() > d->m_startPosition)
+ autoComplete(d->m_editor, false);
}
}
bool CompletionSupport::isActive() const
{
- return m_completionList != 0;
+ return d->m_completionList != 0;
}
void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
@@ -113,68 +129,68 @@ void CompletionSupport::quickFix(ITextEditable *editor)
void CompletionSupport::autoComplete_helper(ITextEditable *editor, bool forced,
bool quickFix)
{
- m_completionCollector = 0;
+ d->m_completionCollector = 0;
- foreach (ICompletionCollector *collector, m_completionCollectors) {
+ foreach (ICompletionCollector *collector, d->m_completionCollectors) {
if (quickFix)
collector = qobject_cast<IQuickFixCollector *>(collector);
if (collector && collector->supportsEditor(editor)) {
- m_completionCollector = collector;
+ d->m_completionCollector = collector;
break;
}
}
- if (!m_completionCollector)
+ if (!d->m_completionCollector)
return;
- m_editor = editor;
+ d->m_editor = editor;
QList<CompletionItem> completionItems;
int currentIndex = 0;
- if (!m_completionList) {
+ if (!d->m_completionList) {
if (!forced) {
- const CompletionSettings &completionSettings = m_completionCollector->completionSettings();
+ const CompletionSettings &completionSettings = d->m_completionCollector->completionSettings();
if (completionSettings.m_completionTrigger == ManualCompletion)
return;
- if (!m_completionCollector->triggersCompletion(editor))
+ if (!d->m_completionCollector->triggersCompletion(editor))
return;
}
- m_startPosition = m_completionCollector->startCompletion(editor);
+ d->m_startPosition = d->m_completionCollector->startCompletion(editor);
completionItems = getCompletions();
- QTC_ASSERT(!(m_startPosition == -1 && completionItems.size() > 0), return);
+ QTC_ASSERT(!(d->m_startPosition == -1 && completionItems.size() > 0), return);
if (completionItems.isEmpty()) {
cleanupCompletions();
return;
}
- m_completionList = new CompletionWidget(this, editor);
- m_completionList->setQuickFix(quickFix);
+ d->m_completionList = new Internal::CompletionWidget(this, editor);
+ d->m_completionList->setQuickFix(quickFix);
- connect(m_completionList, SIGNAL(itemSelected(TextEditor::CompletionItem)),
+ connect(d->m_completionList, SIGNAL(itemSelected(TextEditor::CompletionItem)),
this, SLOT(performCompletion(TextEditor::CompletionItem)));
- connect(m_completionList, SIGNAL(completionListClosed()),
+ connect(d->m_completionList, SIGNAL(completionListClosed()),
this, SLOT(cleanupCompletions()));
// Make sure to clean up the completions if the list is destroyed without
// emitting completionListClosed (can happen when no focus out event is received,
// for example when switching applications on the Mac)
- connect(m_completionList, SIGNAL(destroyed(QObject*)),
+ connect(d->m_completionList, SIGNAL(destroyed(QObject*)),
this, SLOT(cleanupCompletions()));
} else {
completionItems = getCompletions();
if (completionItems.isEmpty()) {
- m_completionList->closeList();
+ d->m_completionList->closeList();
return;
}
- if (m_completionList->explicitlySelected()) {
- const int originalIndex = m_completionList->currentCompletionItem().originalIndex;
+ if (d->m_completionList->explicitlySelected()) {
+ const int originalIndex = d->m_completionList->currentCompletionItem().originalIndex;
for (int index = 0; index < completionItems.size(); ++index) {
if (completionItems.at(index).originalIndex == originalIndex) {
@@ -185,24 +201,26 @@ void CompletionSupport::autoComplete_helper(ITextEditable *editor, bool forced,
}
}
- m_completionList->setCompletionItems(completionItems);
+ d->m_completionList->setCompletionItems(completionItems);
if (currentIndex)
- m_completionList->setCurrentIndex(currentIndex);
+ d->m_completionList->setCurrentIndex(currentIndex);
// Partially complete when completion was forced
- if (forced && m_completionCollector->partiallyComplete(completionItems)) {
- m_checkCompletionTrigger = true;
- m_completionList->closeList();
+ if (forced && d->m_completionCollector->partiallyComplete(completionItems)) {
+ d->m_checkCompletionTrigger = true;
+ d->m_completionList->closeList();
} else {
- m_completionList->showCompletions(m_startPosition);
+ d->m_completionList->showCompletions(d->m_startPosition);
}
}
QList<CompletionItem> CompletionSupport::getCompletions() const
{
- if (m_completionCollector)
- return m_completionCollector->getCompletions();
+ if (d->m_completionCollector)
+ return d->m_completionCollector->getCompletions();
return QList<CompletionItem>();
}
+
+} // namespace TextEditor
diff --git a/src/plugins/texteditor/completionsupport.h b/src/plugins/texteditor/completionsupport.h
index ec83e49aed..5c841d1bbd 100644
--- a/src/plugins/texteditor/completionsupport.h
+++ b/src/plugins/texteditor/completionsupport.h
@@ -40,9 +40,7 @@ class CompletionItem;
class ICompletionCollector;
class ITextEditable;
-namespace Internal {
-
-class CompletionWidget;
+class CompletionSupportPrivate;
/* Completion support is responsible for querying the list of completion collectors
and popping up the CompletionWidget with the available completions.
@@ -52,7 +50,7 @@ class TEXTEDITOR_EXPORT CompletionSupport : public QObject
Q_OBJECT
public:
- CompletionSupport();
+ virtual ~CompletionSupport();
static CompletionSupport *instance();
@@ -67,18 +65,14 @@ private slots:
void cleanupCompletions();
private:
+ CompletionSupport();
+
QList<CompletionItem> getCompletions() const;
void autoComplete_helper(ITextEditable *editor, bool forced, bool quickFix);
- CompletionWidget *m_completionList;
- int m_startPosition;
- bool m_checkCompletionTrigger; // Whether to check for completion trigger after cleanup
- ITextEditable *m_editor;
- QList<ICompletionCollector *> m_completionCollectors;
- ICompletionCollector *m_completionCollector;
+ QScopedPointer<CompletionSupportPrivate> d;
};
-} // namespace Internal
} // namespace TextEditor
#endif // COMPLETIONSUPPORT_H
diff --git a/src/plugins/texteditor/completionwidget.h b/src/plugins/texteditor/completionwidget.h
index a550b3c1e2..b10392c3f5 100644
--- a/src/plugins/texteditor/completionwidget.h
+++ b/src/plugins/texteditor/completionwidget.h
@@ -38,11 +38,11 @@ namespace TextEditor {
class CompletionItem;
class ITextEditable;
+class CompletionSupport;
namespace Internal {
class AutoCompletionModel;
-class CompletionSupport;
class CompletionListView;
class CompletionInfoFrame;
diff --git a/src/plugins/texteditor/refactoroverlay.cpp b/src/plugins/texteditor/refactoroverlay.cpp
index 07bd35bc6b..68d0f22a17 100644
--- a/src/plugins/texteditor/refactoroverlay.cpp
+++ b/src/plugins/texteditor/refactoroverlay.cpp
@@ -1,10 +1,42 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
#include "refactoroverlay.h"
-#include <QPainter>
-#include <QTextBlock>
#include "basetextdocumentlayout.h"
-#include <QDebug>
+#include "basetexteditor.h"
+
+#include <QtGui/QPainter>
+#include <QtGui/QTextBlock>
-using namespace TextEditor::Internal;
+#include <QtCore/QDebug>
+
+namespace TextEditor {
RefactorOverlay::RefactorOverlay(TextEditor::BaseTextEditor *editor) :
QObject(editor),
@@ -62,4 +94,4 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte
m_maxWidth = qMax((qreal)m_maxWidth, x + sz.width() - offset.x());
}
-
+} // namespace TextEditor
diff --git a/src/plugins/texteditor/refactoroverlay.h b/src/plugins/texteditor/refactoroverlay.h
index 6e4c3898b5..8f2255ff31 100644
--- a/src/plugins/texteditor/refactoroverlay.h
+++ b/src/plugins/texteditor/refactoroverlay.h
@@ -1,13 +1,42 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
#ifndef REFACTOROVERLAY_H
#define REFACTOROVERLAY_H
-#include "basetexteditor.h"
+#include "texteditor_global.h"
#include <QtGui/QTextCursor>
#include <QtGui/QIcon>
namespace TextEditor {
-namespace Internal {
+class BaseTextEditor;
struct TEXTEDITOR_EXPORT RefactorMarker {
inline bool isValid() const { return !cursor.isNull(); }
@@ -41,11 +70,9 @@ private:
RefactorMarkers m_markers;
BaseTextEditor *m_editor;
int m_maxWidth;
- QIcon m_icon;
-
+ const QIcon m_icon;
};
-}
-}
+} // namespace TextEditor
#endif // REFACTOROVERLAY_H
diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp
index 7ee11757cd..0be9d60ada 100644
--- a/src/plugins/texteditor/texteditoroverlay.cpp
+++ b/src/plugins/texteditor/texteditoroverlay.cpp
@@ -28,6 +28,7 @@
**************************************************************************/
#include "texteditoroverlay.h"
+#include "basetexteditor.h"
#include <QtGui/QPainter>
#include <QtGui/QTextBlock>
@@ -35,8 +36,6 @@
using namespace TextEditor;
using namespace TextEditor::Internal;
-
-
TextEditorOverlay::TextEditorOverlay(BaseTextEditor *editor)
:QObject(editor) {
m_visible = false;
diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h
index 59fa6ed7cf..f64bb08bae 100644
--- a/src/plugins/texteditor/texteditoroverlay.h
+++ b/src/plugins/texteditor/texteditoroverlay.h
@@ -30,13 +30,20 @@
#ifndef TEXTEDITOROVERLAY_H
#define TEXTEDITOROVERLAY_H
-#include <QtGui/QWidget>
-#include "basetexteditor.h"
+#include <QtCore/QObject>
+
+#include <QtGui/QTextCursor>
+#include <QtGui/QColor>
+
+QT_FORWARD_DECLARE_CLASS(QWidget)
namespace TextEditor {
+class BaseTextEditor;
+
namespace Internal {
-struct TEXTEDITOR_EXPORT OverlaySelection {
+struct OverlaySelection
+{
OverlaySelection():m_fixedLength(-1), m_dropShadow(false){}
QTextCursor m_cursor_begin;
QTextCursor m_cursor_end;
@@ -44,22 +51,22 @@ struct TEXTEDITOR_EXPORT OverlaySelection {
QColor m_bg;
int m_fixedLength;
bool m_dropShadow;
- };
+};
-class TEXTEDITOR_EXPORT TextEditorOverlay : public QObject
+class TextEditorOverlay : public QObject
{
-Q_OBJECT
-BaseTextEditor *m_editor;
-QWidget *m_viewport;
+ Q_OBJECT
+ BaseTextEditor *m_editor;
+ QWidget *m_viewport;
public:
-QList<OverlaySelection> m_selections;
-private:
+ QList<OverlaySelection> m_selections;
-bool m_visible;
-int m_borderWidth;
-int m_dropShadowWidth;
-bool m_alpha;
+private:
+ bool m_visible;
+ int m_borderWidth;
+ int m_dropShadowWidth;
+ bool m_alpha;
public:
TextEditorOverlay(BaseTextEditor *editor);
@@ -103,7 +110,6 @@ private:
QPainterPath createSelectionPath(const QTextCursor &begin, const QTextCursor &end, const QRect& clip);
void paintSelection(QPainter *painter, const OverlaySelection &selection);
void fillSelection(QPainter *painter, const OverlaySelection &selection, const QColor &color);
-
};
} // namespace Internal
diff --git a/src/plugins/welcome/communitywelcomepagewidget.cpp b/src/plugins/welcome/communitywelcomepagewidget.cpp
index ac80277d91..b738d2aeba 100644
--- a/src/plugins/welcome/communitywelcomepagewidget.cpp
+++ b/src/plugins/welcome/communitywelcomepagewidget.cpp
@@ -37,8 +37,6 @@
#include <QtGui/QDesktopServices>
#include <QtGui/QTreeWidgetItem>
-using namespace Core::Internal;
-
struct Site {
const char *description;
const char *url;
@@ -82,7 +80,7 @@ static inline void populateWelcomeTreeWidget(const Site *sites, int count, Utils
CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) :
QWidget(parent),
- m_rssFetcher(new RssFetcher(7)),
+ m_rssFetcher(new Core::RssFetcher(7)),
ui(new Ui::CommunityWelcomePageWidget)
{
ui->setupUi(this);
diff --git a/src/plugins/welcome/communitywelcomepagewidget.h b/src/plugins/welcome/communitywelcomepagewidget.h
index ff088e692c..9e57ca6c07 100644
--- a/src/plugins/welcome/communitywelcomepagewidget.h
+++ b/src/plugins/welcome/communitywelcomepagewidget.h
@@ -37,9 +37,7 @@ class QUrl;
QT_END_NAMESPACE
namespace Core{
-namespace Internal {
- class RssFetcher;
-}
+class RssFetcher;
}
namespace Welcome {
@@ -65,7 +63,7 @@ private slots:
private:
- Core::Internal::RssFetcher *m_rssFetcher;
+ Core::RssFetcher *m_rssFetcher;
Ui::CommunityWelcomePageWidget *ui;
};